Sharding & Partitioning
Shard by user id
A messaging product stores billions of rows. Every query is “messages for user U” or “send as user U.” One Postgres primary is maxed on disk and writes. How do you shard, what is the partition key, and how does one read route to a single shard?
Intermediate drill question.