SlideShare une entreprise Scribd logo
1  sur  70
Télécharger pour lire hors ligne
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ández
Packlink
Miguel Ortega
Packlink
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Labels
Tracking
Payments: Credit card, Paypal, Deferred
Invoicing
E-commerces integration
Autocomplete rules
Zip 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
Fast growth
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
Our Monoliths
KOKUDO
9 y 10 de febrero
#T3chFest2017
Business needs!!! We need an API
9 y 10 de febrero
#T3chFest2017Sometimes you need to clean up
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
It seems clear right?
Microservices
9 y 10 de febrero
#T3chFest2017
2014 2015 2016
9 y 10 de febrero
#T3chFest2017
but what the hell is a microservice?
CHALLENGE
ACCEPTED
9 y 10 de febrero
#T3chFest2017
Phase 1
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Phase 2
9 y 10 de febrero
#T3chFest2017
● ONE DATABASE
● STILL A MONOLITH
FATAL
9 y 10 de febrero
#T3chFest2017
Phase 3
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
● NO REAL MICROSERVICES
● DEPLOY/CONFIGURATION HELL
ERROR
9 y 10 de febrero
#T3chFest2017
Turn
Around
9 y 10 de febrero
#T3chFest2017
Phase 4
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Synchronous calls
Network call
9 y 10 de febrero
#T3chFest2017
Synchronous calls
Network call
9 y 10 de febrero
#T3chFest2017
Phase 4
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
● SYNCHRONOUS CALLS HELL
● WHERE ARE MY JOINS?
warning
9 y 10 de febrero
#T3chFest2017
Asynchronous
MESSAGE BUS
9 y 10 de febrero
#T3chFest2017
Phase 5
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Event Driven Architecture Apps 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
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
The Platform
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
Service discovery
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
How do I develop locally?
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
Local development
9 y 10 de febrero
#T3chFest2017
Service discovery (review)
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Local development with your IDE
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Tunnel
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Service discovery (all together)
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
● DUDE, WHERE ARE MY LOGS?
DEBUG
9 y 10 de febrero
#T3chFest2017
Logging stack
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
● Make your application
log-aggregator agnostic
FATAL
9 y 10 de febrero
#T3chFest2017
● How do I trace a single request?
TRACE
9 y 10 de febrero
#T3chFest2017
Distributed tracing
9 y 10 de febrero
#T3chFest2017
Our (helpful) Dev Tools
9 y 10 de febrero
#T3chFest2017
https://slack.com
9 y 10 de febrero
#T3chFest2017
Wiggumbot
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin
http://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
Asciidoctor
http://asciidoctor.org
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
Was it worth it?
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
# Shipments
9 y 10 de febrero
#T3chFest2017
# Deployments
2 → ~20 per week
9 y 10 de febrero
#T3chFest2017
Thank you
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
It seems clear right?
Q&A
9 y 10 de febrero
#T3chFest2017
9 y 10 de febrero
#T3chFest2017
WE ARE HIRING

Contenu connexe

Tendances

Creando tu web con django v1.0
Creando tu web con django v1.0Creando tu web con django v1.0
Creando tu web con django v1.0Keila Zared Carpio
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxParadigma Digital
 
Dev ops infraestructura agil con open source
Dev ops   infraestructura agil con open sourceDev ops   infraestructura agil con open source
Dev ops infraestructura agil con open sourcescrumecuador
 
dockerize.it
dockerize.itdockerize.it
dockerize.itbetabeers
 
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?Globant
 
Construyendo un API REST con Spring Boot y GraalVM
Construyendo un API REST con Spring Boot y GraalVMConstruyendo un API REST con Spring Boot y GraalVM
Construyendo un API REST con Spring Boot y GraalVMIván López Martín
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJSAlberto Gimeno
 
Vagrant sobre Debian: Primeros Pasos
Vagrant sobre Debian: Primeros PasosVagrant sobre Debian: Primeros Pasos
Vagrant sobre Debian: Primeros PasosWalter Vargas
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJSBEEVA_es
 
Casper JS - Asegurando la calidad en front-end Drupal
Casper JS - Asegurando la calidad en front-end DrupalCasper JS - Asegurando la calidad en front-end Drupal
Casper JS - Asegurando la calidad en front-end DrupalDavid Gil Sánchez
 
Asp.net 5 en linux y mac, herramientas e integración
Asp.net 5 en linux y mac, herramientas e integraciónAsp.net 5 en linux y mac, herramientas e integración
Asp.net 5 en linux y mac, herramientas e integraciónrobertogg
 
