Skip to contentমূল লেখায় যান

Case 08 · System designকেস 08 · System design

How Slack Works

Slack is a chat app for work teams: you type a line in a channel, and every member sees it a moment later. That is hard because millions of people are online at once,Source 2সোর্স 2 and every reader must see the messages in the same order.Source 1সোর্স 1 This page explains one interview-style article on Slack. The article says its design can differ from the real system,Source 1সোর্স 1 and the page says so where Slack's own blog describes the real one.

9 min read9 মিনিটে পড়া যায় · 10 sections10টি সেকশন · 2 sources2টি সোর্স · updated Nov 2026আপডেট: Nov 2026

One message, many socketsএকটা মেসেজ, অনেক সকেট

A message fans out through the channel server to gateway sockets, then an outage shows a thundering herd.একটা মেসেজ channel server হয়ে gateway সকেটে ছড়ায়, তারপর একটা outage-এ thundering herd দেখা যায়।

2 min2 মিনিট7 steps7টি ধাপ
  • Membersসদস্য50
  • DB writesডেটাবেসে লেখা0
HTTPHTTPyou · senderআপনি · প্রেরকnew messageনতুন মেসেজChatচ্যাটserviceসার্ভিসDatabaseডেটাবেসChannelচ্যানেলserverসার্ভারGatewayগেটওয়েserversসার্ভারmembers · 50সদস্য · 50

You’ll learnআপনি শিখবেন

  • One database write, many pushesএকটা ডেটাবেস লেখা, অনেক পুশ
  • Typing signals are not savedটাইপিং সিগন্যাল সেভ হয় না
  • What a thundering herd isthundering herd কী
  • How jitter flattens the reconnect spikeজিটার কীভাবে reconnect স্পাইক সমান করে

The problem in plain words

A chat system must do a small number of things very well. It must deliver each message to all members of a channel in real time. It must store the history and show it in time order. It must show who is online. It must never show one message to a user two times.Source 1সোর্স 1

The article uses interview numbers to size the system. It assumes 10 million daily users, about 7 million users connected at the same time, and 10 reads for each write.Source 1সোর্স 1 It allows up to 10,000 users in a channel and up to 200,000 users in a workspace.Source 1সোর্স 1 If each user sends 100 messages a day, the system takes about 12,000 new messages per second and serves about 120,000 reads per second.Source 1সোর্স 1 At about 100 bytes per message, that is roughly 100 GB of new text each day and about 150 TB in 5 years (the article counts 300 days a year).Source 1সোর্স 1

The real traffic has a clear daily shape. Slack's blog says that on a work day, most users are online from 9am to 5pm local time, with peaks at 11am and 2pm.Source 2সোর্স 2

সহজ English

A chat system must do a few things very well. It must send each message to all members of a channel in real time. It must store the history and show it in time order. It must show who is online. It must never show one message to a user two times.Source 1সোর্স 1

The article uses interview numbers for the size of the system: 10 million daily users, about 7 million users connected at the same time, and 10 reads for each write.Source 1সোর্স 1 A channel can have up to 10,000 users, and a workspace up to 200,000 users.Source 1সোর্স 1 If each user sends 100 messages a day, the system gets about 12,000 new messages and serves about 120,000 reads each second.Source 1সোর্স 1 At about 100 bytes per message, that is roughly 100 GB of new text each day and about 150 TB in 5 years (the article counts 300 days a year).Source 1সোর্স 1

Slack's blog says that on a work day, most users are online from 9am to 5pm local time, with peaks at 11am and 2pm.Source 2সোর্স 2

বাংলা ব্যাখ্যা

একটি chat system-কে কয়েকটি কাজ খুব ভালোভাবে করতে হয়। প্রতিটি message real time-এ channel-এর সব member-এর কাছে পৌঁছাতে হবে। History store করে সময়ের ক্রমে দেখাতে হবে। কে online আছে, তা দেখাতে হবে। আর একই message কোনো user-কে কখনো দুইবার দেখানো যাবে না।Source 1সোর্স 1

