Transactions Lab: Interactive Simulations & Lessons
Isolation anomalies, lost updates and distributed transactions. A hands-on transactions lab with 4 interactive simulations and 5 lessons.
Isolation anomalies, lost updates and distributed transactions.
Run two transactions against the same data and watch the anomalies each isolation level allows. Then stretch a transaction across services and see why 2PC and sagas exist.
Simulations
- Transaction Isolation Anomalies — Step two concurrent transactions and reproduce dirty reads, non-repeatable reads, phantoms and write skew at each isolation level.
- Lost Updates & Optimistic Locking — Two admins edit the same product price; compare no locking, optimistic versions and pessimistic locks.
- Distributed Transaction: Two-Phase Commit — Coordinate Order, Payment and Inventory with 2PC; crash participants or the coordinator at each phase.
- Saga: Compensating a Failed Checkout — Run a checkout saga as orchestration or choreography; fail any step and watch compensations unwind it.
Lessons
- Transactions & What ACID Actually Promises — Level 8 · Data Systems
- Isolation Levels: Dirty Reads to Serializable — Level 8 · Data Systems
- Lost Updates: Optimistic vs Pessimistic Locking — Level 8 · Data Systems
- Optimistic vs Pessimistic Offline Locks — Level 5 · Enterprise Architecture
- Distributed Transactions: 2PC, Sagas & the Outbox — Level 9 · Microservices
Also explore
- Optimistic Offline Lock — Pattern
- Transactional Outbox — Pattern
- Build a Unit of Work — Build it yourself
Other labs
- Kafka Lab — Logs, partitions, keys, consumer groups and ordering.
- Database Internals Lab — Storage engines, indexes, replication and partitioning.
- Caching Lab — Hit rates, TTLs, invalidation, stampedes and CDNs.
- Microservices Lab — Failures, retries, circuit breakers, sagas and idempotency.
- Architecture Lab — Evolution, decisions, characteristics and fitness functions.