Hot spots occur when one shard receives disproportionate traffic:
Detection methods:
- Monitor QPS per shard (should be roughly equal)
- Track latency percentiles per shard
- Measure disk I/O and CPU per shard
Common causes:
- Celebrity users (millions of followers)
- Viral content
- Poor shard key choice
- Time-based keys without distribution
Solutions:
- Add salt to hot keys: user_123_shard1, user_123_shard2
- Cache hot data aggressively
- Split hot shards
- Use dedicated shards for known hot keys