System Design · Senior · Question 3 of 75

Why is choosing "creation date" as a sharding key dangerous?

Explanation

Sharding distributes data across nodes; the key must spread the load evenly and match the queries. A monotonic key concentrates writes in the last shard. A hash of the user id or a composite key is often used.

Further reading

Problem with a question

System Design · Senior · question 3

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz