SlideShare a Scribd company logo
1 of 65
Download to read offline
Microservices:
Improving the autonomy of our teams with 

Event-Driven Architecture
Rafa Gómez & Javier Ferrer
CodelyTV
THE

MONOLITH
DB
USERS
DB
VIDEOS
Stage 2
Microliths
GET
USERS
DB
VIDEOS
DB
Stage 2.1
Coupled
Microliths
USERS
DB
VIDEOS
DB
video_created
e
Stage 3
EDA
Stage 1
Monolith
Goals
🧠 Explore the implications of an Event-Driven Architecture in terms of:
👥 Development teams management and autonomy
🚀 Scalability
🗺 Analyze a migration plan from a monolith to a service based architecture
Intro
Who we are
@JavierCane
Intro
@rafaoe
User story
🗿 Stage 1: The Monolith
Problem: The Domino Effect
Stage 1: The Monolith
THE MONOLITH
GET /users/x PUT /videos/x
DB
{
"id": “some-uuid",
"name": “Codelyber",
"total_videos_created": 1
}
🧠
&
🙋
THE MONOLITH
🧠
Stage 1: The Monolith
GET /users/x PUT /videos/x
GET /courses/x
GET /paths/x
GET /videos/x/comments
GET /videos/x/likes
💩
💩
💩💩
💩💩
💩
💩
💩
☀☀
☀☀
💩
💩
💩💩💩💩 💩 💩
💩
💩
💩
💩
💩
💩
DB
💧
THE MONOLITH
🧠
Stage 1: The Monolith
GET /users/x PUT /videos/x
GET /courses/x
GET /paths/x
GET /videos/x/comments
GET /videos/x/likes
💩
💩
💩💩
💩💩
💩
💩
💩
☀☀
☀☀
💩
💩
💩💩💩💩 💩 💩
💩
💩
💩
💩
💩
💩
DB
x1000
🔥
Recap Stage 1: The Monolith
👥 Development teams management and autonomy
👎 Same codebase
🚀 Scalability
👎 Development scaling issues
👎 Application scaling issues
👎 Infrastructure scaling issues
Stage 1: The Monolith
HATERS
Haters advisory
🎯 Assume we’ve actual needs to implement a [micro]services architecture:
. Multiple development teams
🌈 Different needs that require different programming languages
📊 Different scaling needs for each service
Stage 1: The Monolith
🗿 Stage 2: The Microliths 🗿
Problem: Domino Effect
Stage 1: The Monolith
THE MONOLITH
GET /users/x PUT /videos/x
DB
USERS
GET /users/x PUT /videos/x
VIDEOS
Stage 2: The Microliths
DB
USERS
GET /users/x PUT /videos/x
VIDEOS
Stage 2: The Microliths
DB
🧠
💩
💩💩
💩💩
💩
💩
☀
☀
☀
☀ 💩 💩
💩 💩💩💩 💩
🧠
💩
💩
💩 💩💩
💩
💩☀
☀
☀
💩
💩💩 💩☀
☀☀
☀
👀
👀
USERS
GET /users/x PUT /videos/x
VIDEOS
Stage 2: The Microliths
DB
🧠
💩
💩💩
💩💩
💩
💩
☀
☀
☀
☀ 💩 💩
💩 💩💩💩 💩
🧠
💩
💩
💩 💩💩
💩
💩☀
☀
☀
💩
💩💩 💩
👀
👀
☀
☀☀
☀
☀☀
☀
☀☀
☀
☀☀
☀☀
☀☀☀☀
☀
USERS
GET /users/x PUT /videos/x
VIDEOS
Stage 2: The Microliths
DB
🧠
💩
💩💩
💩💩
💩
💩
☀
☀
☀
☀ 💩 💩
💩 💩💩💩 💩
🧠
💩
💩
💩 💩💩
💩
💩☀
☀
☀
💩
💩💩 💩
👀
👀
☀
☀☀
☀
☀☀
☀
☀☀
☀
☀☀
☀☀
☀☀☀☀
☀
x1000😰
🔥
AKA Distributed Monolith 🐘
Changelog Stage 2: The Microliths
👥 Development teams management and autonomy
👍 Solved code base scaling issues
👎 Teams sharing the same DB schema
✋ Isolated DBA team: obfuscate priorities
🚀 Scalability
👍 Slightly better development scaling
👍 No application scaling issues
👎 Infrastructure scaling issues
Stage 2: The Microliths
🗿🗿 Stage 2.1: Coupled Microliths
Problem: Domino Effect
USERS
GET /users/x PUT /videos/x
VIDEOS
Stage 2: The Microliths
DB
🧠
💩
💩💩
💩💩
💩
💩
☀
☀
☀
☀ 💩 💩
💩 💩💩💩 💩
🧠
💩
💩
💩 💩💩
💩
💩☀
☀
☀
💩
💩💩 💩☀
☀☀
☀
☀☀
☀
☀☀
☀
☀☀
☀☀
☀☀☀☀
☀
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
Stage 2.1: Coupled Microliths
🧠 🧠
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
🏖
Stage 2.1: Coupled Microliths
x1000🙂
🔥
{
"id": “some-uuid",
"name": "Codelyber",
"total_videos_created": 1
}
🧠 🧠☀
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
🏖
Stage 2.1: Coupled Microliths
x1000🙂
🔥
{
"id": “some-uuid",
"name": "Codelyber",
"total_videos_created": 1
}
🧠 🧠☀
USERS🙂
DB
GET /users/x PUT /videos/xVIDEOS
DB
🏖
GET /videos

