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
- How's Linear so fast? A technical breakdownperformance.dev
- Ando: Building Slack from Scratch — New Ontologiesnew-ontologies.com
- Slack developer docs | Slack Developer Docsapi.slack.com
- the-websocket-handbook.pdfpages.ably.com
- Gantry: Slack’s Fast-booting Frontend Framework | Engineering at Slackslack.engineering
- Realtime with serverless using Websocket in AWSunimedia.tech
- How I built a sub-500ms latency voice agent from scratch | Nick Tikhonovntik.me
- WebSockets, caution required!samsaffron.com
- Communication APIs for Messaging and Voice | Linqlinqapp.com
- Modal's serverless Servers | Modal Blogmodal.com
- Scaling Our Chat Infrastructure for AI Healthcare | Counsel Healthcounselhealth.com
- Web Architecture 101. The basic architecture concepts I wish… | by Jonathan Fulton | The Storyblocks Tech Blog | Mediummedium.com