The Saga pattern breaks a distributed transaction into smaller local transactions with compensating actions. This avoids locking resources across services and helps maintain eventual consistency.
Kafka Topics are used to publish events for each transaction step and compensating action, enabling services to react and coordinate asynchronously.
Kafka partitions allow events for different Sagas to be processed independently and in parallel, enabling high throughput and scalability.
Saga sacrifices immediate atomicity for eventual consistency and uses compensating transactions to undo partial work if needed.
Total event capacity = 10 partitions * 1000 events/sec = 10,000 events/sec.
Each Saga requires 5 events.
Maximum Saga throughput = 10,000 / 5 = 2000 Sagas/sec.