Design Subscription Commerce

Medium40 min
1 / 30
understanding9 min read

Problem Statement: Recurring Commerce & Auto-Ship

Problem Statement: Recurring Commerce & Auto-Ship — subscription commerce interview depth

Problem Statement: Recurring Commerce & Auto-Ship

Subscription commerce — Dollar Shave Club, Birchbox, Amazon Subscribe & Save — sells predictable replenishment rather than one-off carts. The defining shift from ordinary e-commerce is that money, inventory, and fulfillment must all align on a calendar: a charge fires on a schedule, a box must ship on a promised cadence, and the inventory to fill it must be reserved before the warehouse picks. The system's job is to keep those three clocks — billing, scheduling, and fulfillment — in agreement for millions of subscribers at once.

The architectural spine is the subscription period as the unit of truth, with append-only billing_event and shipment_event streams hanging off each period. The platform never stores card numbers — a PSP (Stripe/Adyen) token vault holds the PAN, keeping the platform out of PCI scope — and it never mutates a balance without writing an event. Inventory is reserved before a WMS pick task is emitted, so the fulfillment side never promises a box it cannot fill. These four stances (period-as-truth, event ledger, PSP vault, reserve-before-pick) frame everything else.

Scale concentrates in a way ordinary commerce does not: renewals burst on shared billing anchors. With 8 million active subscribers each renewing roughly monthly, the average charge rate is only a few per second — but when monthly cycles align at, say, 06:00 UTC, the peak hits around 2,200 renewal charges per second. The defining load problem is therefore not steady throughput but a synchronized renewal spike, which (as the scaling section shows) is best flattened by jittering billing anchors at signup.

The correctness bar is set by money and trust. A double charge is a finance incident and a customer-trust failure, so the target is under 0.02% double-charge incidents, achieved by idempotency on the PSP event id and the append-only ledger. A missed shipment breaks the replenishment promise, so on-time ship within the promised window targets ~98.5%. Stating these two numbers — and that they are protected by an idempotent event ledger, not hopeful retries — frames subscription commerce as a billing-correctness system with a fulfillment calendar attached.

Key Highlights

  • Subscription commerce sells predictable replenishment, so money, inventory, and fulfillment align on a CALENDAR — keep the billing/scheduling/fulfillment clocks in sync
  • Four stances: subscription_period is the unit of truth, append-only billing/shipment event ledger, PSP token vault (no PAN), reserve inventory before the WMS pick task
  • Load is a synchronized renewal BURST, not steady throughput: 8M subs -> ~3/s average but ~2,200/s peak when monthly cycles align at 06:00 UTC
  • Correctness bar: <0.02% double-charge (idempotency on PSP event id + event ledger), ~98.5% on-time ship within the promised window
Pro tip
Sec 1: Charge before pick; never ship on unpaid periods.
Interviewer loves
Sec 1: Mention plan_terms snapshot so mid-cycle catalog changes cannot rewrite history.
Common mistake
Sec 1: Treating subscription balance as one UPDATE column—events must be append-only.
Trade-off
Sec 1: Curated boxes reduce WMS complexity but increase churn when personalization fails.

Section Rescue Kit

Buzzwords to use:

Subscription periodDunning ladder

Safe statements:

  • "Before databases for Problem Statement: Recurring Commerce & Auto-Ship, I'll quantify renewal QPS and webhook volume."
  • "I'll separate money movement (PSP) from shipment movement (WMS) on the whiteboard."
Design Subscription Commerce - System Design | WinJob | WinJob