4. Our
architecture
(~
2015)
• PHP
Monolith
built
with
Symfony2
Symfony2
Monolith
(mod_php)
LB
(Nginx)
MySQL
mongoDB
ElasXcsearch
5. Microservices
Architecture
Building
applicaXon
as
a
suite
of
small
services
• Each
service
has
it’s
own
codebase
• Each
service
runs
under
dedicated
process
• Each
service
can
be
wriZen
in
different
languages
• Each
service
has
it’s
own
datastore
• Each
service
has
it’s
own
deployment
strategy
6. Our
architecture
(2015
~)
ElasXcsearch
LB
(Nginx)
mongo
MySQL
Symfony2
Monolith
(mod_php
+
CLI)
mongo
MySQL
API
endpoint
(Rails)
MySQL
Messaging
(Rails)
ElasXcsearch
RecommendaXon
Engine
Document
censorship
Document
Converter
RabbitMQ
Broker
ElasXcsearch
Site
StaXsXcs
Dashboard
7. • Inter-‐process
communicaXon
overhead
– SerializaXon,
Network
RTT
• New
middlewares
– Load
balancing
/
API
discovery
• More
management
costs
– Monitoring
&
Error
NoXficaXons
– Deployment
Infrastructure
– Performance
Profiling
Cost
of
Microservices
8. • Inter-‐process
communicaXon
overhead
– SerializaXon,
Network
RTT
• New
middlewares
– Load
balancing
/
API
discovery
/
Profiling
• More
management
costs
– Monitoring
&
Error
NoXficaXons
– Deployment
Infrastructure
– Performance
Profiling
Cost
of
Microservices
9. • Inter-‐process
communicaXon
overhead
– SerializaXon,
Network
RTT
• New
middlewares
– Load
balancing
/
API
discovery
• More
management
costs
– Monitoring
&
Error
NoXficaXons
– Deployment
Infrastructure
– Performance
Profiling
Cost
of
Microservices
10. New
middlewares
• Load
balancing
• API
discovery
/
rouXng
service
• RPC
request
profiling
11.
12. RabbitMQ
RPC:
Pros
• No
need
of
load
balancing
• No
need
of
API
discovery
service
• Synchronous
RPC
/
Asynchronous
Messaging
• Nice
built-‐in
web
UI