Glossary
Saga pattern
A way to run operations across several services when there is no shared transaction: every step has a compensating step.
As soon as an operation touches several services with their own databases, there is no common rollback. The saga pattern replaces it with business-level compensation: payment reversed, reservation released, order cancelled.
It is implemented either with an orchestrator that knows the steps, or event-driven, where each service reacts to the outcome of the previous one.
How you notice it
- A transaction spans several services with their own databases.
- A later step can fail after earlier ones succeeded.
- There is no shared transaction.
Frequently asked
Orchestration or choreography?
Orchestration when the flow must be traceable and understood by domain experts. Choreography when services should stay as independent as possible. For money related business transactions central control is usually better, because you can see where things are stuck.
