← All comparisons

WhatsApp vs URL Shortener

WhatsApp

WhatsApp

Persistent connections, message queues, delivery.

Components (8)

  • Sender
  • WS Gateway
  • Chat Service
  • Presence
  • Cassandra
  • Kafka
  • APNs / FCM
  • Recipient

Headline numbers

  • Messages / sec (avg)~1.2M/sec
  • Cassandra writes / sec~2.4M/sec
  • Storage / day~12 TB
URL Shortener

URL Shortener

Hashing, key generation, read-heavy caching.

Components (6)

  • Client
  • API Gateway
  • Write Service
  • Read Service
  • Redis
  • Postgres

Headline numbers

  • Write QPS (avg)~1,200/sec
  • Read QPS (avg)~120,000/sec
  • Storage per year~5 TB

Key differences

Only in WhatsApp
  • Kafka
  • APNs / FCM
In both
  • Client
  • Api Gateway
  • Service
  • Cache
  • Database
Only in URL Shortener
None.

Flow shape

WhatsApp flows
  • Send message (recipient online)6 steps
  • Send message (recipient offline)7 steps
  • APNs / FCM is down7 steps
  • WS Gateway box dies3 steps
URL Shortener flows
  • Shorten a URL3 steps
  • Resolve short URL (cache hit)3 steps
  • Resolve short URL (cache miss)4 steps
  • Redis is down4 steps