WhatsApp — Send Message Pipeline
system-design simulator · networking · queues · delivery
Why this design works
A messaging pipeline like WhatsApp's is built around one core idea: the sender should never wait on the recipient. A chat server accepts the message over a persistent WebSocket, persists it durably, and ACKs the sender immediately — everything downstream (finding the recipient, delivering it, retrying if needed) happens asynchronously via Kafka.
A Redis presence cache answers "is this user online, and on which server?" in sub-millisecond time, so the notification service can decide instantly between a live-socket delivery or a push notification through APNs/FCM. When a chat server crashes mid-write, the client detects the dropped socket, reconnects through the load balancer to a healthy node, and safely retries with the same message ID — the database dedupes on that ID, so the message is never delivered twice. Click any node above to see its exact responsibilities and the real systems that play that role in production.