TEAM LAKSHYA WhatsApp Architecture Project

Simple. Secure.
Reliable Messaging.

Connecting billions of users with Erlang, Mnesia, and FreeBSD. Discover the backend architecture behind the world's most popular chat app.

Live Architecture Simulator

Send a message to see how it travels through the server stack.

Voice Loading...
A
Alice
Online
WHATSAPP_SERVER_CLUSTER ● ACTIVE

Gateway (Ejabberd)

Auth & Encryption

Mnesia DB

Routing Table (RAM)

Cassandra

Message Archive

> Server Cluster Initialized...
B
Bob
Receiver

The Message Journey

Sender

Signal Protocol
Encryption

Gateway

Authentication
& Decryption

Mnesia

Checks User
Status (Online?)

Receiver

Decryption &
Display

Business & Security

How WhatsApp works as a business and keeps you safe.

How to Earn Money?

  • WhatsApp Business API: Charging large enterprises (Banks, Airlines) to send automated notifications and customer support messages.
  • Click-to-WhatsApp Ads: Ads on Facebook and Instagram that open a chat directly in WhatsApp. Businesses pay for these leads.
  • WhatsApp Pay: Transaction fees on peer-to-peer or peer-to-merchant payments in specific regions (e.g., India, Brazil).

Is it Safe?

  • End-to-End Encryption: Powered by the Signal Protocol. Only you and the recipient have the "keys" to unlock messages. Not even WhatsApp can read them.
  • No Server Storage: Messages are deleted from the server immediately after delivery. They only exist on the users' devices.
  • Forward Secrecy: Each message has a unique key. Even if a hacker steals a key, they can only read one message, not the whole chat.

Core Features

Voice & Video Calls

Uses VoIP (Voice over IP). While text uses TCP for reliability, calls use UDP (User Datagram Protocol) for speed, prioritizing real-time delivery over perfect quality.

Status Updates

Ephemeral data stored in Cassandra with a TTL (Time-To-Live) of 24 hours. After that, the database automatically deletes the entry.

Communities

Handling groups of 1000+ users requires efficient "fan-out". Erlang sends a single message to the server, which then duplicates it for every member efficiently.

The Tech Stack

Erlang

The language of telecoms. Designed for massive concurrency and fault tolerance.

Mnesia

A distributed, soft real-time database written in Erlang. Extremely fast routing.

FreeBSD

The OS powering the servers. Known for its advanced networking stack.

YAWS

"Yet Another Web Server". A high-performance web server for Erlang.