SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
Split my monolith
The workshop
Photo : wikimedia
@florentpellet
LyonTechHub
@clem_bouillier @johan_alps
Split?
System resilience / Team scalability
Manage complexity
How?
We all have seen failed
modularisations.
Our hypothesis is that it's
often about the database
https://twitter.com/mathiasverraes/status/711168935798902785?lang=en
Why is a shared DB bad?
- Is it a clear interface?
- Where is the code that writes to / read from a column?
- Independent deployment?
- Can we evolve the DB schema?
Micro-services ?
Availability
99.999% uptime ?
Ex 99%^20 = 81%
Our Domain for
today
Train management
- Train routing:
- Specify itinerary between two stations
- Specify train topologies
- Schedule train
=> a train makes the same trip every day
- Booking:
- Allows our customers to book a train
- Traffic info:
- Track train on a trip
- Detect delay
- Invoicing:
- Generate invoices and credits notes
Database schema
Exercice 1:
Identify contexts in
data model
Split database
Ideal split of Trip table
Example: Table Trip
Exercise: Split the Booking table
Which domain depends on which data?
T: Traffic info
B: Booking
R: Train routing
I: Invoicing
T,B,R
B,R
T,B,R
T,B,R
T,R,I
T,R,I
T,R,I
T,I
T
T
T,R,I
T,B,I
I
I
B, I
B, R, I
B, I
T, B, R, I
T, B, R, I
B
T, B, R, I
T,B
T, B, R, I
B, I
B, I
B, I
B, R, I
T, B, I
B, I
B, I
How?
Bubble context
Autonomous bubble - synchronous
Autonomous bubble - state stream
Autonomous bubble - events
Autonomous bubble - notif. stream
Exposing legacy assets as services
Exercices
Scenario 1
Today is the day!
Everything is flooded!
Panic on board!
Lots of late trains, we need an
immediate solution.
Deadline: Yesterday 🚨
Scenario 1
Many technical problems occur
regularly in recent days
Deadline: Yesterday 🚨
We want to quickly set up a
dashboard indicating in "real time"
the number of people impacted.
We cannot afford to re-deploy the
legacy
Expected :
- Schema with modules, DB, API,
messages, models (use the legend)
- Messages frequency / data refresh
rate
- Make explicit any isolation
- Detail data for each post-its
Scenario 1 - solution
Scenario 2
The storm is over.
The dashboard made it a lot
easier to prioritize various
incidents. We'll need a solid
architecture to build upon.
Deadline: Not defined ⛱
Scenario 2
Expected :
- Schema with modules, DB, API,
messages, models (use the legend)
- Messages frequency / data refresh
rate
- Make explicit any isolation
- Detail data for each post-its
The dashboard made it a lot
easier to prioritize various
incidents. We'll need a solid
architecture to build upon.
How would you do that given
enough time?
Deadline: Not defined ⛱
Scenario 2 - a solution
Scenario 2 - data
Expected :
- Which data is duplicated
- Where does it come from
- Who is the
Writer
Reader
Many technical problems occur
regularly in recent days
Try another representation based
on data model.
Scenario 2 - data, new point of view
Scenario 2 - data - solution
Scenario 3
We have a new “nonon” offer (nogo train).
Improve business opportunity, but success
is not guaranteed.
Need to test without impact legacy and
reuse maximum functionality to reduce
costs.
Deadline: Month 🚀
Scenario 3
We have a new “nonon” offer (nogo train).
How to integrate this offer with the current
system?
- New commercial offer with a brand
new UI : other reduction cards,
options to buy (wifi…)
- Traffic info, Train routing, Invoicing
remain in the legacy
- Seat assignment remain in the legacy
(to fill booking table)
- New module allows to book “nonon”
train, and to cancel (new UI)
- A train is either completely “nonon”
or legacy offer
Expected (context and data) :
- Schema with modules, DB, API,
messages, models (use the legend)
- Messages frequency / data refresh
rate
- Make explicit any isolation
- Which data is duplicated
- Where does it come from
Scenario 3 - solution
Scenario 3 - solution
Final Notes
In-process sync event (method call)
Strangler fig pattern
Strangler fig pattern
paulhammant.com
Eventual Consistency is key
Most things can be
decoupled if we allow a
delay in consistency (1s,
1min, …)
Ex : The csv exports
CALM theorem
- State will ALWAYS be
consistent if we don't delete
information
Counter examples:
- Set difference
- Multiple processes doing
increment
Database change with minimal interruption
1st deploy: Add the new table/database
2nd deploy: fill the new table with values. Check
3rd deploy: New code writing to the new table
(but not reading). Possibly a migration script
4th deploy: New code or feature flip, to read
from the new table
5th deploy: remove old columns/table and old
code. (Possibly days later)
Montée de version sans interruption (Nelson Dionisi)
Questions
Bibliographie
Getting started with DDD when surrounded by legacy
systems
De Eric Evans
Monolith to Microservices
De Sam Newman
La passion d'apprendre
formation.hackyourjob.com
Thank you !

