Search
Lessons (30)
- Design an E-Commerce Checkout
… Save each step as a state in the database: text Cart - inventory reserved - payment pending - paid - order confirmed …
- 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 …
- Flash Sale: 10 Million Buyers, No Oversell
… Only the real inventory database decides, in one all-or-nothing step, who gets each item. The story …
- 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 …
- ACID, Transactions & Locks
… UPDATE inventory SET available = available - 1 WHERE sku = :sku AND available 0; If zero rows change, inventory was …
- Monolith vs Microservices
… events .- IS[Inventory svc] -- IDB[(inventory DB)] end The trade-offs Monolith Microservices --- --- --- Deploy Everything at once Each …
- Finding Service Boundaries with DDD
… OO["Order<br/ lines, status, total"] end subgraph Inventory["📦 Inventory context"] IS["StockItem<br/ sku, quantity, location"] end …
- Drift, Troubleshooting, and Disaster Recovery
… Check both cloud inventory and state before deciding whether import is needed. Re-running blindly can create duplicates …
- Capacity, Availability, Latency and CAP
… A slightly old product page is fine. - Reserving stock: go only to the one owner of inventory. If …
- Observability and Incident Response
… Freezes unrelated deploys. 14:15 Traces show inventory calls waiting. Pool metrics show all database connections in use …
- 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 …
- Product-Scale Frontend Patterns
… For money movement, inventory reservation or destructive operations, prefer confirmation and a server-authoritative result. Offline-first is …
- Time, Consistency and Distributed Transactions
… Split cross-service jobs into steps with undo actions An order touches inventory, payments and shipping, which are …
- Secrets, Ephemeral Values, and Least Privilege
… and -raw can reveal sensitive output values. Exercise: inventory every artifact in your proposed CI workflow. Who can …
- Resilient Service Calls: Retries, Breakers and Load Shedding
… without everyone retrying at once Retry a safe inventory read after a random 50-150 ms. Circuit breaker …
- Message Delivery: Queues, Kafka, Ordering and DLQs
… OrderPlaced(order id, version, event id) - inventory consumer group - email consumer group - analytics consumer group The outbox: don …
- 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 …
- Kafka vs RabbitMQ & the Kafka Ecosystem
… OS -- outbox + CDC T1[(orders.placed)] T1 -- Inv[Inventory svc] T1 -- Pay[Payments svc] Pay -- T2[(payments.completed …
- Concurrency, Resilience & Distributed Workflows
… Prefer an atomic database statement or a transaction that owns the invariant: sql UPDATE inventory SET available = available …
- AWS Databases: Choose the Right One
… A cached balance or inventory count can become stale; enforce critical write rules in the authoritative database. Practice …
- Rust: Ownership, Borrowing and Lifetimes
… the Rust toolbox bash cargo new inventory creates Cargo.toml + src/main.rs cargo run build and run …
- Timeouts, Retries & Backpressure
… code 150 ms Stop before calling anyone else. Inventory check 250 ms Show "try again" message. Payment 450 …
- Domain-Driven Design: Tactical Patterns
… Tx2 subgraph Tx2["Transaction 2 (moments later)"] I[Inventory aggregate] -- reserve stock I end Repositories: a collection of …
- Capacity Planning, SLOs and Error Budgets
… 100 ms Inventory: 150 ms Payment: 350 ms Response + safety: 200 ms Total: 100 + 150 + 350 + 200 = 800 …
- Backend Design Scenarios
… permissions, inventory, pricing, user settings and feature flags. Usually delete the key after the database commit; the next …
- C4 Architecture Diagrams: Context, Container, Component and Code
… files Treating a class diagram as a code inventory Show stable responsibilities and dependencies, not every property and …