System-এর আকার ঠিক করতে article-টি interview-এর সংখ্যা ব্যবহার করে। এটি ধরে নেয় প্রতিদিন 10 million user, একই সময়ে প্রায় 7 million connected user, এবং প্রতিটি write-এর জন্য 10টি read।Source 1সোর্স 1 একটি channel-এ সর্বোচ্চ 10,000 user এবং একটি workspace-এ সর্বোচ্চ 200,000 user থাকতে পারে।Source 1সোর্স 1 প্রতিটি user দিনে 100টি message পাঠালে system প্রতি সেকেন্ডে প্রায় 12,000টি নতুন message নেয় এবং প্রায় 120,000টি read সামলায়।Source 1সোর্স 1 প্রতিটি message প্রায় 100 bytes হলে প্রতিদিন মোটামুটি 100 GB নতুন text হয়, আর 5 বছরে প্রায় 150 TB (article বছরে 300 দিন ধরে)।Source 1সোর্স 1

আসল traffic-এর একটি স্পষ্ট দৈনিক ধরন আছে। Slack-এর blog বলে, কাজের দিনে বেশিরভাগ user সকাল 9টা থেকে বিকেল 5টা পর্যন্ত (স্থানীয় সময়) online থাকে, আর peak আসে সকাল 11টায় এবং দুপুর 2টায়।Source 2সোর্স 2

The big picture

                 HTTP (send, history)
[Client] ---------------------------> [Chat service] --> [Chat database]
   ^                                        |
   |                                        v
   |                                [Channel servers]
   |                                        |
   |        WebSocket (live events)         v
   +------------------------------- [Gateway servers]

[Client] --HTTP (start-up data)--> [Snapshot service at the edge] --> [Cache]

A client sends a new message to the chat service over normal HTTP. The chat service saves it in the database first, and then passes it on.Source 1সোর্স 1 A channel server knows which gateways follow that channel and forwards the message to each of them. Each gateway then pushes the message down an open WebSocket line to every connected member.Source 2সোর্স 2 A separate snapshot service gives the app its start-up data quickly.Source 1সোর্স 1

সহজ English

The app sends a new message to the chat service over normal HTTP. The chat service saves the message in the database first. Then it passes the message on.Source 1সোর্স 1 A channel server knows which gateways follow that channel and forwards the message to each of them. Each gateway then pushes the message to every connected member over an open WebSocket line.Source 2সোর্স 2 A separate snapshot service gives the app its start-up data quickly.Source 1সোর্স 1 The diagram shows that this snapshot service is at the edge and uses a cache.

বাংলা ব্যাখ্যা

Client সাধারণ HTTP দিয়ে নতুন message chat service-এ পাঠায়। Chat service প্রথমে message-টি database-এ save করে, তারপর সামনে পাঠায়।Source 1সোর্স 1 একটি channel server জানে কোন gateway ওই channel অনুসরণ করে, এবং message-টি প্রতিটির কাছে forward করে। এরপর প্রতিটি gateway একটি খোলা WebSocket লাইনের মাধ্যমে প্রতিটি connected member-এর কাছে message push করে।Source 2সোর্স 2 একটি আলাদা snapshot service app-কে দ্রুত start-up data দেয়।Source 1সোর্স 1 Diagram-এ দেখা যায়, এই snapshot service edge-এ থাকে এবং একটি cache ব্যবহার করে।

Two lines to the server

Think of a letter and a phone call. You send a letter when you have one thing to say. You keep a phone line open when the other person must hear you at once. Slack uses both.

The web API is the letter. It is a set of HTTP addresses for one-off actions, such as login, sending a message, or creating a channel.Source 1সোর্স 1 The real-time API is the open phone line. It uses a WebSocket, which is a connection that stays open so the server can push data to the client at any time.Source 1সোর্স 1 Slack uses this line for live events such as new messages, typing signals, and online status.Source 1সোর্স 1

Slack's blog confirms that every client keeps one long-lived WebSocket to Slack's servers.Source 2সোর্স 2 At start, the client gets a token and the connection details from the main web backend. Then it opens the WebSocket to the nearest edge region.Source 2সোর্স 2 An open-source proxy named Envoy receives the connection and passes it to a gateway server.Source 2সোর্স 2

A typing signal is a "transient event". The system does not save it in the database. It only passes it to the online members of that channel.Source 2সোর্স 2

সহজ English

