Skip to content
RED SAGSkills
easyBackend Developer interview question

When would you choose a SQL database and when a NoSQL database?

What the interviewer wants to hear

  • SQL suits structured, related data and needs strong consistency and transactions
  • NoSQL suits flexible schemas, very high write scale or specific access patterns
  • Different NoSQL types: document, key-value, wide-column, graph
  • Choice depends on query patterns and consistency needs, not hype

Model answer

I start from the data and the queries. If the data is structured and related, like users, orders and payments, and I need joins and ACID transactions, a relational database like PostgreSQL is usually the best default. It also handles JSON columns well, so it covers many semi-structured cases. I would pick NoSQL when the access pattern fits it better: a document store like MongoDB for flexible, nested records read as a whole; a key-value store like Redis for caching and sessions; a wide-column store like Cassandra or DynamoDB for huge write volumes with known key-based queries; or a graph database for relationship-heavy queries. NoSQL often trades joins and strict consistency for easier horizontal scaling. Many real systems use both, for example PostgreSQL as the source of truth and Redis as a cache.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Backend Developer questions