Search
Lessons (18)
- Flash Sale: 10 Million Buyers, No Oversell
… The durable inventory owner decides the winner atomically. The invariant Never sell more units than exist. The winner …
- Design an E-Commerce Checkout
… catalog/search are read paths while inventory, payment and order transitions are owned and idempotent](/img/system-design …
- ACID, Transactions & Locks
… UPDATE inventory SET available = available - 1 WHERE sku = :sku AND available 0; If zero rows change, inventory was …
- Data in Microservices: Sagas & the Outbox Pattern
… No central coordinator. mermaid flowchart LR O[Orders] -- OrderCreated I[Inventory] I -- StockReserved P[Payments] P -- PaymentFailed I2 …
- Event-Driven Architecture
… Orders knows everyone"] O1[Orders] -- reserve I1[Inventory] O1 -- charge P1[Payments] O1 -- email E1[Email] O1 -- track …
- Service Communication: Sync vs Async
… reserve INV1[Inventory] OR -- 2. charge PAY1[Payments] OR -- 3. ship SHIP1[Shipping] end subgraph Chor["💃 Choreography: dancers …
- Structural Patterns: How to Connect Objects
… inventory, payment, shipping, email… class CheckoutFacade { constructor({ inventory, payments, shipping, mailer }) { Object.assign(this, { inventory, payments, shipping, mailer …
- Monolith vs Microservices
… events .- IS[Inventory svc] -- IDB[(inventory DB)] end The trade-offs Monolith Microservices --- --- --- Deploy Everything at once Each …
- Data Structures for Scale
… Never use a Bloom-filter positive as proof of authorization or inventory ownership.
- Capacity, Availability, Latency and CAP
… Payments/inventory normally reject uncertain writes; feeds/counters can serve a stale value. CAP is about partitions, not …
- Finding Service Boundaries with DDD
… OO["Order<br/ lines, status, total"] end subgraph Inventory["📦 Inventory context"] IS["StockItem<br/ sku, quantity, location"] end …
- Timeouts, Retries & Backpressure
… app work 150 ms Stop before downstream work. Inventory 250 ms Controlled temporary failure. Payment 450 ms Reconcile …
- Behavioral Patterns I: Observer, Strategy, Command, State
… 99, items: ["book"] }); mermaid flowchart LR S["📢 Subject<br/ orders.emit('order:placed')"] -- O1[📧 Mailer] S -- O2[📦 Inventory …
- SQL vs NoSQL Databases
… answer complex questions, ACID transactions keep money and inventory correct, and SQL is a universal language. Examples: PostgreSQL …
- Kafka vs RabbitMQ & the Kafka Ecosystem
… OS -- outbox + CDC T1[(orders.placed)] T1 -- Inv[Inventory svc] T1 -- Pay[Payments svc] Pay -- T2[(payments.completed …
- Deploying & Operating Microservices
… abc"] -- P["Payments<br/ traceId=abc"] O -- I["Inventory<br/ traceId=abc"] G & O & P & I -- T[("🔎 Tracing …
- Observability: Logs, Metrics & Traces
… section orders-svc create order :20, 300 section inventory-svc reserve stock :40, 120 section payments-svc charge …
- Domain-Driven Design: Tactical Patterns
… Tx2 subgraph Tx2["Transaction 2 (moments later)"] I[Inventory aggregate] -- reserve stock I end Repositories: a collection of …