Slack uses two kinds of line to its servers, like a letter and a phone call. The web API is the letter. It is a set of HTTP addresses for one-off actions, such as login, sending a message, or creating a channel.Source 1সোর্স 1 The real-time API is the open phone line. It uses a WebSocket. This is a connection that stays open, so the server can push data to the client at any time. Slack uses it for live events: new messages, typing signals, and online status.Source 1সোর্স 1

Slack's blog says that each client keeps one long-lived WebSocket to Slack's servers. At start, the client gets a token and the connection details from the main web backend. Then it opens the WebSocket to the nearest edge region. An open-source proxy named Envoy receives the connection and passes it to a gateway server.Source 2সোর্স 2

A typing signal is a "transient event". The system does not save it in the database. It only passes it to the online members of that channel.Source 2সোর্স 2

বাংলা ব্যাখ্যা

একটি চিঠি আর একটি phone call-এর কথা ভাবুন। একটি কথা বলার থাকলে আপনি চিঠি পাঠান। অন্যজনকে সঙ্গে সঙ্গে শোনাতে হলে phone লাইন খোলা রাখেন। Slack দুটোই ব্যবহার করে।

Web API হলো চিঠি। এটি login, message পাঠানো বা channel তৈরির মতো এককালীন কাজের জন্য কিছু HTTP address-এর একটি set।Source 1সোর্স 1 Real-time API হলো খোলা phone লাইন। এটি WebSocket ব্যবহার করে। WebSocket এমন একটি connection, যা খোলা থাকে, যাতে server যেকোনো সময় client-এ data push করতে পারে।Source 1সোর্স 1 নতুন message, typing signal আর online status-এর মতো live event-এর জন্য Slack এই লাইন ব্যবহার করে।Source 1সোর্স 1

Slack-এর blog নিশ্চিত করে যে প্রতিটি client Slack-এর server-এর সাথে একটি দীর্ঘস্থায়ী WebSocket রাখে।Source 2সোর্স 2 শুরুতে client মূল web backend থেকে একটি token এবং connection-এর তথ্য নেয়। তারপর সবচেয়ে কাছের edge region-এ WebSocket খোলে।Source 2সোর্স 2 Envoy নামের একটি open-source proxy connection-টি গ্রহণ করে একটি gateway server-এ পাঠায়।Source 2সোর্স 2

Typing signal হলো একটি "transient event"। System এটি database-এ save করে না। শুধু ওই channel-এর online member-দের কাছে পাঠিয়ে দেয়।Source 2সোর্স 2

One message, many readers

Think of a radio station. The presenter speaks one time, and every radio tuned to that station hears it. Slack must do the same thing for each channel.

In the real system, Slack's core real-time services are written in Java. Two of them are channel servers and gateway servers.Source 2সোর্স 2 A channel server holds recent messages for a fixed set of channels in memory.Source 2সোর্স 2 Slack picks the channel server with consistent hashing. That is a rule that turns a channel ID into one server, and it moves few channels when a server joins or leaves.Source 2সোর্স 2 If a channel server fails, a manager service puts a new one in place in under 20 seconds.Source 2সোর্স 2

Gateway servers hold the WebSocket connections of users and the list of channels each user follows. Unlike the other servers, they run in many geographic regions, so each client connects to a nearby one.Source 2সোর্স 2 When a message arrives, the channel server sends it to every gateway that follows that channel. Each gateway sends it to its own connected clients.Source 2সোর্স 2 Slack's blog says this delivers messages around the world in 500 ms.Source 2সোর্স 2

The article adds a bandwidth idea. It keeps a list of which data centers have followers of each channel, so a message goes only to those data centers.Source 1সোর্স 1

সহজ English

Like a radio station, Slack must send one message to all readers of a channel. In the real system, Slack's core real-time services are written in Java. Two of them are channel servers and gateway servers.Source 2সোর্স 2

A channel server keeps recent messages of a fixed set of channels in memory. Slack picks the channel server with consistent hashing. This rule turns a channel ID into one server, and it moves few channels when a server joins or leaves. If a channel server fails, a manager service puts a new one in place in under 20 seconds.Source 2সোর্স 2

Gateway servers hold the WebSocket connections of users and the list of channels that each user follows. They run in many geographic regions, so each client connects to a nearby one. The channel server sends a new message to each gateway that follows that channel. Each gateway sends it to its connected clients. Slack's blog says this delivers messages around the world in 500 ms.Source 2সোর্স 2

