# Saga Pattern
The saga pattern is a pattern used in a [[Microservice Architecture]] to coordinate transactions between multiple databases. It **dictates that each of your microservices should have invertible transactions, and that at least some should be committed in two steps. The first step corresponds to the traditional database transaction but with a 'pending' flag. Once all other services have indicated that their transactions are also committed, the first transaction then transits into the 'completed' state. If by any chance any dependent transactions fail, the first one is inverted.**
For example picture an order service and a service that approves customer credit.
1. Order service creates a 'pending' order and submits an approval request to the credit service
2. The credit service processes the request and posts its decision
3. The order service completes the order, or rejects it
4. (optional) If the credit is rejected the order service can delete the order and the credit request
## Sources
- Chris Richardson. [Saga](https://microservices.io/patterns/data/saga.html).