Member-only story
Design a Chat App for Millions of Users (Interview-Ready, With Code)
Design a real-time chat system that handles millions of concurrent messages using WebSocket for real-time delivery, Kafka for fan-out, and Redis for presence tracking
“Design a chat app” is the interview question that quietly separates the candidates who’ve built real systems from the ones who’ve only read about them. It sounds trivial — messages in, messages out — until the interviewer asks about millions of simultaneous connections, guaranteed message ordering, and what happens when a server dies mid-conversation. Suddenly the whiteboard gets very quiet.
I’ve built real-time messaging systems in production over the past 17 years, and the gap between whiteboard answers and production-grade implementations is enormous. In this post, I’ll walk you through designing a chat system that actually works at scale — with Spring Boot code you can run.
The High-Level Architecture
Before diving into code, let’s establish what we’re building:









