Design Venmo
Understanding the Problem
💸 What is Venmo? Venmo is a peer-to-peer (P2P) payments app. You send money to a friend by their username or phone number, request money from them, and see a social feed of payments among your friends ("Sam paid Alex 🍕"). Money arrives instantly in the recipient's Venmo balance, funded from the sender's balance, a linked bank account or a card. Cash App works the same way.
Zelle is a close cousin with a different architecture. There's no Zelle balance: money moves directly between two people's bank accounts, and Zelle is a network of banks plus a directory that maps an email or phone number to a bank account. We'll design a Venmo-style app with its own balances, and cover the Zelle model in a deep dive. Both come down to the same core: move money between two people exactly once, quickly, and tell everyone involved.
Functional Requirements
Core Requirements
- Users should be able to send money to another user by username, phone or email, funded from their balance, a bank account or a card.
- Users should be able to request money from another user, who can pay or decline.
- Users should be able to schedule a payment for a future date, once or on a recurring basis (monthly rent, a weekly allowance).
- Users should be able to see their own transaction history and a feed of their friends' payments, subject to privacy settings.
Below the line (out of scope)
- Merchant payments, debit cards and crypto.
- Cashing out to a bank (it's a withdrawal; see /system-design/digital-wallet).
- Splitting a bill across a group (see /system-design/splitwise).
- Comments, likes and the social graph beyond a friends list.
Non-Functional Requirements
Ask about scale. For our design: 80 million monthly users, 20 million daily, and 15 million payments a day. Traffic is spiky: Friday and Saturday nights, holidays, and the 1st of the month when rent goes out.
Core Requirements
- Money must move exactly once. No duplicate payments from retries, no money lost or created, no balance going negative through our own operations.
- A payment between balances should complete and appear to the recipient within about a second.
- The feed and history should load in under 200 ms, and may be a few seconds behind.
- Scheduled payments must run on their date, once, even when millions are due at the same moment.
- The money path should be highly available (99.99%), and favor consistency over availability.
Below the line (out of scope)
- Multi-region active-active writes for the same user.
- Full fraud modeling, though we'll leave hooks for it.
Back of the envelope. 15M payments a day is about 175 per second average; a 5x peak is around 900/s. The 1st of the month is worse for scheduled payments: if 3 million rent payments are scheduled for that date and we want them done within the first hour, that's ~830/s from the scheduler alone on top of normal traffic.
Reads dwarf writes. 20M daily users opening the app ~10 times a day, each loading a feed and a balance, is 200 million feed reads a day, ~2,300/s average and maybe 10k/s at peak.
So the design splits cleanly: a money path that's modest in volume but must be exactly right, and a social path that's read-heavy and can be eventually consistent. The trick is keeping the two in agreement without coupling them.
Say the split out loud. "The ledger is low QPS and must be strongly consistent; the feed is high QPS and can lag by seconds. I'll connect them with events." That one sentence frames the whole interview.