The system design process has the following pattern:
Propose High-level design
c.Think of scalability
1) Kind of chat -> 1-1 chat and group chat
2)Should support 70 million daily active users
3)Group of max 200 peoples
4)System should allow only text messages
5)Maximum 5000 chars
6)History should available forever.
Propose a very high-level design and buy-in
For a chat system, client needs to connect chat service using one or more network protocols and choice of network is important.
HTTP Protocol communication is very common. Client can initiate HTTP connection by providing a keep-alive header to keep the connection persistent. Initially, Many company started http protocol but it is not reliable.
Since the Http connection is initiated by the client end so from receiver side it is very difficult and it is not trivial to send message from the server. Server-initiated connection are used to persistent connection and easy to send and receive message.
There are few technique- Polling, long polling , and Websocket.
Websocket is the most common solution for sending asynchronous updates from server.
Next will post on Service and Storage selection.......