Databases & Transactions interview question · Most asked

How do you choose between SQL and NoSQL databases?

Summary

Choose relational (PostgreSQL, MySQL) for structured data with relationships, transactions and flexible querying; choose NoSQL for specific access patterns: document stores (MongoDB) for flexible nested documents, key-value/wide-column (DynamoDB, Cassandra) for massive scale with known queries, graph databases for relationship traversal, and search engines for full-text search.

Longer Answer

Start from access patterns, consistency needs, scale and team expertise. Postgres covers many 'NoSQL' needs (JSONB, full-text search, extensions). Polyglot persistence is common: a relational source of truth plus Redis, a search index and an analytics store.

Key Points

  • Relational: transactions + flexible queries
  • Document: flexible nested data
  • KV/wide-column: scale with known access
  • Start from access patterns
  • Polyglot persistence

More most-asked Databases & Transactions questions

← All Databases & Transactions questions