Distributed counter store

DesignHard40 minMeta and Google style

Your task

Design a distributed counter store for a global product that tracks per-object metrics (video views, post upvotes, ad impressions) where a few objects receive 500k increments/sec while millions of objects receive a handful, and the same counter is incremented from multiple regions concurrently. Reads tolerate a few seconds of staleness; increments must never be lost and must converge to the correct total. A single row per counter is a write hotspot that will melt one shard. Design the increment and read paths.

It covers

  • Crdt
  • Write hotspot
  • Sharded counters