22
Octubre 2014 Shoe Lovers @ dev.f

Devf (Shoe Lovers)

Embed Size (px)

DESCRIPTION

A general overview of the things we are doing @ Shoe Lovers and the technical challenges we are facing.

Citation preview

Page 1: Devf (Shoe Lovers)

Octubre 2014

Shoe Lovers @ dev.f

Page 2: Devf (Shoe Lovers)

Retos

• Hacer lo que te apasiona.

• Las recompensas vienen solas.

• Utilizar todas las herramientas a tu alcance.

Page 3: Devf (Shoe Lovers)

Shoe Lovers• Comunidad con 25,000,000 de seguidores en

Facebook.

• Más de 8,000,000 de interacciones al día.

• Social Commerce (uso de interacciones sociales para facilitar y promovers transacciones electrónicas de compra/venta).

• Un reto técnico pero al final un negocio rentable.

Page 4: Devf (Shoe Lovers)

Primeros Hacks

¿Comprar o construir?

Page 5: Devf (Shoe Lovers)

Escalando

• Infraestructura

• Equipos

Page 6: Devf (Shoe Lovers)

Nuestro Stack

• LAMP (SoftLayer, AWS)

• Google Cloud

Page 7: Devf (Shoe Lovers)

LAMP AWS• EC2 (Elastic Compute Cloud, instance types, zones)

• S3 (Simple Storage Service)

• Load Balancer (Sessions)

• RDS (Relational Database Server)

• Managed vs. Self Managed

• Master & Read Replica(s) -> delay

• Redshift, DynamoDB, ElastiCache, SES, SQS

• Autoscaling (cloudwatch)

• Caching (redis, memcache)

• Optimizar para costos de operación

Page 8: Devf (Shoe Lovers)

http://techblog.netflix.com/2012/06/asgard-web-based-cloud-management-and.html

LAMP AWS

Page 9: Devf (Shoe Lovers)

Google Cloud• App engine

• Datastore (BigTable) (stats)

• Blobstore (image service) (demo)

• Memcache (ndb datastore api)

• CloudSQL

• Map-Reduce

• Compute Engine

Page 10: Devf (Shoe Lovers)

Requests, Latency, Instances

Page 11: Devf (Shoe Lovers)

class PostLike(ndb.Model): parent_id=ndb.StringProperty() sender_id=ndb.StringProperty() verb=ndb.StringProperty() created_time=ndb.IntegerProperty() source= ndb.StringProperty() #the source can be facebook or the website deleted = ndb.BooleanProperty(default=False) created = ndb.DateTimeProperty(auto_now_add=True) modify = ndb.DateTimeProperty(auto_now=True) post_picture=ndb.StringProperty() user_picture=ndb.StringProperty() !newLike= localmodels.PostLike(parent_id =parent_id, sender_id = sender_id, verb=verb, created_time=created_time , source=‘FBRT') !newLike.put() !newLike.key.delete() !likesPost= localmodels.PostLike.query(localmodels.PostLike.parent_id==post_id).fetch(10)

Datastore

Page 12: Devf (Shoe Lovers)

Datastore

Page 13: Devf (Shoe Lovers)

6 días de ‘Likes’

Datastore

Page 14: Devf (Shoe Lovers)

6 días de ‘Comments’

Datastore

Page 15: Devf (Shoe Lovers)

Blobstore & Image Serviceclass BlobstoreUploadHandler(blobstore_handlers.BlobstoreUploadHandler): def post(self): upload_files = self.get_uploads('file') blob_info = upload_files[0] blob_key=blob_info.key() serving_url= images.get_serving_url(blob_key) return serving_url !!!POST multipart/form-data !!

Page 16: Devf (Shoe Lovers)

Blob key: AMIfv96pxt34ek2mz_aS8i24hTJW7ZAnELPf15B8rp2XYzCg8yz6JklfBejG1izZrnxeReSdvhlX6cXIkGABNu2esQQB5ocPxAumYCKdLqgGx8RRFTTTg7HvNiemHoEXi7u82uczHRolloLenagWJ9ASl-QHng2SRXvFZP_0045-Y8QjOGvRMkI !Serving URL (crop, resize):!http://lh3.ggpht.com/IhESBu6X7DGzTRc5F6LhfMEKN-3UhPXjv9_7d0nkg_2EOuQFhzu_TdBSnSi08mHVClWZ_po-j3lsFTISJPFJffP1e3o_xg=s0 !http://lh3.ggpht.com/IhESBu6X7DGzTRc5F6LhfMEKN-3UhPXjv9_7d0nkg_2EOuQFhzu_TdBSnSi08mHVClWZ_po-j3lsFTISJPFJffP1e3o_xg=s200 !http://lh3.ggpht.com/IhESBu6X7DGzTRc5F6LhfMEKN-3UhPXjv9_7d0nkg_2EOuQFhzu_TdBSnSi08mHVClWZ_po-j3lsFTISJPFJffP1e3o_xg=s200-c

Blobstore & Image Service

Page 17: Devf (Shoe Lovers)

Memcache data = memcache.get(key) ! if data is None: data=getDataFromDB(key) memcache.add(key, data) return data

Page 18: Devf (Shoe Lovers)

Memcache

Page 19: Devf (Shoe Lovers)

Challenge

• Extract value from all that info:

• Patterns

• Trends

• Recommendations

Page 20: Devf (Shoe Lovers)

Future• Big Query

• Backends

• Prediction.io

• Apache Spark (ML)

• Cassandra (Datastax)

Page 21: Devf (Shoe Lovers)

References• https://github.com/coto/gae-boilerplate

• https://www.udacity.com/course/cs253

• http://es.slideshare.net/kigster/scaling-wanelocom-100x-in-six-months

• https://spark.apache.org/

• https://github.com/Netflix/asgard

• http://techblog.netflix.com/

Page 22: Devf (Shoe Lovers)

–Anthony Robbins

“Focus on where you want to go, not on what you fear.”