To save bandwidth, the article sends a message only to the data centers that have followers of that channel.Source 1সোর্স 1

বাংলা ব্যাখ্যা

একটি radio station-এর কথা ভাবুন। উপস্থাপক একবার কথা বলেন, আর ওই station-এ tune করা সব radio তা শোনে। Slack-কে প্রতিটি channel-এর জন্য একই কাজ করতে হয়।

আসল system-এ Slack-এর মূল real-time service-গুলো Java-তে লেখা। এদের দুটি হলো channel server এবং gateway server।Source 2সোর্স 2 একটি channel server নির্দিষ্ট কিছু channel-এর সাম্প্রতিক message memory-তে রাখে।Source 2সোর্স 2 Slack consistent hashing দিয়ে channel server বাছাই করে। এটি এমন একটি নিয়ম, যা একটি channel ID-কে একটি server-এর সাথে মেলায়, আর কোনো server যোগ হলে বা চলে গেলে অল্প কিছু channel সরায়।Source 2সোর্স 2 কোনো channel server fail করলে একটি manager service 20 সেকেন্ডের কম সময়ে নতুন একটি বসিয়ে দেয়।Source 2সোর্স 2

Gateway server user-দের WebSocket connection এবং প্রতিটি user কোন কোন channel follow করেন, তার list রাখে। অন্য server-গুলোর মতো নয়, এগুলো অনেক ভৌগোলিক region-এ চলে, তাই প্রতিটি client কাছের একটিতে connect করে।Source 2সোর্স 2 Message এলে channel server সেটি ওই channel follow করা প্রতিটি gateway-তে পাঠায়, আর প্রতিটি gateway তার নিজের connected client-দের কাছে পাঠায়।Source 2সোর্স 2 Slack-এর blog বলে, এভাবে সারা বিশ্বে 500 ms-এ message পৌঁছে যায়।Source 2সোর্স 2

Article-টি bandwidth-এর একটি ধারণা যোগ করে। কোন data center-এ প্রতিটি channel-এর follower আছে, তার একটি list রাখা হয়, তাই message শুধু সেই data center-গুলোতে যায়।Source 1সোর্স 1

A fast start with a snapshot

When you open Slack, the app must show your channels and the members of each channel. The article calls this start-up package a snapshot.Source 1সোর্স 1 For a large company, the full snapshot can grow to tens of megabytes, which makes start-up slow.Source 1সোর্স 1

Think of a shop that keeps the most popular items at the front counter. You do not wait for the warehouse. The snapshot service is that counter. It is a cache close to the user, and it returns a smaller start-up package. The app then loads the rest only when it needs it. This is called lazy loading.Source 1সোর্স 1 The article says this in-memory service should handle about 1 million queries per second.Source 1সোর্স 1 It also sends all users of one team to the same instance, so that instance holds that team's data and answers more requests from memory.Source 1সোর্স 1

সহজ English

When you open Slack, the app must show your channels and the members of each channel. The article calls this start-up package a snapshot. For a large company, the full snapshot can grow to tens of megabytes, so start-up is slow.Source 1সোর্স 1

The snapshot service is like the front counter of a shop, where the most popular items wait. It is a cache close to the user, and it returns a smaller start-up package. The app loads the rest only when it needs it. This is called lazy loading.Source 1সোর্স 1 The article says that this in-memory service should handle about 1 million queries per second. It sends all users of one team to the same instance. That instance then holds the data of that team and answers more requests from memory.Source 1সোর্স 1

বাংলা ব্যাখ্যা

Slack খুললে app-কে আপনার channel-গুলো এবং প্রতিটি channel-এর member-দের দেখাতে হয়। Article-টি এই start-up package-কে snapshot বলে।Source 1সোর্স 1 একটি বড় company-র জন্য পুরো snapshot কয়েক দশ megabyte পর্যন্ত বড় হতে পারে, ফলে start-up ধীর হয়।Source 1সোর্স 1

