Saga Pattern 2D: Distributed Transactions Across Microservices
Interactive 2D simulation of the Saga pattern: watch transactions flow through a chain of microservices, trigger compensating rollbacks on failure, and compare orchestrated vs. choreographed coordination against the (1-p)^n success prediction, with a live strip chart of observed vs. predicted success rate.
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.
Watch saga transactions flow through a chain of five microservices on a 2D schematic, trigger compensating rollbacks on failure, and compare orchestrated vs. choreographed coordination against the (1-p)^n success prediction on a live strip chart.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install