Download - Microservicios, en qué lío me he metido
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
Microservcios, en qué lío me he metido.
Ernesto HernándezPacklink
Miguel OrtegaPacklink
9 y 10 de febrero#T3chFest2017
LabelsTrackingPayments: Credit card, Paypal, DeferredInvoicingE-commerces integrationAutocomplete rulesZip codes
NOT JUST A SIMPLE CARRIER COMPARATOR
9 y 10 de febrero#T3chFest2017
● 7 Countries
● Over 50 carriers
● >300 shipping services
● >500% shipment grow
● >2M shipments/year
9 y 10 de febrero#T3chFest2017
http://transformcustomers.com/category/business-transformation/ 9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
Our legacy old
Monolith
http://isijisan.blogspot.com.es/2015/03/el-escarabajo-pelotero.html
9 y 10 de febrero#T3chFest2017
Our shiny and new
Monolith
https://mekubal.wordpress.com/2012/04/03/the-myth-of-monolithic-judaism/
KOKUDO
9 y 10 de febrero#T3chFest2017
● Another monolith
● ESB orchestration
● DB coupling
● Fixed deploy dates
● Something distributed
● More choreography
● Different storages
● Deploy flexibility
9 y 10 de febrero#T3chFest2017
Event Driven ArchitectureApps generates events when an action occurs.
Events are published to a message bus
Events represent things that happened in our apps like “client.created”
Other apps can react to this events with other actions or creating materialized views
9 y 10 de febrero#T3chFest2017
New apps can only receive events since the time that was introduced in our platform
Materialized view for the new microservice it’s not complete
What about a new microservice ?
9 y 10 de febrero#T3chFest2017
Event store
Apps events are stored in an event log
Events are appended at the end of the log
9 y 10 de febrero#T3chFest2017
If a new service is added to the platform, it`s materialized view can be recreated with the past events
Event store - adding a new app
Apps events are stored in an event log
Events are appended at the end of the log
9 y 10 de febrero#T3chFest2017
Benefits
• Materialized views
• Rebuild app state
• Stream processing
• CEP
9 y 10 de febrero#T3chFest2017
“Distributed transactions”
• Avoid 2 phase commit !!!
• Do compensating
transactions instead
9 y 10 de febrero#T3chFest2017
Event Sourcing
https://martinfowler.com/articles/201701-event-driven.html
http://microservices.io/patterns/data/event-driven-architecture.html
9 y 10 de febrero#T3chFest2017
Docker Ecosystem FTW
● build once, run everywhere
● easy scaling with docker-compose
● infrastructure scaling with swarm
9 y 10 de febrero#T3chFest2017
Hashicorp Consul
- Key/Value (backed by git repo)
- consul-template
- Leader election
- DNS
- Already needed for docker swarm
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
New old problems
● Onboarding new developers
● Config management
● Debugging
● Data Bootstrapping
9 y 10 de febrero#T3chFest2017
What do we need?
● Infrastructure Bootstrapping:
○ up and running
○ configuration
● Microservices Bootstrapping:
○ up and running
○ application data
9 y 10 de febrero#T3chFest2017
How do we solved it?
● Infrastructure Bootstrapping.
○ up and running
○ configuration
● Microservices Bootstrapping:
○ up and running
○ application data
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
How do we solved it?
● Infrastructure Bootstrapping.
○ up and running
○ configuration
● Microservices Bootstrapping:
○ up and running
○ application data
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
Platform versioning
• microservices.yml - v 2.1.4• search-engine v 2.3.1
• client v 4.2.3
• infrastructure.yml - v 2.1.4• percona v 5.6
• rabbitmq v 3.5
• config repo - v 2.1.4
Packlink v 2.1.4
9 y 10 de febrero#T3chFest2017
Correlation id
Network call{ correlation_id: 123, ... }
{ correlation_id: 123, ... }{ correlation_id: 123, ... }
{ correlation_id: 123, ... }
{ correlation_id: 123, ... }
{ correlation_id: 123, ... }
9 y 10 de febrero#T3chFest2017
Wiggumbot
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+pluginhttp://docs.sonarqube.org/display/PLUG/GitHub+Plugin9 y 10 de febrero
#T3chFest2017
(Our personal code-reviewer guardian)
9 y 10 de febrero#T3chFest2017
Hound
https://github.com/etsy/hound
Etsy, Inc.
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
9 y 10 de febrero#T3chFest2017
It seems clear right?
Q&A
9 y 10 de febrero#T3chFest2017