Saturday, March 7, 2026

System Design : Ad Click Aggregator

https://www.youtube.com/watch?v=6TroztUV3f8&list=PLjTveVh7FakLGZ36GbWAk_DMf_0xBZpGv&index=4

https://docs.google.com/presentation/d/1sx1oxYRYNwvhEoPM7LqgXPWaZI5kv64-139hNdLpwB4/edit?slide=id.g3707c69fac3_0_10#slide=id.g3707c69fac3_0_10

Requirement : Functional

  • Every Click of each advertisement should be counted
  • We should be able to run arbitrary analytical queries on the data

Requirement : Functional

  • Secure
  • Data Privacy Compliance
  • Call Volumes
  • High Availability
  • Low Latency : query should be returned as fast as possible
    • time series granularty of 1 min
  • FAST : Data should be available withing a few seconds of click

High level










  • since APIs are stateless , round robin load balancer can be used
  • check duplicate for malicous users
  • batch data as parquet files and push in data warehouse












its not a good choice to use dynamo DB instead of kafka , may not be able to support write throughput

Kafka has log based writes , so it always appends data , hence disk moves sequentially not randomly






















Kafka one partition can easily do 50k writes per second per partition




Data / Entity Object diag ( he did not do it ) 

  • linkClicked(String ad-unique-id, String user-id, timestamp)  


Block Diagram



No comments: