Skip to content
System Design Explorer

Comparison

WhatsApp vs Slack/Discord-style Chat: Architecture Compared

By Ankur NayakReviewed

Both deliver messages to people in real time over persistent connections, yet they are built on opposite assumptions. WhatsApp treats its servers as a relay for end-to-end encrypted messages that disappear once delivered. Slack- and Discord-style chat treats the server as the permanent home of every conversation.

That single choice, where history lives, ripples through storage, encryption, multi-device support, group delivery and search. This page puts the two designs side by side so you can see exactly where they diverge and why.

WhatsApp

Full design
WhatsApp architecture diagramComponents: Sender's Phone, Recipient's Devices, Load Balancer, Chat Servers (Erlang / FreeBSD), Session Routing (Mnesia (partitioned)), Offline Message Store, Key Distribution, Group Service, Media Store. Connections: Sender's Phone to Load Balancer; Load Balancer to Chat Servers; Sender's Phone to Key Distribution (fetch device keys); Chat Servers to Session Routing (where is the recipient?); Chat Servers to Recipient's Devices (ciphertext); Chat Servers to Offline Message Store (store until delivered); Chat Servers to Group Service (group message); Sender's Phone to Media Store (encrypted upload); Recipient's Devices to Media Store (encrypted download).Sender's PhoneClientRecipient's DevicesClientLoad BalancerLoad balancerChat ServersErlang / FreeBSDSession RoutingMnesia (partitioned)Offline Message StoreNoSQL databaseKey DistributionAuthGroup ServiceServiceMedia StoreObject storage

Chat System

Full design
Chat System architecture diagramComponents: Desktop / Mobile App, Edge Load Balancer (L4 / TLS), WebSocket Gateway, Chat Service, Channel Servers, Session & Presence (In-memory / Redis), Message Store (ScyllaDB / Cassandra). Connections: Desktop / Mobile App to Edge Load Balancer; Edge Load Balancer to WebSocket Gateway; WebSocket Gateway to Chat Service (send); Chat Service to Message Store (append); Chat Service to Channel Servers (publish); Channel Servers to Session & Presence (online members); Channel Servers to WebSocket Gateway (deliver); WebSocket Gateway to Session & Presence (register / heartbeat).Desktop / Mobile AppClientEdge Load BalancerL4 / TLSWebSocket GatewayRealtime gatewayChat ServiceServiceChannel ServersServiceSession & PresenceIn-memory / RedisMessage StoreScyllaDB / Cassandra

Side by side

WhatsApp compared with Chat System
DimensionWhatsAppChat System
Where history livesOn users' devices; the server keeps encrypted messages only until they are deliveredOn the server, forever, in a store partitioned by channel and time
EncryptionEnd-to-end (Signal protocol), encrypted separately for every recipient deviceEncrypted in transit and at rest; the service can read content to index and moderate it
Multi-deviceClient fan-out: the sender encrypts once per device; up to 4 companions per phoneAny device loads history from the server after signing in
Group deliverySender Keys: one ciphertext per message, fanned out by the serverA channel server owns each channel and pushes to every gateway with members online
Main datastoreA small offline queue, emptied on deliveryA wide-column store holding trillions of messages (Discord: 72 ScyllaDB nodes in 2023)
SearchOnly on the deviceServer-side full-text index
Connection tierErlang on FreeBSD; 2M+ connections per server reported in 2012Stateful WebSocket gateways plus channel servers mapped with consistent hashing

Verdict

Choose the WhatsApp model when privacy is the product and history can live on devices: the server stays small and blind. Choose the Slack/Discord model when shared, searchable, permanent history across devices is the product, and accept a large storage tier and server-side access to content.

Frequently asked questions

Why can't WhatsApp offer server-side search like Slack?

Because messages are end-to-end encrypted and deleted from the server after delivery, the server never has readable content to index. Search has to run on the device over its local history.

Which design is harder to scale?

They are hard in different places. WhatsApp's challenge is concurrency per server and per-device encryption; a Slack/Discord-style system must also store and serve trillions of messages, which is why Discord invested in partitioning by channel and time bucket and in request coalescing for hot channels.

More comparisons