Design Tinder (swipes, matches and geo search)
Show each user a stack of nearby people who match their preferences, record billions of swipes and detect a match the instant two people like each other. Geo search, precomputed recommendations and a write-heavy swipe store are the heart of it.
Builds on these concepts
In one sentence
Find candidates with a geo search index, precompute each user's stack, store swipes in a write-optimised store, and detect matches with a fast "did they like me?" lookup.
A reference design: it covers what an app like this needs and follows how these companies have described their systems publicly, simplified to be learnable.
Requirements
Functional
- Profile with photos, location and preferences
- Stack of nearby candidates
- Swipe left/right; match on mutual like
- Chat between matches
Non-functional
- Swiping must feel instant: the next card is already loaded
- Very high write volume (swipes)
- Never show someone you already swiped
- Privacy: approximate location only
Back-of-the-envelope estimates
| Metric | Estimate |
|---|---|
| Daily users | ~50M |
| Swipes | ~1.5B / day ≈ 17K swipes/s, evening peaks 3× |
| Matches | ~1–2% of right swipes → tens of millions per day |
| Photos | 6 per profile × several sizes: most of the bytes served |
API and data model
GET /deck → [ profileCard ] (100 at a time)
POST /swipes { targetId, like } → { match?: { matchId } }
GET /matches → [ match ]
WS chat ↔ { matchId, text }
profiles(id, name, birthdate, gender, prefs, location, last_active)
swipes(user_id, target_id, like, ts) -- partitioned by user_id
matches(id, user_a, user_b, created_at)
likes_received:{user} → set of user ids -- RedisArchitecture
Step by step · Swipe right → match
- 01Swipes right on Bob
- 02POST /swipes { target: bob, like: true }
- 03Stores the like
- 04Appended to Ana's swipes
- 05"Bob already liked Ana" → mutual!
- 06Match created
- 07Match saved
- 08"It's a match!"
- 09Both phones light up
At this scale · 1M users
Precomputed decks, swipes as a stream
- ▸A geo search index (Elasticsearch) finds candidates
- ▸Decks precomputed and refilled in the background
- ▸Swipes go to a write-optimised store; match check is a fast lookup
- ▸Chat over WebSockets after a match
Tap any box to see what it does.
Deep dive: decks and match detection
- Candidates: a geo index answers "active users within 25 km, aged 28–35, interested in me". At scale the index is sharded by geographic cell, so a query only hits nearby shards.
- Precomputed stacks: the deck service fills a stack of ~100 candidates per user in the background and serves from cache; swiping never waits for a search.
- Already swiped: a per-user set (or Bloom filter) of swiped ids filters candidates out.
- Match check: when Ana likes Bob, look up "has Bob liked Ana?" in an in-memory set. If yes, create the match and notify both. One lookup, no scan.
- Ranking: an ML model orders candidates by likely mutual interest and activity, so active users see active users.
How it changes with scale
Step by step · Get my card stack
- 01Opens the app
- 02Finds candidates
- 03PostGIS: within 25 km, age 28–35, not swiped yet
- 04First cards appear instantly
At this scale · 100 users
A geo query and a swipes table
- ▸Profiles in PostgreSQL + PostGIS; photos in S3
- ▸The deck is a query: nearby, matching preferences, not yet swiped
- ▸On a like, check if the other person already liked you
Tap any box to see what it does.
| Users | What you run | Why it changes |
|---|---|---|
| 100 | App + PostgreSQL/PostGIS + S3 | A geo query over a few profiles is instant |
| 10K | CDN for photos, Redis, push notifications | Photo traffic and instant match alerts |
| 1M | Geo search index, precomputed decks, swipe store, match + chat services | Swipe volume and deck latency |
| 100M+ | Geosharded index, ML ranking, horizontally scaled swipe store | Billions of swipes and dense cities |
Key takeaways
- 01Geo search finds candidates; shard the index by geography at scale.
- 02Precompute each user's stack so swiping never waits.
- 03Swipes are a write-heavy, append-only stream partitioned by user.
- 04A match is a single lookup of "did they already like me?".
Check your understanding
1 of 3
In a dating app like Tinder, how are candidate profiles found?