Weitere ähnliche Inhalte

Ähnlich wie Split my monolith - Workshop

Resilience: the key requirement of a [big] [data] architecture - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture - StampedeCon...StampedeCon
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupesh Bansal
 
Replication in the wild ankara cloud meetup - feb 2017
Replication in the wild   ankara cloud meetup - feb 2017Replication in the wild   ankara cloud meetup - feb 2017
Replication in the wild ankara cloud meetup - feb 2017AnkaraCloud
 
Replication in the wild ankara cloud meetup - feb 2017
Replication in the wild   ankara cloud meetup - feb 2017Replication in the wild   ankara cloud meetup - feb 2017
Replication in the wild ankara cloud meetup - feb 2017Onur Dayıbaşı
 
Fundamental truths about distributed systems
Fundamental truths about distributed systemsFundamental truths about distributed systems
Fundamental truths about distributed systemsVladimír Schreiner
 
101 mistakes FINN.no has made with Kafka (Baksida meetup)
101 mistakes FINN.no has made with Kafka (Baksida meetup)101 mistakes FINN.no has made with Kafka (Baksida meetup)
101 mistakes FINN.no has made with Kafka (Baksida meetup)Henning Spjelkavik
 
Distributed Computing & MapReduce
Distributed Computing & MapReduceDistributed Computing & MapReduce
Distributed Computing & MapReducecoolmirza143
 
Distributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityDistributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityRenato Lucindo
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Dayprogrammermag
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsZvi Avraham
 
Time Series Analysis… using an Event Streaming Platform
Time Series Analysis… using an Event Streaming PlatformTime Series Analysis… using an Event Streaming Platform
Time Series Analysis… using an Event Streaming Platformconfluent
 
Time Series Analysis Using an Event Streaming Platform
 Time Series Analysis Using an Event Streaming Platform Time Series Analysis Using an Event Streaming Platform
Time Series Analysis Using an Event Streaming PlatformDr. Mirko Kämpf
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamAll Things Open
 
Mca2010 – operating system
Mca2010 – operating systemMca2010 – operating system
Mca2010 – operating systemsmumbahelp
 

Ähnlich wie Split my monolith - Workshop (20)

The Web Scale
The Web ScaleThe Web Scale
The Web Scale
 
NoSQL
NoSQLNoSQL
NoSQL
 
Resilience: the key requirement of a [big] [data] architecture - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...Resilience: the key requirement of a [big] [data] architecture  - StampedeCon...
Resilience: the key requirement of a [big] [data] architecture - StampedeCon...
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
 
Replication in the wild ankara cloud meetup - feb 2017
Replication in the wild   ankara cloud meetup - feb 2017Replication in the wild   ankara cloud meetup - feb 2017
Replication in the wild ankara cloud meetup - feb 2017
 
Replication in the wild ankara cloud meetup - feb 2017
Replication in the wild   ankara cloud meetup - feb 2017Replication in the wild   ankara cloud meetup - feb 2017
Replication in the wild ankara cloud meetup - feb 2017
 
Fundamental truths about distributed systems
Fundamental truths about distributed systemsFundamental truths about distributed systems
Fundamental truths about distributed systems
 
Presentation
PresentationPresentation
Presentation
 
101 mistakes FINN.no has made with Kafka (Baksida meetup)
101 mistakes FINN.no has made with Kafka (Baksida meetup)101 mistakes FINN.no has made with Kafka (Baksida meetup)
101 mistakes FINN.no has made with Kafka (Baksida meetup)
 
Distributed Computing & MapReduce
Distributed Computing & MapReduceDistributed Computing & MapReduce
Distributed Computing & MapReduce
 
Distributed Systems: scalability and high availability
Distributed Systems: scalability and high availabilityDistributed Systems: scalability and high availability
Distributed Systems: scalability and high availability
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
Time Series Analysis… using an Event Streaming Platform
Time Series Analysis… using an Event Streaming PlatformTime Series Analysis… using an Event Streaming Platform
Time Series Analysis… using an Event Streaming Platform
 
