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
| Family | Examples | Great at | Watch out for |
|---|---|---|---|
| Relational | PostgreSQL, MySQL | Transactions, joins, constraints, ad-hoc queries | Write scaling beyond one primary needs sharding |
| Document | MongoDB, Firestore | Flexible nested records, developer speed | Cross-document transactions and joins are limited or costly |
| Key-value | Redis, DynamoDB | Simple, very fast lookups at scale | Query flexibility; model around access patterns |
| Wide-column | Cassandra, ScyllaDB | Huge write throughput, time series, chat | No joins; denormalise per query |
| Graph | Neo4j, Neptune | Deep relationship queries | Not a general-purpose store |
| Search | Elasticsearch, OpenSearch | Full-text relevance, faceting | Not a primary source of truth |
| NewSQL | CockroachDB, Spanner, TiDB | SQL + ACID with horizontal/multi-region scale | Latency of distributed transactions, cost |
Questions to ask first
- What are the main access patterns (by key, by range, ad-hoc, full-text, graph)?
- Do you need multi-record ACID transactions?
- What are the write and read volumes, now and in 3 years?
- Single region or multi-region with local writes?
- What does the team know how to operate (or is managed service available)?
- Default to PostgreSQL unless a clear answer above says otherwise
Polyglot persistence
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 = falseChange-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.