NoSQL · Data models beyond tables
How do you choose between NoSQL and a relational database?
Short answer
Choose based on access patterns, consistency needs, scale and operational constraints, not fashion. Relational databases excel at ad hoc queries and integrity; NoSQL often wins on known access patterns and horizontal scale.
Relational databases give you a declarative query language, joins, constraints and transactions across many rows. NoSQL systems often give you a simpler scaling story and a storage layout tuned to one access path, at the cost of flexibility and sometimes consistency.
SELECT o.id, o.total, c.name
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE c.region = 'EU'
ORDER BY o.created_at DESC
LIMIT 20;{
"pk": "CUSTOMER#7",
"sk": "ORDER#2026-10-01#1042",
"total": 1798,
"customerName": "Asha",
"region": "EU"
}Questions that decide it
- Do the query shapes change often, or are they known and stable?
- Do you need multi-row transactions and foreign-key-style integrity?
- Is the bottleneck write throughput, data volume, or complex reporting?
- Can the team operate a distributed system, including rebalancing and repair?
- Does the vendor or managed service cover backup, failover and compliance?
The strongest answer avoids a binary choice. A common production pattern is a relational system of record plus a NoSQL cache or read model. The trade-off is synchronization, so the team must own the pipeline and its failure modes.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What integrity guarantees do you lose with NoSQL?
- 2Would you ever run both a SQL and a NoSQL database?
- 3How do changing query requirements affect the choice?
- 4What does access pattern first mean here?
Say it in the interview
I choose based on the workload rather than the label. Relational databases are strong when queries change often, relationships matter and I need multi-row transactions. NoSQL is strong when access patterns are known, data groups naturally by key and I need to scale writes horizontally. I also weigh operations, because running a distributed store is real work. Often the right answer is a relational system of record with a NoSQL read model or cache beside it.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live NoSQL mock interview and get scored feedback on depth, clarity and confidence.