Time Series Analysis Using an Event Streaming Platform
 Time Series Analysis Using an Event Streaming Platform Time Series Analysis Using an Event Streaming Platform
Time Series Analysis Using an Event Streaming Platform
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
1 App,
1 App, 1 App,
1 App,
 
Gcp data engineer
Gcp data engineerGcp data engineer
Gcp data engineer
 
Exascale Capabl
Exascale CapablExascale Capabl
Exascale Capabl
 
Mca2010 – operating system
Mca2010 – operating systemMca2010 – operating system
Mca2010 – operating system
 

Mehr von martinsson

TDD de la vraie vie - AlpesCraft 2022
TDD de la vraie vie - AlpesCraft 2022TDD de la vraie vie - AlpesCraft 2022
TDD de la vraie vie - AlpesCraft 2022martinsson
 
Testing strategies
Testing strategiesTesting strategies
Testing strategiesmartinsson
 
Testing strategies visualized
Testing strategies visualizedTesting strategies visualized
Testing strategies visualizedmartinsson
 
No Agility without Continuous Delivery
No Agility without Continuous DeliveryNo Agility without Continuous Delivery
No Agility without Continuous Deliverymartinsson
 
No agility without continuous delivery frugagile
No agility without continuous delivery   frugagileNo agility without continuous delivery   frugagile
No agility without continuous delivery frugagilemartinsson
 
De legacy au tdd agilegrenoble
De legacy au tdd   agilegrenobleDe legacy au tdd   agilegrenoble
De legacy au tdd agilegrenoblemartinsson
 
De legacy au tdd - Agile pays basque
De legacy au tdd  - Agile pays basqueDe legacy au tdd  - Agile pays basque
De legacy au tdd - Agile pays basquemartinsson
 
Usable software design ncraft
Usable software design ncraftUsable software design ncraft
Usable software design ncraftmartinsson
 
Usable software design - code utilisable
Usable software design - code utilisableUsable software design - code utilisable
Usable software design - code utilisablemartinsson
 
Une architecture agile et testable
Une architecture agile et testableUne architecture agile et testable
Une architecture agile et testablemartinsson
 
Pyramide des tests
Pyramide des testsPyramide des tests
Pyramide des testsmartinsson
 
Changer Pour Mieux Coder
Changer Pour Mieux CoderChanger Pour Mieux Coder
Changer Pour Mieux Codermartinsson
 

Mehr von martinsson (14)

TDD de la vraie vie - AlpesCraft 2022
TDD de la vraie vie - AlpesCraft 2022TDD de la vraie vie - AlpesCraft 2022
TDD de la vraie vie - AlpesCraft 2022
 
Testing strategies
Testing strategiesTesting strategies
Testing strategies
 
Testing strategies visualized
Testing strategies visualizedTesting strategies visualized
Testing strategies visualized
 
No Agility without Continuous Delivery
No Agility without Continuous DeliveryNo Agility without Continuous Delivery
No Agility without Continuous Delivery
 
No agility without continuous delivery frugagile
No agility without continuous delivery   frugagileNo agility without continuous delivery   frugagile
No agility without continuous delivery frugagile
 
De legacy au tdd agilegrenoble
De legacy au tdd   agilegrenobleDe legacy au tdd   agilegrenoble
De legacy au tdd agilegrenoble
 
De legacy au tdd - Agile pays basque
De legacy au tdd  - Agile pays basqueDe legacy au tdd  - Agile pays basque
De legacy au tdd - Agile pays basque
 
Usable software design ncraft
Usable software design ncraftUsable software design ncraft
Usable software design ncraft
 
Usable software design - code utilisable
Usable software design - code utilisableUsable software design - code utilisable
Usable software design - code utilisable
 
Une architecture agile et testable
Une architecture agile et testableUne architecture agile et testable
Une architecture agile et testable
 
Pyramide des tests
Pyramide des testsPyramide des tests
Pyramide des tests
 
Changer Pour Mieux Coder
Changer Pour Mieux CoderChanger Pour Mieux Coder
Changer Pour Mieux Coder
 
Mikado
MikadoMikado
Mikado
 
Mikado
MikadoMikado
Mikado
 

Kürzlich hochgeladen

cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 

Kürzlich hochgeladen (20)

cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 

