System Design Playbook
04 · System designs100 users → 100M+ users12 min read

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.

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

MetricEstimate
Daily users~50M
Swipes~1.5B / day ≈ 17K swipes/s, evening peaks 3×
Matches~1–2% of right swipes → tens of millions per day
Photos6 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  -- Redis

Architecture

Architecture
Scale
Follow a request
◱Ana's app◱Bob's app◍CDNphotos⇄API gateway▣Photo storageS3⚙Recommendationscard stack⚙Swipe service⚙ChatWebSockets⌕Geo search indexElasticsearch⚙Match service↻PushAPNs / FCM⛁PostgreSQLprofiles, matches⛁Swipes &messagesCassandra / DynamoDBϟRedisdecks, likes received

Step by step · Swipe right → match

  1. 01Swipes right on Bob
  2. 02POST /swipes { target: bob, like: true }
  3. 03Stores the like
  4. 04Appended to Ana's swipes
  5. 05"Bob already liked Ana" → mutual!
  6. 06Match created
  7. 07Match saved
  8. 08"It's a match!"
  9. 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

Architecture
Scale
Follow a request
◱Ana's app◱Bob's app▣Photo storageS3⚙App serverprofiles + swipes⛁PostgreSQLprofiles, matches

Step by step · Get my card stack

  1. 01Opens the app
  2. 02Finds candidates
  3. 03PostGIS: within 25 km, age 28–35, not swiped yet
  4. 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.

UsersWhat you runWhy it changes
100App + PostgreSQL/PostGIS + S3A geo query over a few profiles is instant
10KCDN for photos, Redis, push notificationsPhoto traffic and instant match alerts
1MGeo search index, precomputed decks, swipe store, match + chat servicesSwipe volume and deck latency
100M+Geosharded index, ML ranking, horizontally scaled swipe storeBillions 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?

Security PlaybookNow attack it: threat-model this designFind the STRIDE threats in this architecture and pick the mitigations.↗