As of early 2025, WhatsApp reportedly handles 100 billion messages per
day.This figure includes text messages, media, and voice/video calls.
History
In January 2008, Jan Koum, who worked at Yahoo, tried to get a job at
Facebook but didn’t make it. Instead of giving up, he kept going. The next
year, he got an iPhone and saw how powerful the new App Store could be. This
gave him an idea. Along with some old friends from Yahoo, he created
WhatsApp, a simple app to send messages without the heavy costs of SMS.
WhatsApp became super popular, with a million people signing up every single
day!
Tech Stack:
-
WhatsApp uses Erlang> for its core servers because it's built for
high scalability with a tiny footprint.
-
Erlang supports hot-loading, allowing code updates without
restarting servers or redirecting traffic, ensuring nearly 100% uptime.
-
Unlike Java or C++, Erlang’s threads are lightweight and managed by the
language itself, making context switching much cheaper and efficient.
-
Operating System: WhatsApp runs on FreeBSD servers, chosen for
stability and performance.
-
Message Protocol: Uses a customized, lightweight version of XMPP optimized
for instant delivery and low latency.
-
Databases: Distributed Erlang-based databases (like Mnesia) store messages
reliably with replication and sharding for scalability.
-
Infrastructure: Initially hosted on SoftLayer, now on Facebook’s data
centers for better scalability.
-
Security: Employs end-to-end encryption to keep user messages private.
-
Cross cutting concerns : They focus on this aread more, Cross-cutting
concerns are things that affect many parts of a product. And are hard to
separate. e.g Security, Logging, Alerting, Performance,
Exception_handling, Monitoring
Don’t reinvent the wheel everytime:
Ejabberd is an open-source real-time messaging server written in
Erlang. And they built WhatsApp on top of ejabberd. Also they rewrote some
of the ejabberd core components to meet their needs.
Besides WhatsApp leveraged third-party services such as
Google Push to provide push notifications.
Scalability
-
WhatsApp used diagonal scaling to keep the costs and operational
complexity low.
-
Diagonal scaling is a hybrid of horizontal and vertical scaling. The
computing resources get added both vertically and horizontally.
-
They ran WhatsApp servers on the FreeBSD operating system.
Because they had previous experience with FreeBSD while working at Yahoo.
- Besides FreeBSD offered a reliable network stack.
-
They fine-tuned FreeBSD to accommodate 2 million+ connections per server.
And modified kernel parameters such as files and sockets.
-
They overprovisioned servers to handle sudden traffic spikes and keep
headroom for failures. For example, failures such as network partitions or
hardware faults.
They kept the team size small - 32 engineers.
WhatsApp is one of the most successful instant messengers in the market. In
2014, Facebook acquired WhatsApp for a whopping 19 billion USD. According to
Forbes, Jan Koum has a net worth of 14 billion USD in 2023.
This lean yet powerful technology stack lets WhatsApp handle billions of
messages daily with great speed, reliability, and uptime.