FAANG System Design Interview: Design A Chat System (WhatsApp, Facebook Messenger, Discord, Slack)
Designing a scalable test system for real-time messaging involves using a hybrid of HTTP and WebSocket protocols to ensure reliable message delivery, online presence, and offline storage, while leveraging distributed system architecture and third-party services for efficient communication.
MAIN POINTS FROM TRANSCRIPT
- Supports one-on-one and group chats up to 100 participants with guaranteed message delivery.
- Uses a hybrid approach with HTTP for sending and WebSocket for receiving messages.
- System architecture includes salus services, staple services, and third-party integrations.
- Offline message delivery is managed through an inbox pattern and third-party push notifications.
TAKEAWAYS
- WebSocket connections enable instant message delivery but require careful scaling.
- Load balancing and REST APIs facilitate scalable message sending and user authentication.
- Persistent WebSocket connections are crucial for handling large user volumes.
- Offline message storage is temporary, ensuring efficient resource use without central storage.