Tinder System Design
Tinder System Design
Features:
1. Storing Profiles (Images) - 5 Images per user
2. Recommend Matches (No of active users)
3. Note Matches (0.1% of Matching with someone)
4. Direct Messaging
1. Storing Profiles
Design of Feature 1:
Client -> Update Profile -> Gateway -> Profile Service -> Database
Client -> Update Image -> Gateway -> Image Service -> Database
Keep separate image service because it is a high computational service.
Now who will maintaining these connections, for each connection id which user id is connected to it.
So, the gateway service can do it but we can reduce its burden and make a new service which would
be sessions. So this service will contain which user id is containing which connection id.
Design of Feature 3:
If you match with someone, it could be to send to the profile service or it could be sent to the
matching service, which keeps a table of user Id and user ID.
Now matching service will be checking if you are authenticated to communicate with the other user,
so there will be communication between session service and matching service.
Horizontal Partitioning means you take some property of a data; you set ranges in one column
and direct data to a location based on that range.
For eg:
All users having name from A-J will go to database node 36
All users having name from K-P will go to database node 79
Now what if it causes a single point of error, so we can use a master slave architecture.
Recommendation Service:
User IDs | Location