Key takeaway
- NoSQL databases explained: key-value, document, wide-column and graph types, CAP and PACELC trade-offs, and a table to choose the right engine.
What are NoSQL databases?
NoSQL (often read as "not only SQL") describes databases that store data in models other than the fixed tables of a relational system: key-value, document, wide-column and graph. Each model is built for a particular access pattern, so the right choice depends on how your application reads and writes data, how far it must scale and how much consistency it needs.
For enterprise teams the decision is rarely NoSQL or SQL in the abstract. It is which engine fits which workload, and what you give up in return. This guide covers the four main types, the CAP and PACELC trade-offs, a selection table and the governance questions to settle first. For the wider comparison with relational and NewSQL systems, read SQL vs NoSQL vs NewSQL; for one distributed engine in depth, see FoundationDB architecture.
What are the main types of NoSQL database?
| Type | How it stores data | Typical fit | Examples (vendor sites) |
|---|---|---|---|
| Key-value | A key maps to a value; access is by key | Sessions, caches, carts, lookups | Redis, Amazon DynamoDB |
| Document | JSON-like documents, nested fields and arrays | Catalogues, profiles, content, app back ends | MongoDB |
| Wide-column | Partitioned rows with flexible columns | Write-heavy, large-scale, multi-datacentre data | Apache Cassandra |
| Graph | Nodes, relationships and properties | Fraud rings, networks, recommendations, dependency maps | Neo4j |
How do key-value databases work?
A key-value store looks up a value by its key, so reads and writes are simple and fast to reason about. Redis can keep data in memory and offers persistence options. According to its docs, these are RDB snapshots, an append-only file (AOF), both together, or none for pure caching, and with the AOF the default fsync policy leaves up to about one second of writes at risk. Amazon DynamoDB is a managed key-value and document service. According to its docs, reads are eventually consistent by default, and a strongly consistent read can be requested per call.
Licensing deserves a check before you standardise. According to its licence page, Redis 7.2 and earlier are under BSD-3-Clause, 7.4 onwards moved to RSALv2 or SSPLv1, and Redis 8 and later add AGPLv3 as a third option. Confirm the current terms on the Redis page for your version.
How do document databases work?
A document database stores each record as a self-contained document, such as JSON or BSON, with nested objects and arrays. According to the MongoDB docs, documents in one collection need not share the same fields, new fields can be added without a schema migration, and schema validation can be enforced where you want a fixed structure. The docs also advise modelling data around access patterns, so that data read together is stored together.
The same docs state that a single-document operation is atomic and that multi-document ACID transactions are supported, with a higher performance cost than single-document writes. Good schema design, rather than leaning on transactions, remains the main lever.
How do wide-column databases work?
A wide-column store partitions data by a partition key and lets rows hold different columns. According to the Apache Cassandra docs, Cassandra uses a partitioned wide-column storage model with eventually consistent semantics, combining Dynamo-style distribution and replication with a Bigtable-style data model. It offers a per-operation trade-off between consistency and availability through consistency levels, and a QUORUM level needs a majority of replicas (n/2 + 1) to respond. See Apache Cassandra on AWS for a deployment view.
How do graph databases work?
According to the Neo4j docs, a graph database stores data as nodes, relationships and properties instead of tables or documents. Every relationship has a start node, an end node, a direction and exactly one type. Graphs fit when the questions are about how items connect, such as deep hierarchies or hidden links between distant items, rather than about the items alone.
What do CAP and PACELC mean for NoSQL?
The CAP theorem says a distributed data store can provide at most two of consistency, availability and partition tolerance. Brewer put it forward as a conjecture in 2000, and Gilbert and Lynch proved a formal version in 2002. Since networks can fail, the practical choice during a partition is between cancelling operations (favouring consistency) and carrying on (favouring availability, with the risk of stale data). CAP consistency means every read returns the latest write or an error, which is different from ACID consistency.
PACELC, proposed by Abadi in 2010, adds the normal case: even without a partition there is a trade-off between latency and consistency. Many engines are not fixed at one point. Cassandra consistency levels and DynamoDB read modes let teams choose per operation, so label a product by how you configure it, not by a table of fixed CAP categories.
How do you choose a NoSQL database?
| If your workload is... | Consider | Check first | Watch for |
|---|---|---|---|
| Cache, session or lookup by key | Key-value | Persistence and licence terms | No rich queries beyond the key |
| Evolving records with nested fields | Document | Schema validation, transaction needs | Cost of multi-document transactions |
| Very high write volume across regions | Wide-column | Consistency level per operation | Query patterns must be designed up front |
| Relationship-heavy questions | Graph | Depth of traversals, data size | Poor fit for simple bulk analytics |
| Strict transactions at scale | Ordered key-value with ACID, as in FoundationDB | Documented limits | Fewer built-in query features |
Start from the access patterns, not the product. List the ten queries that matter, the consistency each needs, the growth you expect and who will operate the system. Then test the shortlist with realistic data. An engine that matches the data model but not the operations team usually costs more than it saves.

How do you move from a relational database to NoSQL?
| Approach | What it means | When it fits |
|---|---|---|
| New application | Start on NoSQL from the first design | Greenfield services with a clear access pattern |
| Augmentation | Add a NoSQL store beside the relational system for one part of the workload | A relational system strains on scale or availability for one component |
| Full replacement | Migrate the whole workload | Only when cost, scale or fit clearly justify the rewrite |
Most enterprises end up with several stores, so plan for polyglot persistence: agree data ownership, backup, access control and testing for each. Database testing should cover data model changes and migrations; see our guide to database testing and the overview of cloud native databases.
What are the challenges and trade-offs of NoSQL?
| Challenge | Why it matters | What to do |
|---|---|---|
| Data modelling | Models follow queries, so a late change in access patterns can force a redesign | Prototype with real queries before committing |
| Consistency | Eventual consistency can return stale reads | Choose consistency per operation and document it |
| Skills | Teams used to SQL need new modelling habits | Train and pilot on one bounded workload |
| Security and governance | Controls differ by product | Check authentication, encryption, auditing and access control in each product's docs |
| Lock-in and licensing | Terms can change between versions | Review the vendor licence page before each major upgrade |
NoSQL is not a cure for weak data design. If you need many joins, ad hoc reporting across entities and strict relational integrity, a relational or NewSQL system may serve you better.
How do governed AI agents change the database choice?
AI agents read and write enterprise data, so the store behind them needs access control, lineage and an audit trail, whichever model it uses. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentAnalyst lets teams ask questions of enterprise data in plain language and get real-time insights. For the process view, see agentic workflows.
To map one database decision your agents depend on, and the context and policy it relies on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is a NoSQL database?
A database that stores data in a model other than relational tables, such as key-value, document, wide-column or graph.
What are the four types of NoSQL database?
Key-value, document, wide-column and graph. Each suits a different access pattern, as the table above shows.
Does NoSQL support ACID transactions?
It depends on the engine. According to its docs, MongoDB supports multi-document ACID transactions, with a higher performance cost than single-document writes, and FoundationDB describes strict serializability. Check the product docs.
What does the CAP theorem mean for NoSQL?
During a network partition a distributed store must choose between consistency and availability. PACELC adds that, without a partition, there is still a latency and consistency trade-off.
When should I choose SQL instead of NoSQL?
When you need many joins, ad hoc reporting across entities or strict relational integrity. See our SQL vs NoSQL vs NewSQL guide.
Is Redis still open source?
According to its licence page, Redis 7.2 and earlier are BSD-3-Clause, while Redis 8 and later can be used under RSALv2, SSPLv1 or AGPLv3. Confirm the terms for your version.
Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE