SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
PHP Experience 2016 - [Palestra] Scaling with Microservice
PHP Experience 2016 - [Palestra] Scaling with Microservice
1.
PHP Experience 2016 - IT Master
First 90Scaling
With
Microservice
2.
This is our vision
Building the foundation to Build a 3B Company by FY20
Agenda
+ What we call Microservices ?
+ Benefit and Challenge
+ Scaling in MercadoLivre
+ Lessons Learned
3.
Microservices
is a new "tag" for
things we are already
doing.
4.
This is our vision
Building the foundation to Build a 3B Company by FY20
Vs
Monolithic vs Microservices
5.
A Tiny Definition of
Microservices
Small Autonomous services
communicating with each other
using language-agnostic APIs.
6.
+ Different languages, databases, hardware ...
+ Each service can be deployed independently
+ The services are easy to replace
+ Improved fault isolation
Benefit
9.
“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
10.
Microservices - API MercadoLibre
Services Communicate -> HTTP/REST with JSON
API Gateway -> NGINX
NGINX
User Service
Item Service
Categories Service
12.
Cache everything
Reuse HTTP headers
GET https://api.mercadolibre.com/sites/MLB
HTTP/1.1 200 OK
Cache-Control: max-age=60, stale-while-revalidate=240
{........}
13.
200 & 206 Partial Content
Designed to worst-case
VIP
User Service
Reputation
Service
User Service
Reputation
Service
VIP
14.
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
15.
Duplicate Data
Each 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)