এমন একটি দোকানের কথা ভাবুন, যেটি সবচেয়ে জনপ্রিয় জিনিসগুলো সামনের counter-এ রাখে। আপনাকে গুদামের জন্য অপেক্ষা করতে হয় না। Snapshot service হলো সেই counter। এটি user-এর কাছাকাছি থাকা একটি cache, এবং এটি ছোট একটি start-up package ফেরত দেয়। App বাকিটা শুধু দরকার হলে load করে। একে lazy loading বলে।Source 1সোর্স 1 Article বলে, এই in-memory service-কে প্রতি সেকেন্ডে প্রায় 1 million query সামলাতে হবে।Source 1সোর্স 1 এটি একটি team-এর সব user-কে একই instance-এ পাঠায়, ফলে সেই instance ওই team-এর data রাখে এবং memory থেকে বেশি request-এর উত্তর দেয়।Source 1সোর্স 1

Storing the history

The article stores messages in a relational database such as MySQL. It gives four reasons: the technology is mature, the data model is disciplined, the tools are good, and many engineers know it.Source 1সোর্স 1 One database cannot hold every message. So the article splits the data into shards, which are smaller databases that each hold part of the data. The shard key is the channel ID.Source 1সোর্স 1 A tool called Vitess sits on top of MySQL and hides the shards from the application code. It can also split or merge shards later.Source 1সোর্স 1

To read history, the app asks for one page of messages at a time. The article compares two ways to ask for the next page.Source 1সোর্স 1

MethodHow it asksProblem or benefit
Offset"Skip 40 messages, give me 20"The database reads and throws away the skipped rows. New messages shift the pages, so a user can see a message twice or miss one.
Cursor"Give me 20 messages older than this marker"The database jumps to the marker with an index. New messages do not move the window. You cannot jump to page 7.

The article chooses the cursor method for chat history.Source 1সোর্স 1

সহজ English

The article keeps messages in a relational database such as MySQL. It gives four reasons: the technology is mature, the data model is disciplined, the tools are good, and many engineers know it.Source 1সোর্স 1 One database cannot hold every message. So the article splits the data into shards. Each shard is a smaller database with part of the data. The shard key is the channel ID. Vitess, a tool on top of MySQL, hides the shards from the application code. It can also split or merge shards later.Source 1সোর্স 1

The app reads history one page at a time.Source 1সোর্স 1 With an offset ("skip 40 messages, give me 20"), the database reads and throws away the skipped rows. New messages move the pages, so a user can see a message two times or miss one. With a cursor ("give me 20 messages older than this marker"), the database uses an index to go to the marker, and new messages do not move the window. But you cannot go to page 7. The article chooses the cursor method.Source 1সোর্স 1

বাংলা ব্যাখ্যা

Article-টি message রাখে MySQL-এর মতো একটি relational database-এ। এর চারটি কারণ: technology-টি পরিপক্ব, data model শৃঙ্খলাবদ্ধ, tool-গুলো ভালো, আর অনেক engineer এটি জানেন।Source 1সোর্স 1 একটি database সব message ধরে রাখতে পারে না। তাই article-টি data-কে shard-এ ভাগ করে। Shard হলো ছোট database, যার প্রতিটিতে data-র একটি অংশ থাকে। Shard key হলো channel ID।Source 1সোর্স 1 Vitess নামের একটি tool MySQL-এর উপরে বসে application code থেকে shard-গুলো লুকিয়ে রাখে। এটি পরে shard ভাগ বা একত্রও করতে পারে।Source 1সোর্স 1

History পড়তে app একবারে এক page message চায়। পরের page চাওয়ার দুটি উপায় article-টি তুলনা করে।Source 1সোর্স 1 Offset পদ্ধতিতে ("40টি message বাদ দিয়ে 20টি দাও") database বাদ দেওয়া row-গুলোও পড়ে, তারপর ফেলে দেয়। নতুন message এলে page সরে যায়, তাই user একটি message দুইবার দেখতে পারেন বা একটি হারাতে পারেন। Cursor পদ্ধতিতে ("এই marker-এর চেয়ে পুরনো 20টি message দাও") database একটি index দিয়ে সরাসরি marker-এ যায়, আর নতুন message window সরায় না। তবে আপনি সরাসরি page 7-এ যেতে পারবেন না। Chat history-র জন্য article-টি cursor পদ্ধতি বেছে নেয়।Source 1সোর্স 1

Order and duplicates

