HLDArena
HLD-328·Transactions & Locking
Hard · 1,500 pts

Multi-Tenant Merchant Checkout, Cart Hold & Drop Isolation

Design a Shopify-scale multi-tenant e-commerce checkout platform where a celebrity sneaker/cosmetics drop on one storefront generates 150k RPS without degrading checkout latency for 100,000 calm independent merchants sharing the platform.

Max p99
≤ 65 ms
Availability
≥ 99.7%
Budget
≤ $9,900

Functional Requirements

  • FR-1POST /v1/shops/{shop_id}/checkouts — Validates bot-queue token, places atomic TTL inventory reservation on SKU, and computes tax/shipping.
  • FR-2POST /v1/shops/{shop_id}/checkouts/{checkout_id}/complete — Commits idempotent payment + order creation and decrements reserved SKU stock.
  • FR-3DELETE /v1/shops/{shop_id}/checkouts/{checkout_id} — Releases expired/abandoned cart holds back into available SKU inventory.
  • FR-4Strict zero-oversell per sku_id AND strict noisy-neighbor pod/shard bulkhead isolation so calm shop_ids hold p99 <= 60 ms.

Workload Profile

Multi-Tenant Baseline52,000 Storefront & Cart Read RPS / 9,000 Checkout Write RPS
Viral Celebrity Merchant Drop148,000 Read RPS / 26,000 Checkout Write RPS
Active Working Set40 GB hot SKU inventory counters, checkout leases & shop routing cells
Isolation GateZero oversell (strict serializable SKU) + cell/shard noisy-neighbor isolation

Consistency Model

Strict atomic SKU stock reservation + idempotent checkout completion with synchronous/quorum durability.

Relevant practice for

Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.

Design Write-up

Write under ### Architecture for Diagram to take that up directly

Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 130 ms
• Availability: ≥ 99.7%
Valid end-to-end Client → Compute → Storage topology