Stateless all the thing, they say. In the last few years weve been brainwashed: design stateless systems, otherwise they cannot scale, they cannot be highly available, and they are hard to maintain and evolve. In a nutshell stateful is bad. However complex software systems need to do collaborative processing, that is stateful by definition. Stateless myth busted! Collaborative domains deal with long running business transactions and need to interact with distributed resources. The traditional distributed transactions approach, even if tempting, is a time bomb.
This is when Sagas come into play. Sagas allow to model complex collaborative domains without the need for distributed transactions and/or orchestration across multiple resources. Join Mauro on a journey that aims to disclose what sagas are, how they can be used to model a complex collaborative domain, and what role they play when it comes to designing systems with failure and eventual consistency in mind.
(Its all right, I know where youve been)
1 of 52
More Related Content
Welcome to the (state) machine @ ExploreDDD 2019
1. welcome to the
(state) machine
Its all right, I know where youve been
mauroservienti
Mauro Servienti
2. All I want to do when I wake up in
the morning is
(cit. Rosanna, Toto, Toto IV)
mauroservienti
14. Process Managers (a different point of view)
New requirement: collect tickets at the venue
OrderId ShippingId ShippingStatus Etc
12 1337 Delivered
58 1338 Pending
Orders table
mauroservienti
17. Process Managers, a retrospective.
Violate Single Responsibility Principle
Single Unit of Deployment
Conflicting Changes/Merge Conflicts
Contention/Performance Bottleneck
mauroservienti
33. Order Created Payment Succeeded
NY
Batch Shipping
at the Venue
Policy
Store for Venue
Delivery
Mark as Complete
Courier
Gateway
Batch Delivery Pick-up
Courier
Gateway
Delivery Pick-up
Deliver Tickets
Mark as Complete
mauroservienti
Shipping Policy
Shipping Policy
Delivery-Mode:
- Collect-at-the-Venue
- Ship-at-Home
?
Is Collect-at-the-Venue?
34. Order Created Payment Succeeded
NY
Store for Venue
Delivery
Mark as Complete
Courier
Gateway
Delivery Pick-up
Deliver Tickets
Mark as Complete
mauroservienti
Shipping Policy
Shipping Policy
Delivery-Mode:
- Collect-at-the-Venue
- Ship-at-Home
?
Is Collect-at-the-Venue?
Batch Shipping
at the Venue
Policy
Courier
Gateway
Batch Delivery Pick-up
Mark as Complete
43. Sagas (a different point of view)
OrderId ShippingId ShippingStatus Etc
12 1337 Delivered
58 1338 Pending
Orders table
Reservation Shipping Finance
OrderId TicketId
12 ABC
58 ACD
Reservations table
OrderId Address
12 Milan, Italy
58 Paris, France
Shipping table
OrderId Status
12 Paid
58 Overdue
Invoices table
VS
mauroservienti
44. Sagas (a different point of view)
Reservation Shipping Finance
Reservations table
OrderId Address
12 Milan, Italy
58 Paris, France
Shipping table
OrderId Status
12 Paid
58 Overdue
Invoices table
mauroservienti
Each service can evolve independently
OrderId TicketId
12 ABC
58 ACD
45. Sagas
Business Process is distributed
Respect Single Responsibility Principle
Simpler/not conflicting evolution
Independent Units of Deployment
Independent scale out
mauroservienti
46. Every year is getting shorter
never seem to find the time
Sagas Demo
bit.ly/eddd-state-machine
Udi Dahan about Sagas
go.particular.net/eddd-state-machine
mauroservienti