XenonStack

Big Data Engineering

XenonStack Blog NoSQL Databases: Types, Examples and How to Choose

and | Published | Updated

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?

TypeHow it stores dataTypical fitExamples (vendor sites)
Key-valueA key maps to a value; access is by keySessions, caches, carts, lookupsRedis, Amazon DynamoDB
DocumentJSON-like documents, nested fields and arraysCatalogues, profiles, content, app back endsMongoDB
Wide-columnPartitioned rows with flexible columnsWrite-heavy, large-scale, multi-datacentre dataApache Cassandra
GraphNodes, relationships and propertiesFraud rings, networks, recommendations, dependency mapsNeo4j

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...ConsiderCheck firstWatch for
Cache, session or lookup by keyKey-valuePersistence and licence termsNo rich queries beyond the key
Evolving records with nested fieldsDocumentSchema validation, transaction needsCost of multi-document transactions
Very high write volume across regionsWide-columnConsistency level per operationQuery patterns must be designed up front
Relationship-heavy questionsGraphDepth of traversals, data sizePoor fit for simple bulk analytics
Strict transactions at scaleOrdered key-value with ACID, as in FoundationDBDocumented limitsFewer 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.

Two-column diagram: left lists four workloads (cache, evolving records, high write volume, relationship questions); right maps them to key-value, document, wide-column and graph databases.

How do you move from a relational database to NoSQL?

ApproachWhat it meansWhen it fits
New applicationStart on NoSQL from the first designGreenfield services with a clear access pattern
AugmentationAdd a NoSQL store beside the relational system for one part of the workloadA relational system strains on scale or availability for one component
Full replacementMigrate the whole workloadOnly 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?

ChallengeWhy it mattersWhat to do
Data modellingModels follow queries, so a late change in access patterns can force a redesignPrototype with real queries before committing
ConsistencyEventual consistency can return stale readsChoose consistency per operation and document it
SkillsTeams used to SQL need new modelling habitsTrain and pilot on one bounded workload
Security and governanceControls differ by productCheck authentication, encryption, auditing and access control in each product's docs
Lock-in and licensingTerms can change between versionsReview 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.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in Solving your Challenges with XenonStack Team
Get Started

Get Started with your requirements and primary focus, that will help us to make your solution

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Proceed Next