success icon
home Home
Slack real-time messaging
by Sameera Thangudu
/
May 14, 2024
half yellow star half yellow star half yellow star half yellow star half yellow star
0 ratings
6 views
Slack real-time messaging architecture diagram - image 0 Slack real-time messaging architecture diagram - image 1 Slack real-time messaging architecture diagram - image 2
Slack real-time messaging - Every Slack client has a persistent websocket connection to Slack’s servers to receive real-time events to maintain its state. Once the websocket is set up, as discussed above, the client hits our Webapp API to send a message. Webapp then sends that message to AS. AS looks at the channel ID in this message, discovers CS through a consistent hash ring, and routes the message to the appropriate CS that hosts the real time messaging for this channel. When CS receives the message for that channel, it sends out the message to every GS across the world that is subscribed to that channel. Each GS that receives that message sends it to every connected client subscribed to that channel id. Aside from chat messages, there is another special kind of message called an event. An event is any update a client receives in real time that changes the state of the client. There are hundreds of different types of events that flow across our servers. Some examples include when a user sends a reaction to a message, a bookmark is added, or a member joins a channel. These events follow a similar journey to the simple chat message shown above.
View source
Every Slack client has a persistent websocket connection to Slack’s servers to receive real-time events to maintain its state. Once the websocket is set up, as discussed above, the client hits our Webapp API to send a message. Webapp then sends that message to AS. AS looks at the channel ID in this message, discovers CS through a consistent hash ring, and routes the message to the appropriate CS that hosts the real time messaging for this channel. When CS receives the message for that channel, it sends out the message to every GS across the world that is subscribed to that channel. Each GS that receives that message sends it to every connected client subscribed to that channel id. Aside from chat messages, there is another special kind of message called an event. An event is any update a client receives in real time that changes the state of the client. There are hundreds of different types of events that flow across our servers. Some examples include when a user sends a reaction to a message, a bookmark is added, or a member joins a channel. These events follow a similar journey to the simple chat message shown above.
footer alien 1 footer alien 2 footer alien 3 footer alien 4 footer robot footer alien 5 footer alien 6 footer alien 7 footer alien 8