You have to pick a database in the first five minutes of a design round. Which three questions decide it?
Database selection in a design round rests on three questions: what the hot path reads and writes, by which key; which facts must never be wrong; and how much data and traffic arrive at peak, derived as numbers. Then commit to one store in a sentence, with the reason and the fact that would change it.
Answer
Short answer
Ask three questions in a fixed order. First, what does the hot path read and write, and by which key? Second, which facts must never be wrong? Third, how much data and traffic arrive at peak? Then commit to one store in a single sentence, give the reason, and name the fact that would change your mind. Database selection is scored on that reasoning trail, not on the product you name.
Was this answer helpful?
Likely follow-ups
- The interviewer says writes will grow a hundredfold next year. Which of your three answers changes, and does the store?
- You chose a relational database. Where in your design would a second store appear first, and why there?
- Two of your three answers point at different stores. How do you break the tie in the time you have?
- Your estimate assumed a peak of five times the average. What would make that assumption wrong for this product?
Related questions
- How do you choose between a document store, a key-value store, a wide-column store and a graph database for a new service?hardAlso on access-patterns and database-selection5 min
- You have been asking clarifying questions for eleven minutes and have not drawn anything. When did that stop helping you?mediumAlso on system-design-interview5 min
- How do you handle cache invalidation, and what goes wrong at scale?hardAlso on consistency5 min
- Events for a daily revenue table arrive up to three days late. How do you design the pipeline and the backfill?hardSame kind of round: design4 min