Search
Lessons (26)
- Atomic Design & Component Libraries
… Start with small, reusable building blocks and combine them into increasingly complete screens: mermaid flowchart BT A[Atoms …
- Design a Ride-Sharing Service
… a geo index finds candidates, an atomic assignment leases a driver, and live updates flow separately](/img/system …
- Flash Sale: 10 Million Buyers, No Oversell
… The durable inventory owner decides the winner atomically. The problem in context A store has 1,000 discounted …
- ACID, Transactions & Locks
Make multi-step changes correct with atomic transactions, isolation choices, constraints and short-lived locks. The bank-transfer …
- Go Concurrency: Goroutines, Channels and Context
Concurrency vs parallelism, goroutines and the scheduler, buffered and unbuffered channels, select, WaitGroup, Mutex and atomics, worker pools …
- Payment Retries: Prevent Duplicate Charges
Safe payment retries need a durable idempotency record, atomic state transition and provider-side deduplication. The problem in …
- Normalization & Denormalization
… First I make values atomic in 1NF. If I have a composite key, I move fields that depend …
- Time, Consistency and Distributed Transactions
… Avoid distributed locks where atomic database/queue claiming owns the state. Two-phase commit offers coordinated atomicity but …
- Delivery Guarantees: At-Most, At-Least & Exactly Once
… Transactions (atomic read-process-write) A stream processor reads from topic A, transforms the record, and writes to …
- Design an E-Commerce Checkout
… reserve inventory atomically, create/get a payment attempt with an idempotency key, then commit an order and publish …
- A WhatsApp OTP Is Only Single Use If You Make It So
… hashed codes, atomic consume, attempt limits, crash recovery and race-condition tests. The problem in context A user …
- Transactions, Indexes & Concurrency
… so they commit together or roll back together. Atomicity is all-or-nothing; consistency preserves constraints; isolation defines …
- Database Indexing & Transactions
… let the database do it atomically sql UPDATE flights SET seats left = seats left - 1 WHERE id = 42 …
- Concurrency, Resilience & Distributed Workflows
… Prefer an atomic database statement or a transaction that owns the invariant: sql UPDATE inventory SET available = available …
- Design System Operations
… process. A component library needs a contract The Atomic Design lesson explains composition. Operating a design system means …
- Big Data: ETL, Warehouses and Streaming
… Publish the replacement atomically instead of exposing a half-rebuilt report. How to prove it worked Reconcile reported …
- Distributed Coordination: Consensus, Heartbeats and Gossip
… Raft/consensus cluster. Protect a payment/inventory write Atomic transaction at the durable owner. Consensus is powerful but …
- Storage, Search and Location Queries
… The final assignment still needs a durable, atomic claim so two riders cannot both receive the same driver …
- Message Delivery: Queues, Kafka, Ordering and DLQs
… Commit a local effect plus processing marker atomically where possible. 3. Bound retries and quarantine poison events with …
- The L6 System-Design Thinking Loop
… can wait and which database write must remain atomic? --- Concepts and implementation details The big idea An L6 …
- DynamoDB Modeling, RDS Scaling and Data Resilience
… In a dedicated sample table with that key schema, an atomic conditional update can decrement only when stock …
- Event-Driven Patterns, Step Functions and Reliable Lambdas
… A single boolean does not make an external side effect atomic. Use a stable operation key, a conditional …
- Domain-Driven Design: Tactical Patterns
… Promise<void ; // saves the WHOLE aggregate atomically nextId(): OrderId; } ⚠️ No repository for OrderLine . Lines are only reachable through …
- Rust: Types, Errors and Concurrency
… Graph/tree nodes with several parents Arc<T Atomic Rc , safe across threads Shared config or state in …
- 500 Users Upload Documents at Once: Design the Background Job Pipeline
… This is the same atomic-check-and-set idea used for idempotent payments and single-use OTPs. The …
- Backend Design Scenarios
… separate quota and emergency fallback Make the decision atomic ( INCR plus expiry or a Lua script), set short …