Capistrano drupalcamp-jerez-2015
Capistrano drupalcamp-jerez-2015Capistrano drupalcamp-jerez-2015
Capistrano drupalcamp-jerez-2015David Gil Sánchez
 
Kubernetes: Caso de uso real con mememtum y Taniwa
Kubernetes: Caso de uso real con mememtum y TaniwaKubernetes: Caso de uso real con mememtum y Taniwa
Kubernetes: Caso de uso real con mememtum y TaniwaJoselu Marina
 

Tendances (20)

Jenkins, no me rompas los builds!
Jenkins, no me rompas los builds!Jenkins, no me rompas los builds!
Jenkins, no me rompas los builds!
 
Turbogears
TurbogearsTurbogears
Turbogears
 
Overview atlas (1)
Overview atlas (1)Overview atlas (1)
Overview atlas (1)
 
Eleva tu capacidad con Groovy
Eleva tu capacidad con GroovyEleva tu capacidad con Groovy
Eleva tu capacidad con Groovy
 
Creando tu web con django v1.0
Creando tu web con django v1.0Creando tu web con django v1.0
Creando tu web con django v1.0
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
 
Dev ops infraestructura agil con open source
Dev ops   infraestructura agil con open sourceDev ops   infraestructura agil con open source
Dev ops infraestructura agil con open source
 
dockerize.it
dockerize.itdockerize.it
dockerize.it
 
Creacion de un cartridge para Openshift
Creacion de un cartridge para OpenshiftCreacion de un cartridge para Openshift
Creacion de un cartridge para Openshift
 
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
 
Construyendo un API REST con Spring Boot y GraalVM
Construyendo un API REST con Spring Boot y GraalVMConstruyendo un API REST con Spring Boot y GraalVM
Construyendo un API REST con Spring Boot y GraalVM
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJS
 
Vagrant sobre Debian: Primeros Pasos
Vagrant sobre Debian: Primeros PasosVagrant sobre Debian: Primeros Pasos
Vagrant sobre Debian: Primeros Pasos
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJS
 
Intro a GIT
Intro a GITIntro a GIT
Intro a GIT
 
Casper JS - Asegurando la calidad en front-end Drupal
Casper JS - Asegurando la calidad en front-end DrupalCasper JS - Asegurando la calidad en front-end Drupal
Casper JS - Asegurando la calidad en front-end Drupal
 
Asp.net 5 en linux y mac, herramientas e integración
Asp.net 5 en linux y mac, herramientas e integraciónAsp.net 5 en linux y mac, herramientas e integración
Asp.net 5 en linux y mac, herramientas e integración
 
Capistrano drupalcamp-jerez-2015
Capistrano drupalcamp-jerez-2015Capistrano drupalcamp-jerez-2015
Capistrano drupalcamp-jerez-2015
 
Kubernetes: Caso de uso real con mememtum y Taniwa
Kubernetes: Caso de uso real con mememtum y TaniwaKubernetes: Caso de uso real con mememtum y Taniwa
Kubernetes: Caso de uso real con mememtum y Taniwa
 
Concurrencia en Java
Concurrencia en Java Concurrencia en Java
Concurrencia en Java
 

Similaire à Microservicios, en qué lío me he metido

Net conf uy 2018 migrating legacy applications
Net conf uy 2018   migrating legacy applicationsNet conf uy 2018   migrating legacy applications
Net conf uy 2018 migrating legacy applicationsRafael Dos Santos
 
NetConfUy 2018 - Azure B2C
NetConfUy 2018 - Azure B2CNetConfUy 2018 - Azure B2C
NetConfUy 2018 - Azure B2Cfernando sonego
 
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...Florencia Nodar💻
 
Integración continua y despliegue automático en Azure 
Integración continua y despliegue automático en Azure Integración continua y despliegue automático en Azure 
Integración continua y despliegue automático en Azure Plain Concepts
 
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)SiteGround España
 
De las redes sociales al comercio electrónico
De las redes sociales al comercio electrónicoDe las redes sociales al comercio electrónico
De las redes sociales al comercio electrónicoAdVentures Digital Agency
 
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojos
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojosNet Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojos
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojosLisandra Armas
 
Caso de Estudio SEO: Elige tu propia aventura #CW17
Caso de Estudio SEO: Elige tu propia aventura #CW17Caso de Estudio SEO: Elige tu propia aventura #CW17
Caso de Estudio SEO: Elige tu propia aventura #CW17MJ Cachón Yáñez
 
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomype
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomypeLastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomype
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomypeSr. Zegarra Villalobos
 
