Choosing a Database for Your Architecture: SQL, NoSQL and NewSQL

How to pick a database: relational vs document, key-value, wide-column, graph and search stores, NewSQL, polyglot persistence and questions to ask first.

Published November 27, 2026

The database is usually the hardest part of an architecture to change, so it deserves the most careful choice. Yet teams often pick one because it is trendy or because a tutorial used it. This guide maps database families to the problems they solve and gives a set of questions that point to the right default for your system.

The concept

Relational databases (PostgreSQL, MySQL, SQL Server) store data in tables with schemas, support joins and ACID transactions, and handle a remarkably wide range of workloads. Modern PostgreSQL also covers JSON documents, full-text search, geospatial queries and time series with extensions. For most business applications, a relational database is the right starting point.

NoSQL families trade some of that generality for specific strengths. Document stores (MongoDB, Firestore) store flexible JSON-like documents. Key-value stores (Redis, DynamoDB) give extremely fast lookups by key. Wide-column stores (Cassandra, ScyllaDB) handle massive write volumes partitioned by key. Graph databases (Neo4j) make relationship traversal natural. Search engines (Elasticsearch, OpenSearch) specialise in text relevance. NewSQL systems (CockroachDB, YugabyteDB, Spanner, TiDB) offer SQL and ACID transactions with horizontal scaling across nodes and regions.

Database families

FamilyExamplesGreat atWatch out for
RelationalPostgreSQL, MySQLTransactions, joins, constraints, ad-hoc queriesWrite scaling beyond one primary needs sharding
DocumentMongoDB, FirestoreFlexible nested records, developer speedCross-document transactions and joins are limited or costly
Key-valueRedis, DynamoDBSimple, very fast lookups at scaleQuery flexibility; model around access patterns
Wide-columnCassandra, ScyllaDBHuge write throughput, time series, chatNo joins; denormalise per query
GraphNeo4j, NeptuneDeep relationship queriesNot a general-purpose store
SearchElasticsearch, OpenSearchFull-text relevance, facetingNot a primary source of truth
NewSQLCockroachDB, Spanner, TiDBSQL + ACID with horizontal/multi-region scaleLatency of distributed transactions, cost

Questions to ask first

  1. What are the main access patterns (by key, by range, ad-hoc, full-text, graph)?
  2. Do you need multi-record ACID transactions?
  3. What are the write and read volumes, now and in 3 years?
  4. Single region or multi-region with local writes?
  5. What does the team know how to operate (or is managed service available)?
  6. Default to PostgreSQL unless a clear answer above says otherwise
Questions that narrow the choice quickly.

Polyglot persistence

ApplicationPolyglot persistenceright store per jobPostgreSQLorders, users, billingRediscache, sessions, rate limitsOpenSearchproduct searchS3files, exports
Most mature systems combine a primary store with specialised ones.

Keep one source of truth per piece of data

Polyglot persistence is powerful but every extra store adds operations, backups, monitoring and consistency questions. Keep a single source of truth for each type of data, and treat caches and search indexes as derived copies that can be rebuilt. Synchronise them with events or change-data-capture, not by writing to several stores in application code and hoping all writes succeed.

Practical examples

PostgreSQL doing document-style work

JSONB gives flexible attributes with indexing, inside a transactional database.

CREATE TABLE products (
  id bigserial PRIMARY KEY,
  name text NOT NULL,
  attrs jsonb NOT NULL DEFAULT '{}'
);
CREATE INDEX ON products USING gin (attrs jsonb_path_ops);
SELECT name FROM products WHERE attrs @> '{"brand": "Acme", "wireless": true}';

DynamoDB single-table access pattern

Model keys around queries: all orders for a customer, newest first.

PK = "CUSTOMER#42"    SK = "ORDER#2026-11-27T10:15:03#o-123"
Query: PK = "CUSTOMER#42" AND begins_with(SK, "ORDER#")  ScanIndexForward = false

Change-data-capture to keep search in sync

Debezium streams PostgreSQL changes to Kafka; a consumer updates OpenSearch.

postgres (logical replication) → Debezium connector → Kafka topic db.public.products
  → indexer consumer → OpenSearch index "products"

Common mistakes

  • Choosing NoSQL for "scale" when the data fits comfortably on one PostgreSQL server.
  • Choosing a document store for highly relational data, then reimplementing joins in application code.
  • Adding a new database for every feature, multiplying operational burden.
  • Treating search indexes or caches as the source of truth.
  • Ignoring the team's operational experience with a database.

Key takeaways

  • Default to a relational database; it covers most business workloads.
  • Choose specialised stores for clear access patterns: key lookups, massive writes, search, graphs.
  • NewSQL fits when you need SQL transactions and horizontal or multi-region scale.
  • Keep one source of truth per data type; derive the rest.

FAQ

Is MongoDB a bad choice?

No. It is a good fit for document-shaped data with flexible schemas and predictable access patterns. Problems arise when highly relational data is forced into it.

When does PostgreSQL stop scaling?

A single well-tuned primary handles thousands to tens of thousands of writes per second and many terabytes. Read replicas, partitioning and tools like Citus extend it further.

Should I use a managed database?

Usually yes. Managed services handle backups, failover and patching, which are easy to get wrong and expensive to staff.

More Architecture articles