?user_id=x
Stage 2.1: Coupled Microliths
🔥
x1000
AKA Distributed Monolith 🐘
🧠 🧠☀ 💩
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
🏖
GET /videos

?user_id=x
Stage 2.1: Coupled Microliths
🔥
x1000
AKA Distributed Monolith 🐘
🧠 🧠💩☀
😰
USERS🙂
DB
GET /users/x PUT /videos/xVIDEOS
DB
🏖
GET /videos?u_id=x
Stage 2.1: Coupled Microliths
🔥
x1000
🧠 🧠💩☀ 🕸
{
"id": “some-uuid",
"name": "Codelyber",
"total_videos_created": 0
}
https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581
https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581
https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581
https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
GET /videos?u_id=x
Stage 2.1: Coupled Microliths
🧠 🧠💩🕸
{
"id": “some-uuid",
"name": "Codelyber",
"total_videos_created": 0
}
👋☀
Changelog Stage 2.1: Coupled Microliths
👥 Development teams management and autonomy
👍 DB schema independence
👎 Inappropriate intimacy between teams => Use cases to develop &
maintain
👎 More work to do (SQL query vs. expose & consume HTTP endpoint)
🚀 Scalability
👍 No DB scaling issues
👎 Services coupling => Communication => Latency & Domino effect
Stage 2.1: Coupled Microliths
Changelog Stage 2.1: Coupled Microliths
👥 Development teams management and autonomy
👍 DB schema independence
👎 Inappropriate intimacy between teams => Use cases to develop &
maintain
👎 More work to do (SQL query vs. expose & consume HTTP endpoint)
🚀 Scalability
👍 No DB scaling issues
👎 Services coupling => Communication => Latency & Domino effect
Stage 2.1: Coupled Microliths
5
🧿 Stage 3: EDA
Raising the DIP & OCP to a macro-architecture level
USERS
SERVICE
DB
GET /users/x PUT /videos/xVIDEOS
SERVICE
DB
GET /videos

