Databases · Senior · Question 26 of 75
How can you generate unique IDs across shards without a central sequence?
- 1Use the row count as an ID
- ✓Correct answer: Time-ordered unique IDs like UUID v7 or Snowflake-style IDs (timestamp + node ID + counter)
- 3Use
SERIALon each shard
Explanation
Per-shard sequences collide across shards. Time-ordered IDs stay roughly sortable and index-friendly.