PHP Experience 2016 - IT Master
First 90ScalingWithMicroservice
This is our visionBuilding the foundation to Build a 3B Company by FY20
Agenda
+ What we call Microservices ?
+ Benefit and Challenge
+ Scaling in MercadoLivre
+ Lessons Learned
Microservicesis a new "tag" for things we are already doing.
This is our visionBuilding the foundation to Build a 3B Company by FY20
Vs
Monolithic vs Microservices
A Tiny Definition of Microservices
Small Autonomous services communicating with each other using language-agnostic APIs.
+ Different languages, databases, hardware ...
+ Each service can be deployed independently
+ The services are easy to replace
+ Improved fault isolation
Benefit
+ Operations Overhead
+ Avoid Nanoservice
+ Implicit Interfaces
+ Network communication
Challenge
Scaling in MercadoLivre
“Scalability Porn”
18.000.000 Request per minutes
400 Deploys per days
700 Developers in 6 development centers
20.000 Virtual servers
1.500 Physical servers
Microservices - API MercadoLibre
Services Communicate -> HTTP/REST with JSON
API Gateway -> NGINX
NGINX
User Service
Item Service
Categories Service
Lessonslearned
Cache everythingReuse HTTP headers
GET https://api.mercadolibre.com/sites/MLB
HTTP/1.1 200 OK
Cache-Control: max-age=60, stale-while-revalidate=240{........}
200 & 206 Partial ContentDesigned to worst-case
VIP
User Service
Reputation
Service
User Service
Reputation
Service
VIP
Online GET vs Background update Resources with few changes and many outbuildings
User Service
Item Service
Categories Services
Search Service
- Dump all categories- Update each 10 minutes
Duplicate DataEach department can have a copy of the data
POST Item
Item Service
Search Service
Moderation Service
Queue Service
Item DB
Item DB (partial copy)
Item DB (partial copy)
Thank You
?