Sitemap
Production Ready

Production Ready: backend engineering that survives production — Spring Boot, data, distributed systems, JVM tuning, and AI in prod, with runnable code and honest tradeoffs.

Design a Chat App for Millions of Users (Interview-Ready, With Code)

9 min read6 days ago

--

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

Press enter or click to view image in full size

“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

Press enter or click to view image in full size

Before diving into code, let’s establish what we’re building:

--

--

Java · Spring Boot · Microservices · AI. Technical Architect with 17 years of enterprise experience. Writing what I wish I had when I started.

Production Ready
Production Ready

Published in Production Ready

Production Ready: backend engineering that survives production — Spring Boot, data, distributed systems, JVM tuning, and AI in prod, with runnable code and honest tradeoffs.