Member-only story
System Design: Messaging System (Facebook Messenger)
Messaging systems can vary greatly, such as Messenger, Discord, WhatsApp, or Slack, each offering unique features. If you are asked to design a messaging system during your System Design Interview, start with clarifying questions. Ask which type of messaging system you should focus on to better understand the scope and requirements.
For our use case we will try building something similar to Facebook Messenger which has various features.
Functional Requirements:
- 1:1 messaging between users
- Group messaging (we can limit the group size to 1000)
- Chat History
- Quick search in chats (Bonus)
- Online/Offline status (Bonus)
- Share Media (Bonus)
Non Functional Requirements:
- Consistency over Availability in chat sequence
- Low Latency to load chats, send, receive chats
- Security of data transfer: encryption
- Logging, Monitoring
Entities:
- Chat
- Groups
- Users
Data Flow
- The Users choose to be apart of a group. Where a group can be of size 1–100. Group of size 1 will be used for 1:1 chats.
- Chats are associated with a group, and have a timestamp to keep the order…