Every reader must see the same order. A clock on each server is not good enough, because server clocks drift and network delays differ.Source 1সোর্স 1 The clock of the user's device is worse, because a user can set it to any time.Source 1সোর্স 1 The article suggests a logical clock, such as a Lamport clock. It is a counter that goes up with each message, so it records which message came after which.Source 1সোর্স 1

Duplicates are a different risk. The article tags each message with a random unique token. The client uses this token to skip a message that it already shows.Source 1সোর্স 1

সহজ English

All readers must see the messages in the same order. A clock on each server is not good enough, because server clocks drift and network delays are different. The clock on the user's device is worse, because the user can set it to any time. The article suggests a logical clock, such as a Lamport clock. This is a counter that goes up with each message, so it records which message came after which.Source 1সোর্স 1

Duplicates are a different risk. The article gives each message a random unique token. The client uses this token to skip a message that it already shows.Source 1সোর্স 1

বাংলা ব্যাখ্যা

প্রতিটি পাঠককে message-গুলো একই ক্রমে দেখতে হবে। প্রতিটি server-এর clock যথেষ্ট নয়, কারণ server clock সরে যায় (drift) এবং network delay আলাদা হয়।Source 1সোর্স 1 User-এর device-এর clock আরও খারাপ, কারণ user এটিকে যেকোনো সময়ে set করতে পারেন।Source 1সোর্স 1 Article-টি একটি logical clock, যেমন Lamport clock, ব্যবহারের পরামর্শ দেয়। এটি একটি counter, যা প্রতিটি message-এ বাড়ে, তাই কোন message কোনটির পরে এসেছে, তা এটি লিখে রাখে।Source 1সোর্স 1

Duplicate একটি আলাদা ঝুঁকি। Article-টি প্রতিটি message-এ একটি random unique token যোগ করে। Client এই token দিয়ে এমন message বাদ দেয়, যা এটি আগে থেকেই দেখাচ্ছে।Source 1সোর্স 1

Staying up under load

Think of a store that opens its doors after a power cut. Every customer rushes in at once. Engineers call this a thundering herd. The article warns that a whole company can reconnect at the same time after an outage.Source 1সোর্স 1 It lists these defenses:

The real system can also move users away from a failing region. Slack's blog calls this draining. When one region has trouble, the system moves its users to the closest healthy region.Source 2সোর্স 2 The article adds that a gateway keeps a queue in memory of transient events that are not yet committed. If the gateway fails, the system replays them.Source 1সোর্স 1

সহজ English

After an outage, a whole company can connect again at the same time. It is like a store that opens after a power cut, when all customers rush in at once. Engineers call this a thundering herd. The article gives these defenses:Source 1সোর্স 1

  • Add jitter, a small random delay, so that each client connects again at a slightly different time.
  • Rate limit each service, and drop requests when a server gets to its limit.
  • Answer start-up requests from the in-memory snapshot service, so that the databases get less load.

Slack's blog says that the real system can move users away from a region that has trouble, to the closest healthy region. Slack calls this draining.Source 2সোর্স 2 The article adds that a gateway keeps a queue in memory of transient events that are not committed yet. If the gateway fails, the system replays them.Source 1সোর্স 1

বাংলা ব্যাখ্যা

বিদ্যুৎ চলে যাওয়ার পর দরজা খোলা একটি দোকানের কথা ভাবুন। সব customer একসাথে ভেতরে ছুটে আসে। Engineer-রা একে thundering herd বলেন। Article-টি সতর্ক করে যে একটি outage-এর পর পুরো একটি company একই সময়ে আবার connect করতে পারে।Source 1সোর্স 1 এর বিরুদ্ধে এটি এই উপায়গুলো দেয়:

  • Jitter, অর্থাৎ ছোট একটি random delay, যোগ করুন, যাতে প্রতিটি client একটু আলাদা সময়ে আবার connect করে।Source 1সোর্স 1
  • প্রতিটি service-এ rate limit দিন, এবং কোনো server তার limit-এ পৌঁছালে request drop করুন।Source 1সোর্স 1
  • In-memory snapshot service থেকে start-up request-এর উত্তর দিন, যাতে database-এ load কম পড়ে।Source 1সোর্স 1

