Tags

Saga Pattern

Saga Pattern

0 lessons
2 system designs
2 community items

saga-pattern

System Design

2 articles
System Design
Premium

Distributed Transactions (2PC, Saga Pattern)

When a single business operation spans multiple services or databases, you cannot rely on a single ACID transaction. This lesson covers the two dominant patterns for keeping consistency across services: Two-Phase Commit (2PC) for synchronous, atomic, blocking transactions, and the Saga pattern (orchestration vs choreography) for long-running asynchronous workflows with compensating actions. We also cover Three-Phase Commit, idempotency keys, the outbox pattern, and the trade-offs that explain why 2PC is rare in microservices and Sagas are everywhere. By the end you can pick the right pattern for an order checkout, a money transfer, or a multi-step booking flow.

distributed-transactions
two-phase-commit
saga-pattern
distributed-systems
consistency
acid
microservices
system-design
advanced
premium

855

24

Hard
System Design

Design an E-Commerce Platform (Amazon)

Design an Amazon-scale e-commerce platform that lets 200M monthly users browse 100M SKUs, add items to a cart, check out, and have orders fulfilled from regional warehouses. The interview centerpiece is the order lifecycle: how to reserve inventory atomically while a customer is on the checkout page, how to chain cart-to-payment-to-fulfillment as a saga with compensating actions, and how to make checkout idempotent so a flaky network never charges a customer twice. We also cover catalog browse at scale, multi-warehouse fulfillment routing, and the asymmetric read/write workload that makes aggressive catalog caching the right call.

design-ecommerce
case-study
ecommerce-marketplace
amazon
shopping-cart
checkout-flow
inventory-management
optimistic-locking
saga-pattern
fulfillment
idempotency
system-design
intermediate
premium

651

8

Medium