Start Here

Tier 1 · Building Blocks

Scale Reads

Scale Writes

Database Selection

Traffic Control

Consistency & Coordination

Estimation

Tier 2 · Core Systems

Tier 3 · Location & Real-Time

Tier 4 · Infrastructure & Data

Tier 5 · Finance & Commerce

Tier 6 · Advanced & Collaborative

Phase 1 — Clarify & Scope

Interviewer: Design a digital wallet — think PayPal, Venmo, or WeChat Pay. What do you want to clarify?

Candidate: A few key questions:

  1. What operations does the wallet support — add money, send to another user, pay merchants, withdraw?
  2. Are balances real money or points/credits?
  3. What's the transaction volume and value?
  4. Multi-currency or single currency?
  5. Consistency model — can we tolerate brief balance inconsistency, or must every transfer be instantly consistent?

Interviewer: Peer-to-peer transfers (send to friend), merchant payments, add money from bank (ACH), withdraw to bank. Real money — USD only. 1 million users, 10 million transactions/day, average $25. Strong consistency — balance must always reflect completed transactions accurately. No overdrafts allowed.

Candidate: Let me size this:

Transaction rate=10M txns/day86,400≈116 txns/sec average\text{Transaction rate} = \frac{10\text{M txns/day}}{86{,}400} \approx 116 \text{ txns/sec average}

Peak (5× average)=580 txns/sec\text{Peak (5× average)} = 580 \text{ txns/sec}

Total wallet balance≈1M users×$100 avg balance=$100M\text{Total wallet balance} \approx 1\text{M users} \times \$100 \text{ avg balance} = \$100\text{M}

This is real money — correctness is more important than performance. Even one incorrect balance update causes regulatory and trust issues.

Interviewer: What are the core requirements?

Candidate:

  • Debit/credit wallet balance with ACID guarantees
  • P2P transfer: atomic — sender debited iff receiver credited
  • No negative balances (insufficient funds check)
  • Idempotent operations — duplicate requests must not double-debit
  • Complete audit trail of every balance change
  • Reconciliation — total system balance must equal sum of all wallet balances

Non-functional:

  • Transfer latency: < 500 ms p99
  • Exactly-once transfer semantics
  • Balance accuracy:…

In the full tutorial

  • Phase 2 — High-Level Architecture
  • Phase 3 — Deep Dive & Evolution
  • Phase 4 — Robustness & Operations

Glossary history

Click dotted jargon to save explanations here.