WordPress Analytics. Introducción a la estrategia de analítica web
WordPress Analytics. Introducción a la estrategia de analítica webWordPress Analytics. Introducción a la estrategia de analítica web
WordPress Analytics. Introducción a la estrategia de analítica webPablo Moratinos Almandoz
 
Plataformas Analíticas como Soporte en la Era del Big Data
Plataformas Analíticas como Soporte en la Era del Big DataPlataformas Analíticas como Soporte en la Era del Big Data
Plataformas Analíticas como Soporte en la Era del Big DataDMC Perú
 
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGround
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGroundCómo auditar tu presencia online | Montserrat Cano - Webinar SiteGround
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGroundSiteGround España
 
Taller de Analítica Web - Congreso CID-Murcia
Taller de Analítica Web - Congreso CID-MurciaTaller de Analítica Web - Congreso CID-Murcia
Taller de Analítica Web - Congreso CID-MurciaElBlogdelSEO y SEOStar
 
SharePoint Saturday Madrid 2019 - Productivity based on AI
SharePoint Saturday Madrid 2019 - Productivity based on AISharePoint Saturday Madrid 2019 - Productivity based on AI
SharePoint Saturday Madrid 2019 - Productivity based on AIAlberto Diaz Martin
 
Moving files to and between Teams - What are my options?
Moving files to and between Teams - What are my options?Moving files to and between Teams - What are my options?
Moving files to and between Teams - What are my options?Juan Carlos Gonzalez
 

Similaire à Microservicios, en qué lío me he metido (20)

Net conf uy 2018 migrating legacy applications
Net conf uy 2018   migrating legacy applicationsNet conf uy 2018   migrating legacy applications
Net conf uy 2018 migrating legacy applications
 
Presentacion de NETConf.UY 2018
Presentacion de NETConf.UY 2018Presentacion de NETConf.UY 2018
Presentacion de NETConf.UY 2018
 
NetConfUy 2018 - Azure B2C
NetConfUy 2018 - Azure B2CNetConfUy 2018 - Azure B2C
NetConfUy 2018 - Azure B2C
 
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...
Las aplicaciones en tiempo real con SIGNALR son un excelente recurso para pro...
 
Machine learning automatizado
Machine learning automatizadoMachine learning automatizado
Machine learning automatizado
 
Microsoft machine learning
Microsoft machine learningMicrosoft machine learning
Microsoft machine learning
 
Integración continua y despliegue automático en Azure 
Integración continua y despliegue automático en Azure Integración continua y despliegue automático en Azure 
Integración continua y despliegue automático en Azure 
 
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)
Cómo mejorar-la-velocidad-de-tu-web (Cámara madrid)
 
De las redes sociales al comercio electrónico
De las redes sociales al comercio electrónicoDe las redes sociales al comercio electrónico
De las redes sociales al comercio electrónico
 
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojos
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojosNet Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojos
Net Conf UY 2018 Usabilidad: el software, como la comida, entra por los ojos
 
Power bi para desarrolladores
Power bi para desarrolladoresPower bi para desarrolladores
Power bi para desarrolladores
 
Caso de Estudio SEO: Elige tu propia aventura #CW17
Caso de Estudio SEO: Elige tu propia aventura #CW17Caso de Estudio SEO: Elige tu propia aventura #CW17
Caso de Estudio SEO: Elige tu propia aventura #CW17
 
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomype
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomypeLastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomype
Lastics comopuedenayudaralemprendedorparatenernegociosprosperos mundomype
 
SignalR NET Conf UY v2017
SignalR NET Conf UY v2017SignalR NET Conf UY v2017
SignalR NET Conf UY v2017
 
WordPress Analytics. Introducción a la estrategia de analítica web
WordPress Analytics. Introducción a la estrategia de analítica webWordPress Analytics. Introducción a la estrategia de analítica web
WordPress Analytics. Introducción a la estrategia de analítica web
 
Plataformas Analíticas como Soporte en la Era del Big Data
Plataformas Analíticas como Soporte en la Era del Big DataPlataformas Analíticas como Soporte en la Era del Big Data
Plataformas Analíticas como Soporte en la Era del Big Data
 
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGround
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGroundCómo auditar tu presencia online | Montserrat Cano - Webinar SiteGround
Cómo auditar tu presencia online | Montserrat Cano - Webinar SiteGround
 
Taller de Analítica Web - Congreso CID-Murcia
Taller de Analítica Web - Congreso CID-MurciaTaller de Analítica Web - Congreso CID-Murcia
Taller de Analítica Web - Congreso CID-Murcia
 
