Social Network: Election Night
Hard · system design problem
Results night: three times the readers, five times the posts, half of all timeline reads on two candidates, and the push provider slows down. Fan-out, hot keys, search and notifications all at once.
Readers load timelines from feed-svc (autoscaling, two minutes to boot), which reads them from Redis (4 nodes) over Cassandra and queries Elasticsearch (one replica shard) for trending results on 40% of loads. New posts go through post-api into Kafka (12 partitions); fan-out workers write them into followers’ timelines and send push notifications for 30% of them. At T+20s the results start coming in: readers ×3 and posts ×5 for the rest of the night, and half of timeline reads are for the two candidates’ timelines. At T+60s the push provider degrades. Posts must reach timelines within two minutes; notifications are nice to have.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.