Insights · Data
Choosing the right database: relational, document, key-value, columnar and beyond
By the Cystem X Engineering Team - Published - 5 min read
In this article
Database selection is often driven by familiarity or fashion. The better approach is to start from how the data will be written and read, what guarantees the business needs and who will operate the system for the next ten years. This article offers a framework for making that decision deliberately.
Start with the access pattern
List the most important queries and writes: point lookups, range scans, joins across entities, aggregations over large volumes, full-text search or graph traversal. Estimate rates and latency needs for each.
The shape of the workload eliminates many options early. A system optimized for analytical scans is a poor fit for high-rate transactional updates and the reverse.
Decide what consistency you need
Financial transactions, inventory and identity data usually need strong consistency and transactional guarantees. Activity feeds and caches can often tolerate eventual consistency in exchange for scale and availability.
Be explicit about the trade-off. Many production incidents come from assuming a guarantee the system never offered.
The best database is the one that fits the workload and the team that must run it.
Relational remains the default
A well-run relational database such as PostgreSQL handles an enormous range of workloads, offers strong transactions, rich querying and a mature ecosystem. Extensions add JSON documents, geospatial data, time series and vector search.
Unless you have a clear reason otherwise, start here, and add specialized systems when measured needs justify the extra operational burden.
When other models fit
Document databases suit self-contained records with flexible structure. Key-value stores excel at caching and session data. Wide-column systems handle massive write volumes with predictable access patterns. Columnar warehouses serve analytical queries across large datasets. Graph databases make relationship-heavy queries natural.
Each solves a particular problem well, and each makes other things harder.
Count the operational cost
Consider backup and recovery, replication, upgrades, monitoring, security hardening and available expertise. A technology your team cannot operate confidently is a liability, however elegant on paper.
Managed services reduce effort but introduce dependence on a provider and may conflict with residency or air-gap requirements.
Plan for scale and growth
Estimate data volume and growth, and understand how the system scales: vertically, by read replicas, by sharding or by design. Retrofitting scale after launch is difficult.
Test with realistic data volumes and access patterns before committing, and include failure scenarios in the test.
Avoid unnecessary polyglot sprawl
Using several databases can be right, but each one adds backup procedures, security controls, skills and failure modes. Require a written justification, with measurements, for adding another technology.
Standardizing on a small set of well-understood systems gives teams more time to improve the product.
Key takeaways
- Start from access patterns and required guarantees.
- Treat relational databases as the default and justify alternatives.
- Match document, key-value, columnar and graph systems to specific needs.
- Include operations, skills and residency in the comparison.
- Limit the number of database technologies you run.
Sources and further reading
This article reflects general practice and publicly available guidance. Teams should consult primary sources, including the documentation of the database engines you are comparing, and independent benchmark methodology guidance, and adapt the guidance to their own environment, risk appetite and legal obligations.
Keep reading
More engineering guidance from the Cystem X team.
Data
Data governance in practice: ownership, lineage, quality and access
Ownership, catalog, lineage, quality checks and access control, enforced in the platform.
Read articleData
Data loss prevention in practice: classify first, then control
DLP fails without classification. Define classes, find the data, then apply proportionate controls.
Read articleData
Data lakehouse architecture: open table formats and when to adopt them
Open table formats bring transactions and governance to lake storage. Architecture, layers and trade-offs.
Read articleData & Databases
Pick a database with confidence.
Our data engineers assess workloads and recommend, build and operate the right platform.
Explore Data & Databases