Design Patreon's Anniversary Billing Run For Millions Of Memberships

Last updated: November 29, 2026

Quick Overview

Design the system that charges every paid membership on its own billing anniversary, monthly or annual, across multiple payment processors and currencies, without double charging anyone and with decline recovery built in.

Patreon
System Design
Software Engineer
Patreon
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the system that charges every paid membership on its own billing anniversary, monthly or annual, across multiple payment processors and currencies, without double charging anyone and with decline recovery built in.

Patreon moved from charging everyone on the first of the month to subscription-style anniversary billing, and its billing state machine now also handles pauses, gifts and comped periods. A payments-focused system design round would probe exactly-once charging, idempotency with processors, routing, and how state stays consistent when a webhook and a retry race.

What the Interviewer Expects
  • Separates 'what is due' (bill generation) from 'charge execution' and from 'state transitions'
  • Guarantees at most one successful charge per membership period using idempotency keys and unique constraints
  • Handles processor timeouts with unknown outcomes through reconciliation rather than blind retries
  • Routes charges to processors by region, currency or content type with failover
  • Smooths load rather than charging at midnight UTC
  • Defines clear metrics: authorization rate, recovery rate, duplicate-charge count
Key Topics to Cover
subscription billing
idempotency
payment routing
reconciliation
state machine
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • A processor returns a timeout after it actually captured the payment. Walk through what happens next.
  • How do pauses and gifted months fit into the bill generator?
  • How would you migrate millions of first-of-month members to anniversary dates without a revenue dip?
  • How do Apple in-app purchases, where Apple is the biller, fit into this design?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: generate a bill for each membership when its period ends, charge the stored payment method, update membership status and benefits, retry declines, and credit creator balances. Non-function...

High-Level Design
  1. Bill generator: a scheduled job scans memberships with next_bill_at <= now (indexed) and inserts a bill row with unique (membership_id, period_start). That constraint is the core duplicat...

Submit Your Answer
Markdown supported

Related Questions