All Questions
Consistent Hashing medium

Which of these is a BAD choice for a Partition Key for a multi-tenant SaaS app?

  1. A The `TenantID`, if one tenant is significantly larger than others (the 'Whale' problem), as it creates an un-splittable hot shard.
  2. B The `UserID`, as it provides a naturally high cardinality that ensures keys are distributed evenly across all cluster members.
  3. C A composite key like `TenantID + UserID`, which allows for fine-grained sharding even for extremely large enterprise tenants.
  4. D A standard UUID v4, which offers guaranteed uniform distribution across the entire hash ring address space.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions