Hot shards and lists too long to cache

video locked
Enroll to watch

5 mins

Chapters
About
Discussion0
Notes
Be the first to start a conversation!

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.

  1. 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.
  2. 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.