SharePoint Saturday Madrid 2019 - Productivity based on AI
SharePoint Saturday Madrid 2019 - Productivity based on AISharePoint Saturday Madrid 2019 - Productivity based on AI
SharePoint Saturday Madrid 2019 - Productivity based on AI
 
Moving files to and between Teams - What are my options?
Moving files to and between Teams - What are my options?Moving files to and between Teams - What are my options?
Moving files to and between Teams - What are my options?
 

Plus de Ernesto Hernández Rodríguez

Plus de Ernesto Hernández Rodríguez (6)

Microservicios, en qué lío me he metido
Microservicios, en qué lío me he metidoMicroservicios, en qué lío me he metido
Microservicios, en qué lío me he metido
 
Arquitecturas de microservicios - @cibbva
Arquitecturas de microservicios - @cibbvaArquitecturas de microservicios - @cibbva
Arquitecturas de microservicios - @cibbva
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
Arquitecturas de microservicios - Codemotion 2014
Arquitecturas de microservicios  -  Codemotion 2014Arquitecturas de microservicios  -  Codemotion 2014
Arquitecturas de microservicios - Codemotion 2014
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Transaction isolation levels
Transaction isolation levelsTransaction isolation levels
Transaction isolation levels
 

Microservicios, en qué lío me he metido

  • 1. 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ández Packlink Miguel Ortega Packlink
  • 2. 9 y 10 de febrero #T3chFest2017 9 y 10 de febrero #T3chFest2017
  • 3. 9 y 10 de febrero #T3chFest2017
  • 4. 9 y 10 de febrero #T3chFest2017 Labels Tracking Payments: Credit card, Paypal, Deferred Invoicing E-commerces integration Autocomplete rules Zip codes NOT JUST A SIMPLE CARRIER COMPARATOR
  • 5. 9 y 10 de febrero #T3chFest2017 ● 7 Countries ● Over 50 carriers ● >300 shipping services ● >500% shipment grow ● >2M shipments/year
  • 6. 9 y 10 de febrero #T3chFest2017 http://transformcustomers.com/category/business-transformation/ 9 y 10 de febrero #T3chFest2017
  • 7. 9 y 10 de febrero #T3chFest2017 Our legacy old Monolith http://isijisan.blogspot.com.es/2015/03/el-escarabajo-pelotero.html
  • 8. 9 y 10 de febrero #T3chFest2017 Fast growth
  • 9. 9 y 10 de febrero #T3chFest2017 Our shiny and new Monolith https://mekubal.wordpress.com/2012/04/03/the-myth-of-monolithic-judaism/ KOKUDO
  • 10. 9 y 10 de febrero #T3chFest2017 Our Monoliths KOKUDO
  • 11. 9 y 10 de febrero #T3chFest2017 Business needs!!! We need an API
  • 12. 9 y 10 de febrero #T3chFest2017Sometimes you need to clean up
  • 13. 9 y 10 de febrero #T3chFest2017 ● Another monolith ● ESB orchestration ● DB coupling ● Fixed deploy dates ● Something distributed ● More choreography ● Different storages ● Deploy flexibility
  • 14. 9 y 10 de febrero #T3chFest2017 It seems clear right? Microservices
  • 15. 9 y 10 de febrero #T3chFest2017 2014 2015 2016
  • 16. 9 y 10 de febrero #T3chFest2017 but what the hell is a microservice? CHALLENGE ACCEPTED
  • 17. 9 y 10 de febrero #T3chFest2017 Phase 1
  • 18. 9 y 10 de febrero #T3chFest2017
  • 19. 9 y 10 de febrero #T3chFest2017 Phase 2
  • 20. 9 y 10 de febrero #T3chFest2017 ● ONE DATABASE ● STILL A MONOLITH FATAL
  • 21. 9 y 10 de febrero #T3chFest2017 Phase 3 9 y 10 de febrero #T3chFest2017
  • 22. 9 y 10 de febrero #T3chFest2017 ● NO REAL MICROSERVICES ● DEPLOY/CONFIGURATION HELL ERROR
  • 23. 9 y 10 de febrero #T3chFest2017 Turn Around
  • 24. 9 y 10 de febrero #T3chFest2017 Phase 4 9 y 10 de febrero #T3chFest2017
  • 25. 9 y 10 de febrero #T3chFest2017 Synchronous calls Network call
  • 26. 9 y 10 de febrero #T3chFest2017 Synchronous calls Network call
  • 27. 9 y 10 de febrero #T3chFest2017 Phase 4 9 y 10 de febrero #T3chFest2017
  • 28. 9 y 10 de febrero #T3chFest2017 ● SYNCHRONOUS CALLS HELL ● WHERE ARE MY JOINS? warning
  • 29. 9 y 10 de febrero #T3chFest2017 Asynchronous MESSAGE BUS
  • 30. 9 y 10 de febrero #T3chFest2017 Phase 5 9 y 10 de febrero #T3chFest2017
  • 31. 9 y 10 de febrero #T3chFest2017 Event Driven Architecture Apps 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
  • 32. 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 ?
  • 33. 9 y 10 de febrero #T3chFest2017 Event store Apps events are stored in an event log
  • 34. 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
  • 35. 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
  • 36. 9 y 10 de febrero #T3chFest2017 Benefits • Materialized views • Rebuild app state • Stream processing • CEP
  • 37. 9 y 10 de febrero #T3chFest2017 “Distributed transactions” • Avoid 2 phase commit !!! • Do compensating transactions instead
  • 38. 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
  • 39. 9 y 10 de febrero #T3chFest2017 The Platform
  • 40. 9 y 10 de febrero #T3chFest2017 Docker Ecosystem FTW ● build once, run everywhere ● easy scaling with docker-compose ● infrastructure scaling with swarm
  • 41. 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
  • 42. 9 y 10 de febrero #T3chFest2017 Service discovery 9 y 10 de febrero #T3chFest2017
  • 43. 9 y 10 de febrero #T3chFest2017 How do I develop locally? 9 y 10 de febrero #T3chFest2017
  • 44. 9 y 10 de febrero #T3chFest2017 New old problems ● Onboarding new developers ● Config management ● Debugging ● Data Bootstrapping
  • 45. 9 y 10 de febrero #T3chFest2017 What do we need? ● Infrastructure Bootstrapping: ○ up and running ○ configuration ● Microservices Bootstrapping: ○ up and running ○ application data
  • 46. 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
  • 47. 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
  • 48. 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
  • 49. 9 y 10 de febrero #T3chFest2017 Local development
  • 50. 9 y 10 de febrero #T3chFest2017 Service discovery (review) 9 y 10 de febrero #T3chFest2017
  • 51. 9 y 10 de febrero #T3chFest2017 Local development with your IDE 9 y 10 de febrero #T3chFest2017
  • 52. 9 y 10 de febrero #T3chFest2017 Tunnel 9 y 10 de febrero #T3chFest2017
  • 53. 9 y 10 de febrero #T3chFest2017 Service discovery (all together) 9 y 10 de febrero #T3chFest2017
  • 54. 9 y 10 de febrero #T3chFest2017 ● DUDE, WHERE ARE MY LOGS? DEBUG
  • 55. 9 y 10 de febrero #T3chFest2017 Logging stack
  • 56. 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, ... }
  • 57. 9 y 10 de febrero #T3chFest2017 ● Make your application log-aggregator agnostic FATAL
  • 58. 9 y 10 de febrero #T3chFest2017 ● How do I trace a single request? TRACE
  • 59. 9 y 10 de febrero #T3chFest2017 Distributed tracing
  • 60. 9 y 10 de febrero #T3chFest2017 Our (helpful) Dev Tools
  • 61. 9 y 10 de febrero #T3chFest2017 https://slack.com
  • 62. 9 y 10 de febrero #T3chFest2017 Wiggumbot https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin http://docs.sonarqube.org/display/PLUG/GitHub+Plugin9 y 10 de febrero #T3chFest2017 (Our personal code-reviewer guardian)
  • 63. 9 y 10 de febrero #T3chFest2017 Hound https://github.com/etsy/hound Etsy, Inc. 9 y 10 de febrero #T3chFest2017
  • 64. 9 y 10 de febrero #T3chFest2017 Asciidoctor http://asciidoctor.org 9 y 10 de febrero #T3chFest2017
  • 65. 9 y 10 de febrero #T3chFest2017 Was it worth it? 9 y 10 de febrero #T3chFest2017
  • 66. 9 y 10 de febrero #T3chFest2017 # Shipments
  • 67. 9 y 10 de febrero #T3chFest2017 # Deployments 2 → ~20 per week
  • 68. 9 y 10 de febrero #T3chFest2017 Thank you
  • 69. 9 y 10 de febrero #T3chFest2017 9 y 10 de febrero #T3chFest2017 It seems clear right? Q&A 9 y 10 de febrero #T3chFest2017
  • 70. 9 y 10 de febrero #T3chFest2017 WE ARE HIRING