WhatsApp System Design

Delete for Everyone

3 min read

Delete for Everyone is one of the most misunderstood features.

Many people think WhatsApp somehow reaches into everyone's phone and removes the message.

The actual architecture is much simpler.


Step 1

Alice sends a message.

Every message already has a unique identifier.

Example

msg_A7F3D91

Step 2

Alice taps

Delete for Everyone.

Instead of sending the entire message,

the client only sends

DELETE

Message ID = msg_A7F3D91

Step 3

The server validates

  • Is Alice the original sender?

  • Is the delete window still valid?

  • Does the message exist?

If validation succeeds,

the server creates a Delete Event.


Step 4

Notice something important.

The server never needs the original message again.

Only the Message ID.


Offline Users

Suppose Bob is offline.

No problem.

The Delete Event is temporarily stored.

As soon as Bob reconnects,

the Delete Event is delivered.


Why Message IDs Matter

Every future operation depends on Message IDs.

  • Delete

  • Edit

  • Read Receipts

  • Reactions

  • Replies

Without Message IDs,

all of these operations become much more complicated.


Interview Notes

Interviewer

Why doesn't WhatsApp resend the entire message while deleting?

Answer

Because every message already has a unique identifier.

The Delete Event only references that ID.


Key Takeaways

✔ Delete operations use Message IDs.

✔ The server validates before deleting.

✔ Offline users receive Delete Events later.

✔ Delete is another lightweight event.