When you start a design, how do you decide between a relational database and a NoSQL store, and how does that choice flow from the data model and access patterns rather than the other way around?

system-design · Staff-principal level · software-engineering

What the interviewer is really asking

Tests data-modeling maturity — that the candidate models around access patterns and consistency/transaction needs, picks the store to fit them (including 'relational is fine'), and resists cargo-culting NoSQL for scale it doesn't need.

What to say

What to avoid

Example answers

Strong: I model the access patterns before I name a database: what are the exact queries, the read:write ratio, and do I need transactions across entities. If the domain has rich relationships and ad-hoc querying — and especially if it needs ACID, like payments — I default to Postgres, because relational scales much further than its reputation and the query flexibility is worth a lot early on when patterns are still changing.

Weak: I'd use a NoSQL database like MongoDB because it scales horizontally and doesn't need a fixed schema, which is more flexible as the product grows.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.