Reqflow
← All comparisons

Ad Click Aggregation vs URL Shortener

Ad Click Aggregation

Ad Click Aggregation

High-volume event ingestion, exactly-once stream aggregation, time-windowed counts, lambda vs kappa architecture.

Components (8)

  • Ad Servers
  • Ingest API
  • Click Stream (Kafka)
  • Stream Processor (Flink)
  • Batch Processor (Spark)
  • Real-Time Store
  • Data Warehouse
  • Fraud Detector

Headline numbers

  • Ingest bandwidth~50 MB/sec
  • Raw event storage (30 days)~130 TB
  • Flink state size~10 GB
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 Ad Click Aggregation
  • Click Stream (Kafka)
In both
  • Client
  • Api Gateway
  • Service
  • Database
Only in URL Shortener
  • Redis

Flow shape

Ad Click Aggregation flows
  • A click is ingested and counted4 steps
  • Hourly batch reconciliation2 steps
  • Flink worker crashes mid-window3 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