⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠

Text Elements

Requirements:

  • user can create profile with bio and pictures
  • user can “swipe” on users based on preferences and location
  • two users can match
  • real-time chat system
  • notifications
  • elo/ranking system?

Estimations:

  • 10M DAU
  • each person swipes 30 times a day
  • each person matches with 2 people/day
  • 30M profiles * 3MB = 100TB of profile data
  • 30M swipes/day = 350 SPS, 700 peak SPS

client

profile service

get/create profile

user database

save user

cache

check cache first

use caching policy

blob storage

save images

update image urls in db

load balancer

  • NoSQL - not much relational data, just storing raw user data.

feed generation service

feed message queue

feed generation service

feed generation service

feed database

user_id: other_user_ids[]

save

  • precompute for active users, cache the feeds.

feed service

load balancer

read

grab profiles referenced in feed

  • filter users by preference, location of user.

on a job

  • for a cache miss, we can prioritize generating for a user who’s logged in but doesn’t have a precomputed feed.

Tinder System Design

likes service

like a profile

likes/dislikes database

user1, user2

save like in db, emit like event.

match service

on like event, check if it creates a match

matches database

save match

notification service

notify user of match

you got a match!

check likes?

image database

  • authentication can be done in a separate gateway.

  • we might not to precompute these feeds for users, maybe we can just geographically shard our user databases, and then filter on those databases based on user preferences.