TAO uses consistent hashing within a tier, and a shard can still become a hot spot.
Sharding is on the source ID. A user with too many followers, such as Brad Pitt or Mark Zuckerberg, brings all of that load to one shard.
- Shard cloning. A hot shard is cloned to rebalance load, so reads to it are served by multiple followers in the tier. Update messages are sent to all the followers hosting the shard.
- Client caching. A client of TAO is a service that uses it as a database, such as a friends service. The service talks to TAO through a library, and the library caches very hot data.
Some lists are very long. Brad Pitt has liked a lot of posts and DiCaprio's post has a lot of likes, so the query is expensive from either side. When the edge and the inverse edge both cross a threshold, TAO queries MySQL.
Such a list is not cached, because a few of them fill the cache.