April 6, 2021
Here is the link.
Chris Richardson discusses messaging, durability, and reliability in microservice architectures leveraging the Saga Pattern. He shows how sagas work and how they differ from traditional transactions, and describes how to use sagas to develop business logic in a microservices application. He also describes the design of a saga framework for Java and shows a sample application. This presentation was recorded at QCon San Francisco 2017.
Rollback using compensating transactions
- ACID transactions can simply rollback
- But
- Developer must write application logic to "rollback" eventually consistent transactions
- Careful design required!
- Synchronous API vs Asynchronous Saga
- Request initiates the saga. When to send back the response?
- Option #1: Send response when saga completes!
- Lost update
- Ti reads => other transaction writes -> Tj (or Ci) writes
- Dirty reads
- Ti writes -> other transaction reads -> Ci writes
- Commutative updates
- e.g. debt account can compensate for a credit account
- Version file
- Record history of changes
- use them to make updates commutative
- e.g. record cancel reservation so that create/cancel = cancel/create
No comments:
Post a Comment