?user_id=x
Stage 2.1: Coupled Microliths
AKA Distributed Monolith 🐘
I
Videos ServiceUsers Service
Stage 3: EDA
Do you remember…
SOLID!
How do we apply this concept to our [micro]services?
Do you remember… SOLID!
From:
I
MySqlVideoRepositoryVideoCreator
VideoCreator
MySqlVideoRepository
VideoRepository
i
To:
D
A
I
From:
I
Videos ServiceUsers Service
???
?
To:
Users Service
Videos Service
Stage 3: EDA
From:
I
Videos ServiceUsers Service
video_created
e
To:
Users Service
Videos Service
Stage 3: EDA
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
Subscribed to
video_created
e
Publishes
🧠 🧠☀
Stage 3: EDA
{
"id": “some-uuid",
"name": "Codelyber",
"total_videos_created": 1
}
| DB table fields |
|----------------------|
| id |
| name |
| total_videos_created |
USERS
DB
GET /users/x PUT /videos/xVIDEOS
DB
x1000
🔥🏖
🙂
🕶
video_created
e
Publishes
Subscribed to
🧠 🧠☀
Stage 3: EDA
Changelog Stage 3: Decoupling our teams
👥 Development teams management and autonomy
👍 Avoid inappropriate intimacy (develop & maintain use cases)
👍 OCP: Avoid having to modify current behaviour
☝ Learning curve (duplicated messages, order not guaranteed…)
🚀 Scalability
👍 No services coupling => No communication => Lower latencies & avoid
domino effect
👍 Replicate data => Shape it as needed by the team use cases
Stage 3: EDA
🗺 Migration plan
Microservices & Event-Driven Architecture
Base strategy
= PoC: Learn & define messaging architecture (RabbitMQ Simulator)
> Choose a little & not risky use case to develop in your new service
? Define your ACL: Domain events as interfaces/contracts
@ Migrate historical data from the legacy system to the new one (next slides)
A Start publishing events from the legacy system and consuming them from the
new one (next slide)
Microservices & Event-Driven Architecture
Migration plan fully based on domain events
= Migrate historical data:
= Legacy: Simulate the publication of events corresponding to historical data
based on the DB state saving them in the event store
> Copy all the events from the event store to a new queue X (history)
? New service: Consume all the events in the queue X
@ Remove temporary queue X
> Replicate new data changes:
= Legacy: Start publishing events in the new queue Y
> New service: Start consuming the events from queue Y
Microservices & Event-Driven Architecture
Migration plan speeding up initial data migration
= Legacy: Start publishing the needed events
> Legacy: Create a DB slave not exposing it to serve public requests
? Legacy: Stop DB replication in the new slave (this define The Moment X™)
@ Temporary script: Migrate historical data until The Moment X from the new
slave to the new service DB making the needed transformations
A New service: Start consuming the events published after The Moment X
C Remove the slave & temporary script created for the historical data migration
Microservices & Event-Driven Architecture
5 9
I don’t know Rick…
⚡ Conclusions
THE

MONOLITH
DB
USERS
DB
VIDEOS
Stage 2
Microliths
GET
USERS
DB
VIDEOS
DB
Stage 2.1
Coupled
Microliths
USERS
DB
VIDEOS
DB
video_created
e
Stage 3
EDA
Stage 1
Monolith
To take away
🧿 Decouple your teams thanks to EDA
🗺 SOLID principles can be applied at micro and macro-design levels
📃 Think about your Domain Events as you Domain interfaces/contracts
🕵 Inappropriate intimacy: Services exposing information just because of other
services need it. Simplify your services by limiting their APIs.
💡 Domain events as ACL. Useful while refactoring legacy systems.
Conclusions
& More info?
& More info?
Mini-demo time!
🎥I Demo with PHP, Scala, and RabbitMQ (Spanish 🤟):
https://www.youtube.com/watch?v=1kaP39W80zQ
🐙🧣 https://github.com/CodelyTV/scala-http-api/
🐙🐘 https://github.com/CodelyTV/cqrs-ddd-php-example
👉codely.tv/pro/cas-18 👈!codely.tv/pro/commit-18"
# 100 primeros => Primer mes a 19€
$ Tweet #commitCodelyTV => Sorteo 1 mes gratis
!codely.tv/pro/commit-18"
# 100 primeros => Primer mes a 19€
$ Tweet #commitCodelyTV => Sorteo 1 mes gratis
Related links
Performance Under Load
CodelyTV Pro Hexagonal Architecture course (Spanish)
CodelyTV Pro CQRS course (Spanish)
CodelyTV Pro Scala HTTP API course (Spanish)
Testing CQRS talk (Spanish)
We broke up with the monolith, and started dating #eventSourcing
Versioning in an Event Sourced System
RabbitMQ Simulator
A Series of Fortunate Events
The anatomy of Domain Event
& More info?
Wait!
Do we need [micro]services in
order to apply these concepts
at macro-design level?
Thanks!
@CodelyTV
codely.tv
@CodelyTV
@CodelyTV
@CodelyTV
@CodelyTV

More Related Content

What's hot

Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...Alex Cachia
 
Favor composition over inheritance
Favor composition over inheritanceFavor composition over inheritance
Favor composition over inheritanceKohei Nozaki
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningApache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningGuido Schmutz
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing ArchitecturesVictor Rentea
 
Kafka Retry and DLQ
Kafka Retry and DLQKafka Retry and DLQ
Kafka Retry and DLQGeorge Teo
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayDebasish Ghosh
 
