ప్రతి vote ను నేరుగా ఒక database row కి వ్రాయవద్దు — writes ను buffer చేయండి, counters ను shard చేయండి, మరియు eventual tally ను అంగీకరించండి. 10 నిమిషాల్లో 5M votes అంటే సగటున ~8,300 votes/sec, spikes చాలా ఎక్కువ (ఒక live TV moment దానిని 10x చేయవచ్చు). ఉపాయం ఏమిటంటే ఒక hot single-row update ను అనేక స్వతంత్ర, parallel increments గా మార్చడం.
Client ─▶ Edge/API ─▶ Kafka (vote events) ─▶ Consumers ─┬─▶ Dedup store (SET one-vote)
(durable buffer) └─▶ Sharded counters (INCR N shards)
│
Redis/Aggregator ◀── periodic sum of shards ──────────────────────┘
│
└─▶ Read replica / CDN cache ─▶ Live tally to clients
