Sharding · Multiple choice

A document app stores pages as blocks. Most requests load many blocks of one workspace. Which partition key fits?

medium

Options

Why

With workspace_id, a workspace's blocks live on one shard, so a request touches one database and can use a transaction there. block_id scatters a page over all shards, created_at makes the newest shard hot, and the creator's id splits shared pages.

Review this in your daily deck All cards in Sharding