← All comparisons

Search Engine vs URL Shortener

Search Engine (Google-style)

Search Engine (Google-style)

Web crawl, inverted index, scatter-gather query, ranking.

Components (10)

  • Browser
  • Query Frontend
  • Index Shard 1
  • Index Shard 2
  • Index Shard 3
  • Ranker
  • Doc Store
  • Crawler
  • Bloom Filter
  • Index Builder

Headline numbers

  • Query QPS (avg)~90K/sec
  • Per-shard QPS~9M/sec aggregate
  • Inverted index size~10s of PB
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 Search Engine
  • Index Shard 1
In both
  • Client
  • Api Gateway
  • Service
  • Database
  • Cache
Only in URL Shortener
None.

Flow shape

Search Engine flows
  • Run a query5 steps
  • Crawl + index a new page4 steps
  • One index shard is down4 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