আসল system সমস্যায় থাকা region থেকে user-দের সরিয়েও নিতে পারে। Slack-এর blog একে draining বলে। একটি region-এ সমস্যা হলে system সেখানকার user-দের সবচেয়ে কাছের healthy region-এ সরিয়ে নেয়।Source 2সোর্স 2 Article আরও বলে, একটি gateway এখনো commit না হওয়া transient event-গুলোর একটি queue memory-তে রাখে। Gateway fail করলে system সেগুলো আবার replay করে।Source 1সোর্স 1

Key words

WordPlain meaning
WebSocketA connection that stays open, so the server can push data to the app at any time
Gateway serverThe server that holds the open connections of users and pushes messages to them
Fan-outSending one message to many receivers
Consistent hashingA rule that maps each key, such as a channel ID, to one server and moves few keys when servers change
CacheA fast copy of data kept in memory, so the system does not ask the database every time
ShardOne part of a database that is split into smaller pieces
Cursor paginationAsking for "the next page after this marker" and not "page number N"
Logical clockA counter that records which event came first, without real time
Thundering herdMany clients that hit a server at the same moment, for example after an outage
JitterA small random delay that spreads requests over time

What a tester can learn

Tutorial advice

These test ideas are the tutorial's own advice. They are not from the sources.

  • Send many messages fast from two clients in the same channel. Check that a third client shows them in the same order, with no gaps and no copies.
  • Kill the WebSocket in the middle of a conversation. Check that the app reconnects, fetches the missed messages, and does not show any message twice.
  • Scroll back through history while other users post new messages. Check that the pages do not skip or repeat a message.
  • Disconnect a large group of test clients and reconnect them all at once. Measure how the server and the start-up time behave.
  • Measure the delay from send to display between clients in different regions, and set a target for it.
  • Test channel edge cases: an empty channel, a channel at the member limit, and a user who leaves while a message is in flight.

সহজ English

These test ideas are the tutorial's own advice. They are not from the sources.

  • Send many messages fast from two clients in the same channel. Check that a third client shows them in the same order, with no gaps and no copies.
  • Stop the WebSocket in the middle of a conversation. Check that the app connects again, gets the missed messages, and shows no message two times.
  • Scroll back through history while other users post new messages. Check that no page skips or repeats a message.
  • Disconnect a large group of test clients and connect them all again at once. Measure how the server and the start-up time behave.
  • Measure the time from send to display between clients in different regions, and set a target for it.
  • Test channel edge cases: an empty channel, a channel at the member limit, and a user who leaves while a message is on its way.

বাংলা ব্যাখ্যা

এই test-এর ধারণাগুলো tutorial-এর নিজের পরামর্শ। এগুলো source থেকে নেওয়া নয়।

  • একই channel-এ দুটি client থেকে দ্রুত অনেক message পাঠান। দেখুন, তৃতীয় একটি client সেগুলো একই ক্রমে দেখাচ্ছে কি না, কোনো ফাঁক বা copy ছাড়া।
  • কথোপকথনের মাঝখানে WebSocket বন্ধ করে দিন। দেখুন, app আবার connect করে, হারানো message-গুলো আনে, এবং কোনো message দুইবার দেখায় না।
  • অন্য user-রা নতুন message post করার সময় history-তে পেছনে scroll করুন। দেখুন, কোনো page একটি message বাদ দেয় না বা আবার দেখায় না।
  • অনেকগুলো test client একসাথে disconnect করুন, তারপর সবগুলো একসাথে আবার connect করুন। Server এবং start-up time কেমন আচরণ করে, তা মাপুন।
  • আলাদা region-এর client-দের মধ্যে message পাঠানো থেকে দেখানো পর্যন্ত delay মাপুন, এবং এর জন্য একটি target ঠিক করুন।
  • Channel-এর edge case test করুন: একটি খালি channel, member limit-এ থাকা একটি channel, এবং message পৌঁছানোর মাঝপথে channel ছেড়ে যাওয়া একজন user।

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

  1. [1]
    Slack Architecture

    The System Design Newsletter (Neo Kim) · accessed 2026-10-20দেখা হয়েছে: 2026-10-20

  2. [2]
    Real-time Messaging

    Engineering at Slack · accessed 2026-10-20দেখা হয়েছে: 2026-10-20