This approach has a couple of issues:
- What if a user becomes hot? There could be a lot of queries on the server holding the user. This high load will affect the performance of our service.
- Over time some users can end up storing a lot of tweets or having a lot of follows compared to others. Maintaining a uniform distribution of growing user data is quite difficult.
To recover from these situations either we have to repartition/redistribute our data or use consistent hashing.
How would consistent hashing solve above? With consistent hashing, each user still gets mapped to the same server. As a result, hot users will still causes certain servers to be loaded.