Compound Shard Keys

← Back to Choosing a Shard Key

Combine multiple fields as the shard key (e.g., tenant_id + user_id) for multi-tenant systems. Provides better distribution and natural data colocation.


sharding shard-key compound