Techies Journal
AboutContact

Techies Journal

A collection of technical essays on systems, backend architecture, and the craft of engineering.

Sections

  • Technology
  • System Design
  • Backend Engineering
  • Cloud & DevOps
  • AI & ML

Connect

  • About Me
  • Contact

Presence

© 2026 Techies Journal. Handcrafted for readability.

PrivacyTerms
System Architecture
2026-01-28

When You Send 'Hi' in a WhatsApp Group of 256 People — Does the Database Get Hit 256 Times?

RU
Rishabh UpadhyaySoftware Engineer & Designer

How WhatsApp Handles Group Messages at Scale

Ever wondered what actually happens when you send "Hi" in a WhatsApp group with 256 people?

Did the database just get hit 256 times?

Short answer: No. Smart systems don't work that way.

Let's break down why — and what really happens under the hood


Why 256 Database Writes Would Be a Disaster

Imagine a chat system that stores the same message once per user.

That design would immediately run into serious problems:

  • Every new group member multiplies database load
  • Storage grows linearly with group size
  • High-traffic groups become slow and expensive
  • Write amplification kills performance

At WhatsApp scale, this approach simply doesn't survive.

So large chat systems follow a different rule:

** Persist data once. Distribute via the network. Track user state later.**


The Core Design Principle

Chat systems separate responsibilities:

| Layer | Responsibility | |-------|----------------| | Databases | Durability and long-term storage | | Networks | Real-time distribution | | User state | Tracked independently |

This separation is what makes massive scale possible.


What Actually Happens When You Send a Message

Let's break the flow down step by step.


Message Storage (Once, Not 256 Times)

When you send a message:

  • The message is stored once
  • It's linked to the group ID
  • It is not copied per user

Think of it as:

Code
message_id → group_id → content

This keeps database writes minimal and predictable.


Message Delivery (Network, Not Database)

For users who are online:

  • The server pushes the message over persistent connections
  • Typically using WebSockets or similar protocols
  • No additional database writes happen here

This is fast, cheap, and scalable.


Offline Users (Queues, Not Rewrites)

If some users are offline:

  • The message waits in a delivery queue
  • When the user reconnects, the message is delivered
  • The original message record is reused

Still:

  • One message
  • Many deliveries
  • Zero duplication

Read & Delivery Receipts (Tracked Separately)

Read receipts and delivery status are user-specific — but they're handled carefully.

  • Stored asynchronously
  • Updated independently of message sending
  • Never block the send path

This keeps the critical path fast even in large groups.


Visualizing the Flow

Code
User sends message
  ↓
 Message stored once (group-level)
  ↓
 Push to online users (network layer)
  ↓
 Queue for offline users
  ↓
 Async updates for read/delivery state

Why This Design Scales

This approach allows chat systems to:

  • Handle billions of messages per day
  • Keep latency low even in large groups
  • Avoid database bottlenecks
  • Scale horizontally without pain

The database stays calm. The network does the heavy lifting.


The System Design Takeaway

Here's the key lesson:

** Databases are for durability. Networks are for distribution.**

Mixing these responsibilities leads to slow, fragile systems.

Separating them is what allows modern chat platforms to scale globally.


Final Thought

If sending one message triggered hundreds of database writes, real-time chat at global scale wouldn't exist.

The fact that it does exist is a result of:

  • Careful responsibility separation
  • Asynchronous design
  • Network-first thinking

Simple ideas — executed correctly — scale better than clever hacks.


What to Explore Next

Want to dive deeper into related topics?

  • Message ordering & consistency guarantees
  • WhatsApp-style architecture diagrams
  • Comparing naive vs production chat systems
  • Handling message deletion at scale
Continue Reading
2026-01-29

Microservices Didn't Make Us Faster — They Made Us Slower

Microservices promised speed and scalability, but for many teams they increased complexity, latency, and cost. Here's why modular monoliths are making a comeback.

2026-02-03

Why Netflix Shows a Black Screen When You Try to Screen Record

A deep technical breakdown of DRM, secure video pipelines, OS-level hooks, and hardware protections that prevent Netflix screen capture.

2026-02-11

How Food Delivery Apps Show Live Driver Location Without Refresh

A system-design deep dive into real-time location tracking in apps like Zomato—from driver GPS capture and pub/sub to WebSockets, interpolation, reliability, and privacy.

On This Page

  • How WhatsApp Handles Group Messages at Scale
  • Why 256 Database Writes Would Be a Disaster
  • The Core Design Principle
  • What Actually Happens When You Send a Message
  • Message Storage (Once, Not 256 Times)
  • Message Delivery (Network, Not Database)
  • Offline Users (Queues, Not Rewrites)
  • Read & Delivery Receipts (Tracked Separately)
  • Visualizing the Flow
  • Why This Design Scales
  • The System Design Takeaway
  • Final Thought
  • What to Explore Next

Share Perspective

TwitterLinkedInInstagram