Messaging Architecture - by NK - System Design Newsletter
While the real-time API handles chat messages, typing indicators, and presence status. The real-time API uses WebSockets for bidirectional communication. I think HTTP/2 combined with Server-Sent Events is another option for bidirectional communication. Because HTTP/2 offers multiplexing by reusing the same TCP connection. Also Slack API gets paginated to reduce latency and bandwidth usage. And they do it using cursor-based pagination. Cursor-based pagination works by maintaining a pointer to a specific item in an ordered dataset. And client requests include the pointer to get only items after that. Slack runs on the LAMP (Linux-Apache-MySQL-PHP) stack. They used MySQL database to store chat messages because: It’s a proven technology It offers mature tooling support There are many experienced engineers available in the SQL domain The relational data model is a great discipline But MySQL by default favors strong consistency. So they set up MySQL as an eventually consistent database for h
While the real-time API handles chat messages, typing indicators, and presence status. The real-time API uses WebSockets for bidirectional communication. I think HTTP/2 combined with Server-Sent Events is another option for bidirectional communication. Because HTTP/2 offers multiplexing by reusing the same TCP connection. Also Slack API gets paginated to reduce latency and bandwidth usage. And they do it using cursor-based pagination. Cursor-based pagination works by maintaining a pointer to a specific item in an ordered dataset. And client requests include the pointer to get only items after
Explore this link on the map →