Hash-based: Hash the shard key (e.g., user_id). shard = hash(user_id) % num_shards. Even distribution.
Range-based: User IDs -M in shard , M-M in shard . Easy to add shards but can create hotspots.
Geographic: US users in US shard, EU users in EU shard. Reduces latency for local users.
Directory-based: A lookup table maps each key to its shard. Most flexible but adds a lookup step.
Hash-based is the default choice. Use geographic when users are concentrated by region.