How do you choose between SQL and NoSQL for a new service?
basicStart from access patterns, consistency needs and scale; default to a relational database unless a specific requirement points elsewhere.
| Need | Fit |
|---|---|
| Joins, transactions, ad-hoc queries | RDBMS (PostgreSQL, MySQL) |
| Simple key lookups at huge scale | Key-value (DynamoDB, Redis) |
| Flexible documents, nested data | Document (MongoDB) |
| Massive write throughput, time series | Wide-column (Cassandra), TSDB |
| Relationship traversal | Graph (Neo4j) |
| Full-text search | Search engine (Elasticsearch/OpenSearch) |
- A single Postgres node handles most workloads up to terabytes and thousands of QPS.
- NoSQL usually trades joins and multi-row transactions for horizontal scale and schema flexibility; queries must be designed up front.
- Is NoSQL "schemaless"? The schema moves into application code; it still exists and must be migrated.
- Can SQL scale horizontally? Yes via sharding (Vitess, Citus) or distributed SQL (Spanner, CockroachDB), at more complexity.