SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
deSymfony 30 junio - 1 julio 2017
Castellón
DEL MONOLITO A LOS
MICROSERVICIOS
SIN MORIR EN EL INTENTO
Aitor Suso
deSymfony
¡Muchas gracias a nuestros
patrocinadores!
¿Quien es Aitor Suso?
patxi1980@gmail.com
facebook.com/patxi1980
twitter.com/patxi1980
es.linkedin.com/in/patxi1980
github.com/patxi1980
aitorsuso
> 20 años
>15 años
desde la beta (2011)
¿Que es Suntransfers?
Barcelona €32 €40 €46 €72
Madrid €37 €42 €50 €72
¿De que va la charla?
Microservicios
Symfony (componentes)
Código
Camino recorrido
¿Que espero aportar con esta charla?
¿QUE SON LOS
MICROSERVICIOS?
Source: Google Trends
January 2009 September 2010 May 2012 January 2014 September 2015 May 2017
Definición
“Loosely coupled service oriented architecture
with bounded contexts”
-Adrian Cockcroft (@adrianco)
Monolito Microservicios
Source: https://martinfowler.com/articles/microservices.html
@martinfowler
@alvaro_sanchez
Monolito Microservicios
Monolito Microservicios
Source: https://martinfowler.com/articles/microservices.html
@martinfowler
Ventajas de los microservicios
Separación de conceptos
Proyectos más pequeños
Deploys independientes
Diversidad tecnológica
Reutilización de servicios
Descentralización de datos
Desventajas de microservicios
Crear y provisionar servidores
Consistencia eventual
Testing entre microservices
Versionado
Autorización
Desventajas de microservicios
Microservices Vendors
Crear y provisionar servidores
Consistencia eventual
Testing entre microservices
Versionado
Autorización
*
Ventajas de los microservicios
Microservicios Vendors
Separación de conceptos
Proyectos más pequeños
Deploys independientes
Diversidad tecnológica
Reutilización de servicios
Descentralización de datos *
MicroservicesAPIBundleVendorServiceLegacy code
Ventajas de los microserviciosEvolución en
10 Proyectos web
(3 APIs)
25 Vendors
Multiple serversMonolito
(Yii) 3 Proyectos Web
Monolito
(Yii y Symfony)
Ventajas de los microserviciosEjemplos de vendors
• Files
• Location
• Route
• Currency
• Financials
• …
• Caos30-serializer
CAMINO RECORRIDO
deSymfony Pokemon Tours
github.com/desymfonyPokemonTours
Pokemon
Tipos
Rutas
CiudadesRutas
Pokemons
City
Type Pokemon Route
N N N N
N
N
Pokemon
$getPokemonByIdService->execute(int $pokemonId): Pokemon
$getPokemonsByIdsService->execute(array $pokemonIds): Pokemon[]
1 proyecto web 3 proyectos web
Pokemon vendor
"desymfony/pokemon": "^1.0"
Tipo de pokemon
Pokemon Tipo
Tipo de pokemon
$getPokemonsByTypeIdService->execute(int $typeId): Pokemon[]
Ruta
$getRouteByIdService->execute(int $routeId): Route
$getRoutesAdjacentToCityIdService->execute(int $cityId): Route[]
$getRoutesByPokemonId->execute(int $pokemonId): Route[]
$getRoutesByTypeId->execute(int $typeId): Route[]
City
Type Pokemon Route
N N N N
N
N
Ruta por tipo
PokemonTipo Ruta
“Loosely coupled service oriented architecture
with bounded contexts”
-Adrian Cockcroft (@adrianco)
Cuadrado mágico
RouteRepositoryInterface Route
Source: Domain-Driven Design Tactical Patterns and CI
by: @buenosvinos
DoctrineRouteRepository DoctrineRoute DoctrinePokemon
DoctrineType
Repository Domain
Domain
Infrastructure
MicroservicesAPIBundleVendorServiceLegacy code
Next steps
• Creación de APIs
• Separar BD
• Eventos
• …
• …
• Microservices
Final Tips
• No construir mas de lo necesario
• Si centralizas código, actualiza el código legacy
• Bundles para separar bounded contexts
• Sigue un estándar de numeración de releases (mayor.minor.bugfix)
• Datos de entrada planos, entidades como datos de salida
• Servicios privados (public=false) en los vendors
• El monolito puede ser tu amigo
Muchas gracias
Zzzzzzz
¿Preguntas?
¿Preguntas?
github.com/desymfonyPokemonTours
patxi1980@gmail.com
facebook.com/patxi1980
twitter.com/patxi1980
es.linkedin.com/in/patxi1980
github.com/patxi1980
aitorsuso

Más contenido relacionado

Último

redes informaticas en una oficina administrativa
redes informaticas en una oficina administrativaredes informaticas en una oficina administrativa
redes informaticas en una oficina administrativa
nicho110
 

Último (12)

EVOLUCION DE LA TECNOLOGIA Y SUS ASPECTOSpptx
EVOLUCION DE LA TECNOLOGIA Y SUS ASPECTOSpptxEVOLUCION DE LA TECNOLOGIA Y SUS ASPECTOSpptx
EVOLUCION DE LA TECNOLOGIA Y SUS ASPECTOSpptx
 
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptxPROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
PROYECTO FINAL. Tutorial para publicar en SlideShare.pptx
 
Buenos_Aires_Meetup_Redis_20240430_.pptx
Buenos_Aires_Meetup_Redis_20240430_.pptxBuenos_Aires_Meetup_Redis_20240430_.pptx
Buenos_Aires_Meetup_Redis_20240430_.pptx
 
Avances tecnológicos del siglo XXI 10-07 eyvana
Avances tecnológicos del siglo XXI 10-07 eyvanaAvances tecnológicos del siglo XXI 10-07 eyvana
Avances tecnológicos del siglo XXI 10-07 eyvana
 
pruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNITpruebas unitarias unitarias en java con JUNIT
pruebas unitarias unitarias en java con JUNIT
 
How to use Redis with MuleSoft. A quick start presentation.
How to use Redis with MuleSoft. A quick start presentation.How to use Redis with MuleSoft. A quick start presentation.
How to use Redis with MuleSoft. A quick start presentation.
 
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
 
Innovaciones tecnologicas en el siglo 21
Innovaciones tecnologicas en el siglo 21Innovaciones tecnologicas en el siglo 21
Innovaciones tecnologicas en el siglo 21
 
redes informaticas en una oficina administrativa
redes informaticas en una oficina administrativaredes informaticas en una oficina administrativa
redes informaticas en una oficina administrativa
 
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptxEL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
EL CICLO PRÁCTICO DE UN MOTOR DE CUATRO TIEMPOS.pptx
 
Avances tecnológicos del siglo XXI y ejemplos de estos
Avances tecnológicos del siglo XXI y ejemplos de estosAvances tecnológicos del siglo XXI y ejemplos de estos
Avances tecnológicos del siglo XXI y ejemplos de estos
 
investigación de los Avances tecnológicos del siglo XXI
investigación de los Avances tecnológicos del siglo XXIinvestigación de los Avances tecnológicos del siglo XXI
investigación de los Avances tecnológicos del siglo XXI
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Destacado (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Del monolito a los microservicios, sin morir en el intento