NewsCrawler.org

How Slack Delivers Real-Time Messages: Its Server Architecture

How Slack Delivers Real-Time Messages: Its Server Architecture
How Slack Delivers Real-Time Messages: Its Server Architecture
How Slack Delivers Real-Time Messages: Its Server Architecture
How Slack Delivers Real-Time Messages: Its Server Architecture
Image: Reddit

This is an engineering blog post from Slack that describes the architecture it uses to send real-time messages. Slack sends millions of messages a day across millions of channels, with most users online between 9am and 5pm local time. Its core services, written in Java, are Channel Servers, Gateway Servers, Admin Servers and Presence Servers.

Each Channel Server keeps channel history in memory and is assigned a set of channels through consistent hashing[1]. At peak times, about 16 million channels are served per host. Consistent hash ring managers replace unhealthy Channel Servers, and a new one is ready to serve traffic in under 20 seconds. Gateway Servers are deployed across several regions so clients connect to the nearest one, and Presence Servers track which users are online to power the green presence dots.

When a user sends a message, it passes from the Webapp API to Admin Servers, then to the Channel Server for that channel, then to every Gateway Server subscribed to it, and finally to connected clients. Each client keeps a persistent websocket[2] connection, and Envoy[3] forwards its first request to a Gateway Server. Consul[4] is the service discovery tool where Channel Servers are registered. Reminders, scheduled messages and calendar events cause traffic spikes at the top of each hour, and the system delivers messages worldwide in 500ms.

Slack shares (CRM)

180.62 USD 0.0% since the news day, November 20

Close on November 20 Quotes: CNBC Chart by TradingView

Read the original slack.engineeringDiscussion

Discussion

Commenters mostly say the article is old, describing it as three and a half years old or over three years old. Others criticize Slack in general, and one says Discord operates at a larger scale and is engineered better.

Sources

Published: First seen: Читать по-русски

Open as a page