Java JVM Memory Cheat Sheet
Java JVM Memory Cheat SheetJava JVM Memory Cheat Sheet
Java JVM Memory Cheat SheetMark Papis
 
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby ChackoStreaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby ChackoVMware Tanzu
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformVMware Tanzu
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsAsher Sterkin
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Worksconfluent
 
Integration Monday - Logic App Patterns
Integration Monday - Logic App PatternsIntegration Monday - Logic App Patterns
Integration Monday - Logic App PatternsBizTalk360
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaJiangjie Qin
 
Building Event Driven Services with Kafka Streams
Building Event Driven Services with Kafka StreamsBuilding Event Driven Services with Kafka Streams
Building Event Driven Services with Kafka StreamsBen Stopford
 
Netflix viewing data architecture evolution - QCon 2014
Netflix viewing data architecture evolution - QCon 2014Netflix viewing data architecture evolution - QCon 2014
Netflix viewing data architecture evolution - QCon 2014Philip Fisher-Ogden
 
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...confluent
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDDennis Doomen
 
Getting Started with Confluent Schema Registry
Getting Started with Confluent Schema RegistryGetting Started with Confluent Schema Registry
Getting Started with Confluent Schema Registryconfluent
 

What's hot (20)

Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...
No Onions, No Tiers - An Introduction to Vertical Slice Architecture by Bill ...
 
Favor composition over inheritance
Favor composition over inheritanceFavor composition over inheritance
Favor composition over inheritance
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & PartitioningApache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing Architectures
 
Kafka Retry and DLQ
Kafka Retry and DLQKafka Retry and DLQ
Kafka Retry and DLQ
 
Functional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 WayFunctional Domain Modeling - The ZIO 2 Way
Functional Domain Modeling - The ZIO 2 Way
 
Java JVM Memory Cheat Sheet
Java JVM Memory Cheat SheetJava JVM Memory Cheat Sheet
Java JVM Memory Cheat Sheet
 
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby ChackoStreaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
Spring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise Platform
 
Shaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patternsShaping serverless architecture with domain driven design patterns
Shaping serverless architecture with domain driven design patterns
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
 
Integration Monday - Logic App Patterns
Integration Monday - Logic App PatternsIntegration Monday - Logic App Patterns
Integration Monday - Logic App Patterns
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
Building Event Driven Services with Kafka Streams
Building Event Driven Services with Kafka StreamsBuilding Event Driven Services with Kafka Streams
Building Event Driven Services with Kafka Streams
 
Netflix viewing data architecture evolution - QCon 2014
Netflix viewing data architecture evolution - QCon 2014Netflix viewing data architecture evolution - QCon 2014
Netflix viewing data architecture evolution - QCon 2014
 
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
 
Getting Started with Confluent Schema Registry
Getting Started with Confluent Schema RegistryGetting Started with Confluent Schema Registry
Getting Started with Confluent Schema Registry
 

Similar to Microservices: Improving the autonomy of our teams with Event-Driven Architecture #cas2018

DevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesDevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesFab L
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...DevSecCon
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with RailsPaul Gallagher
 
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...Agile Testing Alliance
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDocker, Inc.
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinLeanIX GmbH
 
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptxSH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptxMongoDB
 
A Practical Road to SaaS in Python
A Practical Road to SaaS in PythonA Practical Road to SaaS in Python
A Practical Road to SaaS in PythonC4Media
 
ICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemBukhary Ikhwan Ismail
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Dennis Doomen
 
Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker, Inc.
 
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleVeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleJim Jones
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
 
Strategies for Context Data Persistence
Strategies for Context Data PersistenceStrategies for Context Data Persistence
Strategies for Context Data PersistenceFIWARE
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerSakari Hoisko
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Henning Jacobs
 
Microservice Development Using Telepresence
Microservice Development Using TelepresenceMicroservice Development Using Telepresence
Microservice Development Using TelepresenceVishal Banthia
 
My past-3 yeas-developer-journey-at-linkedin-by-iantsai
My past-3 yeas-developer-journey-at-linkedin-by-iantsaiMy past-3 yeas-developer-journey-at-linkedin-by-iantsai
My past-3 yeas-developer-journey-at-linkedin-by-iantsaiKim Kao
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerPhil Estes
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...marcin_pajdzik
 

Similar to Microservices: Improving the autonomy of our teams with Event-Driven Architecture #cas2018 (20)

DevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesDevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation Slides
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application Packages
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
 
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptxSH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
 
