How WhatsApp Scaled to 450 M Daily Users with Only 32 Engineers

This article outlines Jan Koum's WhatsApp journey and the eight engineering principles—single responsibility, Erlang stack, reuse of open source, cross‑cutting concerns, diagonal scaling, continuous feedback, load testing, and a small team—that enabled massive scalability with a tiny engineering group.

dbaplus Community
dbaplus Community
dbaplus Community
How WhatsApp Scaled to 450 M Daily Users with Only 32 Engineers

Single Responsibility Principle

WhatsApp limited its product to the core messaging function, deliberately avoiding ad networks, social features, and other non‑essential components. This focus prevented feature creep and helped maintain high reliability.

Single Responsibility Principle
Single Responsibility Principle

Technology Stack

The server core was built in Erlang and deployed on FreeBSD . Erlang was chosen for its small binary size, lightweight processes, cheap context switches, and built‑in hot code loading, which enables code updates without restarting services.

Erlang Advantages

Small footprint and high scalability

Native lightweight processes (no OS thread overhead)

Hot code loading for zero‑downtime deployments

FreeBSD provided a reliable network stack and was tuned (kernel parameters, file‑descriptor limits, socket buffer sizes) to support more than two million concurrent connections per server.

Erlang Technology Stack
Erlang Technology Stack

Avoid Reinventing the Wheel

WhatsApp built on the open‑source XMPP server ejabberd (written in Erlang) rather than creating a messaging server from scratch. Select core components of ejabberd were rewritten to meet specific requirements, and third‑party services such as Google Push were used for push notifications.

Don't Reinvent the Wheel
Don't Reinvent the Wheel

Cross‑cutting Concerns

The team emphasized system‑wide concerns such as monitoring, health‑checking, and alerting. Continuous integration (CI) merged code changes regularly into a central repository, while continuous delivery (CD) automated deployment to test and production environments.

Cross‑cutting Concerns
Cross‑cutting Concerns

Scalability Strategies

WhatsApp employed diagonal scaling , a combination of horizontal scaling (adding more machines) and vertical scaling (adding CPU/memory to existing machines). This reduced cost and operational complexity.

Key scaling actions included:

Over‑provisioning each server to absorb traffic spikes and tolerate hardware or network failures.

Adjusting FreeBSD kernel parameters, e.g.,

sysctl -w kern.maxfiles=2000000
sysctl -w kern.maxfilesperproc=2000000
ulimit -n 2000000

to raise file‑descriptor and socket limits.

Running on FreeBSD for its stable TCP/IP stack and familiarity within the engineering team.

Scalability Diagram
Scalability Diagram

Flywheel Effect

Performance metrics such as CPU utilization, context‑switch rate, and system‑call count were measured continuously. Identified bottlenecks were eliminated in short feedback cycles, creating a self‑reinforcing performance improvement loop.

Continuous Feedback Loop
Continuous Feedback Loop

Quality Testing

Load testing was used to discover single points of failure. The process generated artificial traffic and performed DNS configuration changes to simulate real‑world load patterns. Results guided capacity planning and redundancy improvements.

Load Testing
Load Testing

Team Size Management

To keep communication overhead low, WhatsApp capped its engineering staff at 32 engineers. Communication paths grow quadratically with team size, so a small, tightly‑coordinated team preserved productivity.

Engineer Communication Paths
Engineer Communication Paths
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend EngineeringLoad TestingErlangWhatsApp
dbaplus Community
Written by

dbaplus Community

Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.