Search

Lessons (20)

  • Design an E-Commerce Checkout

    … inventory reservation, idempotent payment, order creation and durable events. ![Checkout: catalog/search are read paths while inventory, payment …

  • The L6 System-Design Thinking Loop

    … twice. Peak Average traffic hides capacity limits. 2M checkouts in five minutes. Failure window Finds duplicate/lost-work …

  • Frontend Testing Strategy

    … sign up, log in, checkout, payment. ts // e2e/checkout.spec.ts import { test, expect } from "@playwright/test"; test …

  • Batch vs Stream and Data Modeling

    … Batch jobs need isolation so reporting cannot starve checkout. A denormalized projection needs an owner and a measurable …

  • Resilience Patterns

    … A slow recommendations service can then exhaust only its pool, while checkout keeps working. mermaid flowchart LR subgraph …

  • Timeouts, Retries & Backpressure

    … of retaining unlimited memory. - Shed optional work before checkout. - Route poison jobs to a visible DLQ. Watch: queue …

  • Exactly-Once Payment Processing

    … deduplication. The invariant For one customer, amount, and checkout intent: charge at most once . A retry returns the …

  • Comments & Formatting

    … separate ideas js // ❌ A wall of text function checkout(cart){const total=sum(cart);if(total 100){applyDiscount …

  • Small Functions That Do One Thing

    … High level and low level mixed together function checkout(cart) { applyDiscounts(cart); let total = 0; for (const item …

  • Topics, Partitions & Offsets

    … A Kafka topic is the store; its partitions are the checkout lanes. ![A topic split into partitions; the …

  • Services & Ingress

    … gone after restart" P1[pod] end subgraph With["✅ Through a Service"] C2[checkout] -- "http://shop-api" S{{"Service …

  • Onion Architecture & Clean vs Hexagonal vs Onion

    … Application services Use cases / workflows orchestrating the domain CheckoutService.placeOrder() 🟣 Outer ring: infrastructure, UI, tests Implementations of …

  • Structural Patterns: How to Connect Objects

    … inventory, payment, shipping, email… class CheckoutFacade { constructor({ inventory, payments, shipping, mailer }) { Object.assign(this, { inventory, payments, shipping, mailer …

  • I — Interface Segregation Principle

    … OrderReader) {} } // can't delete by accident class CheckoutService { constructor(private orders: OrderReader & OrderWriter) {} } Key takeaways - Many small, focused …

  • Behavioral Patterns I: Observer, Strategy, Command, State

    … standard; return strategy(order); } mermaid flowchart LR Ctx["Checkout<br/ (context)"] -- S{{"strategy(order)"}} S -- A[standard: 5 …

  • ConfigMaps, Secrets & Storage

    … LOG LEVEL: "info" FEATURE NEW CHECKOUT: "true" PAYMENTS URL: "http://payments-api" app-settings.json: { "currency": "EUR", "pageSize …

  • API Gateway, BFF & Service Discovery

    … O2[orders instance 2] -- register + heartbeat Registry C[Checkout svc] -- "where is orders?" Registry Registry -- "10.0.1 …

  • Deploying & Operating Microservices

    … without redeploying. js if (await flags.isEnabled("new-checkout", { userId: user.id, country: user.country })) { return renderNewCheckout(); } return …

  • Observability: Logs, Metrics & Traces

    … GET /checkout (total 820 ms) dateFormat x axisFormat %L section api-gateway gateway :0, 820 section orders-svc …

  • Scaling & Health Probes

    … Autoscaling The big idea A supermarket opens more checkout lanes when the queues get long, and closes some …