Forward (committing) Compensating (rollback) Node just committed
drag to pan · scroll to zoom

Saga Pattern 2D: Distributed Transactions Across Microservices

Microservices architectures split one application into independent services that own their own data and talk over the network — which means a single ACID transaction spanning all of them is off the table. The Saga pattern solves this by chaining local transactions, one per service, and defining a compensating action for every step so that a failure partway through can be undone in reverse rather than left half-committed. This simulator renders a live chain of five services — Order, Payment, Inventory, Shipping and Notification — and streams saga instances through them on a 2D schematic: watch each one commit its local step and move forward, or, when a step fails, watch it trigger a wave of compensating transactions that walk backward through every service that already committed. A failure-probability slider controls how often steps fail, a spawn-rate slider controls saga throughput, and a mode toggle switches the coordination style between choreography (services react to each other's events directly) and orchestration (a central coordinator hub drives every step) — with live counters and a rolling strip chart comparing the observed success rate against the theoretical (1−p)ⁿ prediction.