Split my monolith - Workshop

  • 1. Split my monolith The workshop Photo : wikimedia
  • 4. System resilience / Team scalability
  • 6. How? We all have seen failed modularisations. Our hypothesis is that it's often about the database https://twitter.com/mathiasverraes/status/711168935798902785?lang=en
  • 7. Why is a shared DB bad? - Is it a clear interface? - Where is the code that writes to / read from a column? - Independent deployment? - Can we evolve the DB schema?
  • 11. Train management - Train routing: - Specify itinerary between two stations - Specify train topologies - Schedule train => a train makes the same trip every day - Booking: - Allows our customers to book a train - Traffic info: - Track train on a trip - Detect delay - Invoicing: - Generate invoices and credits notes
  • 15. Ideal split of Trip table
  • 17. Exercise: Split the Booking table
  • 18. Which domain depends on which data? T: Traffic info B: Booking R: Train routing I: Invoicing T,B,R B,R T,B,R T,B,R T,R,I T,R,I T,R,I T,I T T T,R,I T,B,I I I B, I B, R, I B, I T, B, R, I T, B, R, I B T, B, R, I T,B T, B, R, I B, I B, I B, I B, R, I T, B, I B, I B, I
  • 19. How?
  • 21. Autonomous bubble - synchronous
  • 22. Autonomous bubble - state stream
  • 24. Autonomous bubble - notif. stream
  • 25. Exposing legacy assets as services
  • 27. Scenario 1 Today is the day! Everything is flooded! Panic on board! Lots of late trains, we need an immediate solution. Deadline: Yesterday 🚨
  • 28. Scenario 1 Many technical problems occur regularly in recent days Deadline: Yesterday 🚨 We want to quickly set up a dashboard indicating in "real time" the number of people impacted. We cannot afford to re-deploy the legacy Expected : - Schema with modules, DB, API, messages, models (use the legend) - Messages frequency / data refresh rate - Make explicit any isolation - Detail data for each post-its
  • 29. Scenario 1 - solution
  • 30. Scenario 2 The storm is over. The dashboard made it a lot easier to prioritize various incidents. We'll need a solid architecture to build upon. Deadline: Not defined ⛱
  • 31. Scenario 2 Expected : - Schema with modules, DB, API, messages, models (use the legend) - Messages frequency / data refresh rate - Make explicit any isolation - Detail data for each post-its The dashboard made it a lot easier to prioritize various incidents. We'll need a solid architecture to build upon. How would you do that given enough time? Deadline: Not defined ⛱
  • 32. Scenario 2 - a solution
  • 33. Scenario 2 - data Expected : - Which data is duplicated - Where does it come from - Who is the Writer Reader Many technical problems occur regularly in recent days Try another representation based on data model.
  • 34. Scenario 2 - data, new point of view
  • 35. Scenario 2 - data - solution
  • 36. Scenario 3 We have a new “nonon” offer (nogo train). Improve business opportunity, but success is not guaranteed. Need to test without impact legacy and reuse maximum functionality to reduce costs. Deadline: Month 🚀
  • 37. Scenario 3 We have a new “nonon” offer (nogo train). How to integrate this offer with the current system? - New commercial offer with a brand new UI : other reduction cards, options to buy (wifi…) - Traffic info, Train routing, Invoicing remain in the legacy - Seat assignment remain in the legacy (to fill booking table) - New module allows to book “nonon” train, and to cancel (new UI) - A train is either completely “nonon” or legacy offer Expected (context and data) : - Schema with modules, DB, API, messages, models (use the legend) - Messages frequency / data refresh rate - Make explicit any isolation - Which data is duplicated - Where does it come from
  • 38. Scenario 3 - solution
  • 39. Scenario 3 - solution
  • 41. In-process sync event (method call)
  • 44. Eventual Consistency is key Most things can be decoupled if we allow a delay in consistency (1s, 1min, …) Ex : The csv exports CALM theorem - State will ALWAYS be consistent if we don't delete information Counter examples: - Set difference - Multiple processes doing increment
  • 45. Database change with minimal interruption 1st deploy: Add the new table/database 2nd deploy: fill the new table with values. Check 3rd deploy: New code writing to the new table (but not reading). Possibly a migration script 4th deploy: New code or feature flip, to read from the new table 5th deploy: remove old columns/table and old code. (Possibly days later) Montée de version sans interruption (Nelson Dionisi)
  • 47. Bibliographie Getting started with DDD when surrounded by legacy systems De Eric Evans Monolith to Microservices De Sam Newman