One popular counter can become one hot key#
views = views + 1 concentrates millions of writes. If one store's atomic counter meets load and correctness requirements, keep it simple. Otherwise distribute increments across shards or local aggregators and combine them later.
Sharded video views
displayed views = SUM(100 counter shards)Writes spread, but reads aggregate more keys and displayed values may lag. Batch local increments to reduce write traffic at the cost of freshness and potential loss unless buffering is durable.
| Exact requirement | Approximation may fit |
|---|---|
| Bank balance, inventory invariant | Video views, social metrics, analytics |
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Probabilistic data typesRedis Documentation