A Practical Road to SaaS in Python
A Practical Road to SaaS in PythonA Practical Road to SaaS in Python
A Practical Road to SaaS in Python
 
ICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystemICSEC2016-Policy management for docker ecosystem
ICSEC2016-Policy management for docker ecosystem
 
Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)Decomposing the Monolith (Riga Dev Days 2019)
Decomposing the Monolith (Riga Dev Days 2019)
 
Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
 
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleVeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
Strategies for Context Data Persistence
Strategies for Context Data PersistenceStrategies for Context Data Persistence
Strategies for Context Data Persistence
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
 
Microservice Development Using Telepresence
Microservice Development Using TelepresenceMicroservice Development Using Telepresence
Microservice Development Using Telepresence
 
My past-3 yeas-developer-journey-at-linkedin-by-iantsai
My past-3 yeas-developer-journey-at-linkedin-by-iantsaiMy past-3 yeas-developer-journey-at-linkedin-by-iantsai
My past-3 yeas-developer-journey-at-linkedin-by-iantsai
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 

Recently uploaded

Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 

Recently uploaded (20)

Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Microservices: Improving the autonomy of our teams with Event-Driven Architecture #cas2018

  • 1. Microservices: Improving the autonomy of our teams with 
 Event-Driven Architecture Rafa Gómez & Javier Ferrer CodelyTV
  • 3. Goals 🧠 Explore the implications of an Event-Driven Architecture in terms of: 👥 Development teams management and autonomy 🚀 Scalability 🗺 Analyze a migration plan from a monolith to a service based architecture Intro
  • 6.
  • 7. 🗿 Stage 1: The Monolith Problem: The Domino Effect
  • 8. Stage 1: The Monolith THE MONOLITH GET /users/x PUT /videos/x DB { "id": “some-uuid", "name": “Codelyber", "total_videos_created": 1 } 🧠
  • 9. & 🙋 THE MONOLITH 🧠 Stage 1: The Monolith GET /users/x PUT /videos/x GET /courses/x GET /paths/x GET /videos/x/comments GET /videos/x/likes 💩 💩 💩💩 💩💩 💩 💩 💩 ☀☀ ☀☀ 💩 💩 💩💩💩💩 💩 💩 💩 💩 💩 💩 💩 💩 DB 💧
  • 10. THE MONOLITH 🧠 Stage 1: The Monolith GET /users/x PUT /videos/x GET /courses/x GET /paths/x GET /videos/x/comments GET /videos/x/likes 💩 💩 💩💩 💩💩 💩 💩 💩 ☀☀ ☀☀ 💩 💩 💩💩💩💩 💩 💩 💩 💩 💩 💩 💩 💩 DB x1000 🔥
  • 11. Recap Stage 1: The Monolith 👥 Development teams management and autonomy 👎 Same codebase 🚀 Scalability 👎 Development scaling issues 👎 Application scaling issues 👎 Infrastructure scaling issues Stage 1: The Monolith
  • 13. Haters advisory 🎯 Assume we’ve actual needs to implement a [micro]services architecture: . Multiple development teams 🌈 Different needs that require different programming languages 📊 Different scaling needs for each service Stage 1: The Monolith
  • 14. 🗿 Stage 2: The Microliths 🗿 Problem: Domino Effect
  • 15. Stage 1: The Monolith THE MONOLITH GET /users/x PUT /videos/x DB
  • 16. USERS GET /users/x PUT /videos/x VIDEOS Stage 2: The Microliths DB
  • 17. USERS GET /users/x PUT /videos/x VIDEOS Stage 2: The Microliths DB 🧠 💩 💩💩 💩💩 💩 💩 ☀ ☀ ☀ ☀ 💩 💩 💩 💩💩💩 💩 🧠 💩 💩 💩 💩💩 💩 💩☀ ☀ ☀ 💩 💩💩 💩☀ ☀☀ ☀ 👀 👀
  • 18. USERS GET /users/x PUT /videos/x VIDEOS Stage 2: The Microliths DB 🧠 💩 💩💩 💩💩 💩 💩 ☀ ☀ ☀ ☀ 💩 💩 💩 💩💩💩 💩 🧠 💩 💩 💩 💩💩 💩 💩☀ ☀ ☀ 💩 💩💩 💩 👀 👀 ☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀☀ ☀☀☀☀ ☀
  • 19. USERS GET /users/x PUT /videos/x VIDEOS Stage 2: The Microliths DB 🧠 💩 💩💩 💩💩 💩 💩 ☀ ☀ ☀ ☀ 💩 💩 💩 💩💩💩 💩 🧠 💩 💩 💩 💩💩 💩 💩☀ ☀ ☀ 💩 💩💩 💩 👀 👀 ☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀☀ ☀☀☀☀ ☀ x1000😰 🔥 AKA Distributed Monolith 🐘
  • 20.
  • 21. Changelog Stage 2: The Microliths 👥 Development teams management and autonomy 👍 Solved code base scaling issues 👎 Teams sharing the same DB schema ✋ Isolated DBA team: obfuscate priorities 🚀 Scalability 👍 Slightly better development scaling 👍 No application scaling issues 👎 Infrastructure scaling issues Stage 2: The Microliths
  • 22. 🗿🗿 Stage 2.1: Coupled Microliths Problem: Domino Effect
  • 23. USERS GET /users/x PUT /videos/x VIDEOS Stage 2: The Microliths DB 🧠 💩 💩💩 💩💩 💩 💩 ☀ ☀ ☀ ☀ 💩 💩 💩 💩💩💩 💩 🧠 💩 💩 💩 💩💩 💩 💩☀ ☀ ☀ 💩 💩💩 💩☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀ ☀☀ ☀☀ ☀☀☀☀ ☀
  • 24. USERS DB GET /users/x PUT /videos/xVIDEOS DB Stage 2.1: Coupled Microliths 🧠 🧠
  • 25. USERS DB GET /users/x PUT /videos/xVIDEOS DB 🏖 Stage 2.1: Coupled Microliths x1000🙂 🔥 { "id": “some-uuid", "name": "Codelyber", "total_videos_created": 1 } 🧠 🧠☀
  • 26. USERS DB GET /users/x PUT /videos/xVIDEOS DB 🏖 Stage 2.1: Coupled Microliths x1000🙂 🔥 { "id": “some-uuid", "name": "Codelyber", "total_videos_created": 1 } 🧠 🧠☀
  • 27. USERS🙂 DB GET /users/x PUT /videos/xVIDEOS DB 🏖 GET /videos
 ?user_id=x Stage 2.1: Coupled Microliths 🔥 x1000 AKA Distributed Monolith 🐘 🧠 🧠☀ 💩
  • 28.
  • 29. USERS DB GET /users/x PUT /videos/xVIDEOS DB 🏖 GET /videos
 ?user_id=x Stage 2.1: Coupled Microliths 🔥 x1000 AKA Distributed Monolith 🐘 🧠 🧠💩☀ 😰
  • 30.
  • 31. USERS🙂 DB GET /users/x PUT /videos/xVIDEOS DB 🏖 GET /videos?u_id=x Stage 2.1: Coupled Microliths 🔥 x1000 🧠 🧠💩☀ 🕸 { "id": “some-uuid", "name": "Codelyber", "total_videos_created": 0 }
  • 32.
  • 33.
  • 38. USERS DB GET /users/x PUT /videos/xVIDEOS DB GET /videos?u_id=x Stage 2.1: Coupled Microliths 🧠 🧠💩🕸 { "id": “some-uuid", "name": "Codelyber", "total_videos_created": 0 } 👋☀
  • 39. Changelog Stage 2.1: Coupled Microliths 👥 Development teams management and autonomy 👍 DB schema independence 👎 Inappropriate intimacy between teams => Use cases to develop & maintain 👎 More work to do (SQL query vs. expose & consume HTTP endpoint) 🚀 Scalability 👍 No DB scaling issues 👎 Services coupling => Communication => Latency & Domino effect Stage 2.1: Coupled Microliths
  • 40. Changelog Stage 2.1: Coupled Microliths 👥 Development teams management and autonomy 👍 DB schema independence 👎 Inappropriate intimacy between teams => Use cases to develop & maintain 👎 More work to do (SQL query vs. expose & consume HTTP endpoint) 🚀 Scalability 👍 No DB scaling issues 👎 Services coupling => Communication => Latency & Domino effect Stage 2.1: Coupled Microliths
  • 41. 5
  • 42. 🧿 Stage 3: EDA Raising the DIP & OCP to a macro-architecture level
  • 43. USERS SERVICE DB GET /users/x PUT /videos/xVIDEOS SERVICE DB GET /videos
 ?user_id=x Stage 2.1: Coupled Microliths AKA Distributed Monolith 🐘
  • 46. How do we apply this concept to our [micro]services? Do you remember… SOLID! From: I MySqlVideoRepositoryVideoCreator VideoCreator MySqlVideoRepository VideoRepository i To: D A I
  • 47. From: I Videos ServiceUsers Service ??? ? To: Users Service Videos Service Stage 3: EDA
  • 49. USERS DB GET /users/x PUT /videos/xVIDEOS DB Subscribed to video_created e Publishes 🧠 🧠☀ Stage 3: EDA { "id": “some-uuid", "name": "Codelyber", "total_videos_created": 1 } | DB table fields | |----------------------| | id | | name | | total_videos_created |
  • 50. USERS DB GET /users/x PUT /videos/xVIDEOS DB x1000 🔥🏖 🙂 🕶 video_created e Publishes Subscribed to 🧠 🧠☀ Stage 3: EDA
  • 51. Changelog Stage 3: Decoupling our teams 👥 Development teams management and autonomy 👍 Avoid inappropriate intimacy (develop & maintain use cases) 👍 OCP: Avoid having to modify current behaviour ☝ Learning curve (duplicated messages, order not guaranteed…) 🚀 Scalability 👍 No services coupling => No communication => Lower latencies & avoid domino effect 👍 Replicate data => Shape it as needed by the team use cases Stage 3: EDA
  • 52. 🗺 Migration plan Microservices & Event-Driven Architecture
  • 53. Base strategy = PoC: Learn & define messaging architecture (RabbitMQ Simulator) > Choose a little & not risky use case to develop in your new service ? Define your ACL: Domain events as interfaces/contracts @ Migrate historical data from the legacy system to the new one (next slides) A Start publishing events from the legacy system and consuming them from the new one (next slide) Microservices & Event-Driven Architecture
  • 54. Migration plan fully based on domain events = Migrate historical data: = Legacy: Simulate the publication of events corresponding to historical data based on the DB state saving them in the event store > Copy all the events from the event store to a new queue X (history) ? New service: Consume all the events in the queue X @ Remove temporary queue X > Replicate new data changes: = Legacy: Start publishing events in the new queue Y > New service: Start consuming the events from queue Y Microservices & Event-Driven Architecture
  • 55. Migration plan speeding up initial data migration = Legacy: Start publishing the needed events > Legacy: Create a DB slave not exposing it to serve public requests ? Legacy: Stop DB replication in the new slave (this define The Moment X™) @ Temporary script: Migrate historical data until The Moment X from the new slave to the new service DB making the needed transformations A New service: Start consuming the events published after The Moment X C Remove the slave & temporary script created for the historical data migration Microservices & Event-Driven Architecture
  • 56. 5 9 I don’t know Rick…
  • 59. To take away 🧿 Decouple your teams thanks to EDA 🗺 SOLID principles can be applied at micro and macro-design levels 📃 Think about your Domain Events as you Domain interfaces/contracts 🕵 Inappropriate intimacy: Services exposing information just because of other services need it. Simplify your services by limiting their APIs. 💡 Domain events as ACL. Useful while refactoring legacy systems. Conclusions
  • 61. & More info? Mini-demo time! 🎥I Demo with PHP, Scala, and RabbitMQ (Spanish 🤟): https://www.youtube.com/watch?v=1kaP39W80zQ 🐙🧣 https://github.com/CodelyTV/scala-http-api/ 🐙🐘 https://github.com/CodelyTV/cqrs-ddd-php-example
  • 62. 👉codely.tv/pro/cas-18 👈!codely.tv/pro/commit-18" # 100 primeros => Primer mes a 19€ $ Tweet #commitCodelyTV => Sorteo 1 mes gratis !codely.tv/pro/commit-18" # 100 primeros => Primer mes a 19€ $ Tweet #commitCodelyTV => Sorteo 1 mes gratis
  • 63. Related links Performance Under Load CodelyTV Pro Hexagonal Architecture course (Spanish) CodelyTV Pro CQRS course (Spanish) CodelyTV Pro Scala HTTP API course (Spanish) Testing CQRS talk (Spanish) We broke up with the monolith, and started dating #eventSourcing Versioning in an Event Sourced System RabbitMQ Simulator A Series of Fortunate Events The anatomy of Domain Event & More info?
  • 64. Wait! Do we need [micro]services in order to apply these concepts at macro-design level?