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
Get my system design playbook for FREE on newsletter signup: This post outlines Slack's architecture. If you want to learn more, scroll to the bottom and find the references. Share this post & I'll send you some rewards for the referrals. Slack is a real-time messaging app. They built Slack with 2 API types: web and real-time. The web API handles user sessions over HTTP. While the real-time API handles chat messages, typing indicators, and presence status. The real-time API uses WebSockets for bidirectional communication. Real-Time API with WebSockets I think HTTP/2 combined with…
related reading
- Everything I know about good system designseangoedecke.com
- Scaling Our Chat Infrastructure for AI Healthcare | Counsel Healthcounselhealth.com
- WebSockets, caution required!samsaffron.com
- Slack developer docs | Slack Developer Docsapi.slack.com
- How Discord Stores Trillions of Messagesdiscord.com
- How OpenAI delivers low-latency voice AI at scale | OpenAIopenai.com
- Ando: Building Slack from Scratch — New Ontologiesnew-ontologies.com
- Gantry: Slack’s Fast-booting Frontend Framework | Engineering at Slackslack.engineering
- the-websocket-handbook.pdfpages.ably.com
- Socket.IO vs. WebSocket: Key differences and which to useably.com
- Designkafka.apache.org
- Teams OS and the Slack Social Network – Stratechery by Ben Thompsonstratechery.com