How to Design a Chat Application like WhatsApp:
🔹 Chat Servers - Manages a large number of concurrent WebSocket connections, facilitate real-time communication, and ensure that messages are delivered efficiently between users with minimal latency.
🔹 Load Balancer - Distributes traffic across multiple chat server instances. Uses sticky sessions to ensure clients consistently connect to the same server.
🔹 User Connection Cache - A fast, in-memory cache (e.g., Redis) that stores user's active connection details, such as the chat server they’re connected to and their last_active timestamp.
🔹 Notification Service - Sends push notifications via providers like FCM or APNS when users are offline.
🔹 Message Queue - Decouples real-time messaging from storage of the messages.
🔹 Message Storage Service - Consumes incoming messages from the Message Queue and persists them in the Message DB for efficient storage and retrieval.
🔹 Group Service - Responsible for handling all group-related functionalities, including creating groups, updating group details and returning list of group members.
🔹 Media Service - Handles the uploading and management of multimedia content, such as images, videos, and audio files.
🔹 Blob Storage - Storage backend for a chat application’s multimedia content (eg., S3).
🔹 CDN - To reduce latency when uploading or downloading multimedia content, files are distributed to locations geographically closer to users via a Content Delivery Network (CDN).
I wrote a detailed article on this system design interview problem. Read it here: https://t.co/b7nEUcloFQ
♻️ Repost to help others in your network.
Subscribe for more such articles every week: https://t.co/kPG9KUxfy6
Want a chance to get a free backpack from Coursera? 🎒
Simply repost and DM us your full name, address, email and phone number. 😊
(Exclusive to learners in the US, UK and India)