I'm using a similar example to mask the details of my domain. My system is similar to Quora's where a user can post questions. I have a profile view of the user which lists ALL QUESTIONS BY THIS USER. If I shard my database by userId, then if a user suddenly becomes very popular it would create a hot partition because many users would want to view their profile. On the other hand, if I shard by questionId, getting all questions by a user would require joining across shards. I know this is a classic question, so if you can link me to the right source or answer it directly, that'd be great. I have watched Youtube videos and searched on Google. I get a lot of academically rich and theoretical answers there but I want to hear from someone who has solved this in real life for a large scale system that handles high read/write traffic. Thanks!
I have watched Youtube videos and searched on Google. I get a lot of academically rich and theoretical answers there but I want to hear from someone who has solved this in real life for a large scale system that handles high read/write traffic.