What Is NoSQL? Redis, MongoDB and SQL vs NoSQL
We explain NoSQL database types, how Redis and MongoDB work, the CAP theorem, consistency models, NoSQL security and recent license changes.

Short answer: NoSQL is the umbrella name for databases that store data with document, key-value, wide-column or graph models instead of relational tables; Google Cloud expands the term as "not only SQL". In exchange for flexible schemas and horizontal scaling, these systems give up part of the relational behavior, such as rigid schemas and broad transaction scope. Two common examples are MongoDB, a document database, and Redis, which keeps data in memory and is often used as a cache. When the network partitions, a distributed system has to choose between consistency and availability (the CAP theorem); systems such as Cassandra, DynamoDB and Azure Cosmos DB let you choose the consistency level.
What is NoSQL?
In Google Cloud's definition, NoSQL is short for "not only SQL" and refers to databases that store data in a non-tabular format rather than in relational tables. According to Microsoft, these systems optimize for flexible schemas, horizontal scale and specific access patterns. AWS calls them purpose-built databases.
In the Stack Overflow Developer Survey run between June 23 and August 5, 2026, 28.3% of the 12,061 respondents who answered the database question said they had done extensive development work with Redis over the past year, and 19% with MongoDB.
Types of NoSQL databases
There are four main types:
- Document: Records live in JSON-like documents, and documents in the same collection can have different structures. Example: MongoDB.
- Key-value: According to Google Cloud, the simplest type: a value is stored under a unique key and retrieved with that key. Example: Redis.
- Wide-column: Apache Cassandra implements a partitioned wide-column storage model with eventually consistent semantics. Its query language, CQL, is SQL-like, but distributed joins and foreign keys are deliberately left out.
- Graph: According to the Neo4j documentation, data is stored as nodes, relationships and properties; there are no joins, because relationships are stored alongside the data. GQL, a graph query language, became an international standard in April 2024 as ISO/IEC 39075.
What is MongoDB?
MongoDB is a document database: each record is a document made of field-and-value pairs, similar to a JSON object, and documents live in collections that do not enforce a rigid schema. Because a field's value can be another document or an array, the need for joins drops. Records are stored as BSON, a binary representation of JSON; a single document can be at most 16 mebibytes (MiB).
An operation on a single document is atomic. Multi-document transactions are available too, but the documentation notes that in most cases they cost more than single-document writes and are no substitute for good schema design.
What is Redis? Using Redis as a cache
Redis describes itself as a data structure server; its native types, such as strings, hashes, lists, sets, sorted sets and streams, serve jobs ranging from caching to queuing and event processing. Google Cloud cites it as an example of a database that keeps data in memory, and we cover its options for writing data to disk in our DBMS article.
According to the Redis documentation, Redis is commonly used as a cache that speeds up reads in front of a slower database. Because cache entries are copies of persistently stored data, it is usually safe to evict them when memory runs out. maxmemory sets the memory limit, and maxmemory-policy decides which keys are evicted once that limit is reached. Policies whose names start with volatile evict only keys that have an expiration set; if there are none, commands that add new data return an error. EXPIRE sets that timeout, and the key is deleted automatically when it expires.
In the cache-aside pattern, the application reads an item from the database when it is missing from the cache and then adds it to the cache; according to Microsoft, the pattern does not guarantee consistency between the cache and the database. Redis transactions run commands as a single isolated step, but Redis does not support rollbacks.
SQL vs NoSQL
According to AWS's comparison, relational databases normalize data into tables of rows and columns, typically scale up by adding compute to the hardware, provide ACID properties and are queried with SQL. NoSQL databases work with a variety of data models, are typically designed to scale out across distributed clusters and are used through object-based APIs; most relax some of the ACID properties.
The line is not sharp, though: PostgreSQL can store JSON in the jsonb type, which supports indexing (PostgreSQL article). We discuss when to choose a relational database and when to choose NoSQL in our PostgreSQL or MongoDB article. We explain moving data into a data warehouse for reporting in our ETL article, and we handle database changes in our application & database modernization service.
The CAP theorem, ACID and BASE
In his PODC keynote on July 19, 2000, Eric Brewer said that a shared-data system can have at most two of three properties: consistency, availability and tolerance to network partitions. Seth Gilbert and Nancy Lynch proved it in a paper published in SIGACT News in June 2002: in an asynchronous network where messages can be lost, you cannot build a read/write data object that both responds to every request and guarantees atomic consistency. Under atomic consistency, any read that begins after a write completes must return that value or the result of a later write.
In practice, this becomes a setting. Cassandra lets you choose the trade-off between consistency and availability per operation through consistency levels; if both writes and reads use QUORUM, at least one replica takes part in both, so the write is visible to the read. In DynamoDB, reads are eventually consistent by default, so a recently completed write may not show up yet. Azure Cosmos DB offers five levels, from strong to eventual.
In the same keynote, Brewer set BASE against ACID: Basically Available, Soft-state, Eventual consistency. ACID focuses on strong consistency; BASE accepts stale data and puts availability first. Brewer saw the two as a spectrum rather than a strict divide.
Scaling: sharding and replication
According to MongoDB, sharding distributes data across multiple machines and supports deployments with very large data sets. The shard key determines the distribution, and a poorly chosen key can cause uneven distribution or bottlenecks. Redis Cluster spreads keys over 16,384 hash slots, while Cassandra maps nodes onto a hash ring using consistent hashing.
In MongoDB, each shard is deployed as a replica set: the primary receives all writes, and the secondaries apply its oplog. The default write concern is "majority"; with w: 1, a write acknowledged only by the primary can be rolled back if the primary steps down before the write reaches a secondary. Because replication is asynchronous, reads from secondaries may return stale data, and for the same reason Redis Cluster can lose acknowledged writes under certain conditions. We explain synchronous and asynchronous replication in our replication article.
NoSQL security: databases exposed to the internet
According to the Redis documentation, Redis is designed to be accessed by trusted clients inside trusted environments, and it is usually not a good idea to expose it directly to the internet. MongoDB likewise asks that its processes be accessible only on trusted networks. The basic measures are:
- Network: MongoDB binds to localhost by default. Since version 3.2.0, Redis enters protected mode when it runs with the default configuration and no password, replying only to queries from the loopback interface; an administrator can still turn this off.
- Authentication and privilege: MongoDB does not enable access control by default; its security checklist asks you to enable it, create a unique user for each person and application, and grant only the roles they need (IAM article). In Redis, the recommended method is the ACLs introduced in Redis 6.
- Encryption: Both support TLS (SSL article).
- Injection: According to OWASP, NoSQL databases can still be vulnerable to injection attacks even though they do not use SQL.
We handle this layer in our database platform engineering and database platform and operations services.
License changes: SSPL, RSAL and AGPL
- MongoDB: On October 16, 2018, MongoDB moved Community Server from the GNU AGPLv3 to the Server Side Public License (SSPL), a license it wrote itself. According to its FAQ, the SSPL is not OSI-approved, and its extra condition applies only to those offering MongoDB's functionality to third parties as a service.
- Redis: On March 20, 2024, Redis announced that starting with Redis 7.4 it would drop the BSD license for dual licensing under RSALv2 and SSPLv1, acknowledging that Redis would no longer be open source under the OSI definition. On May 1, 2025, it added the AGPLv3 as a third option with Redis 8; according to its licenses page, 7.2.x and earlier remain under the BSD license.
What this means for your organization is a question for legal review.
Frequently asked questions
What does NoSQL mean? It is short for "not only SQL": the umbrella name for databases that use document, key-value, wide-column or graph models instead of relational tables.
What is Redis used for? Redis is a data structure server that keeps data in memory. It is often used as a cache in front of a slower database.
What is MongoDB? A document database that stores records as JSON-like documents in collections.
What is the difference between SQL and NoSQL? Relational systems keep data in schema-bound tables and are queried with SQL. NoSQL systems relax some ACID properties in exchange for flexible schemas and horizontal scaling.
What is the CAP theorem? It states that when the network partitions, a distributed system cannot guarantee both consistency and availability. Eric Brewer proposed it in 2000, and Seth Gilbert and Nancy Lynch proved it in 2002.
Sources
- Google Cloud, What is NoSQL?: definition of NoSQL and the "not only SQL" expansion, key-value and in-memory databases
- Microsoft, Understand data models: definition and types of nonrelational databases
- AWS, What is NoSQL?: purpose-built databases, types and the SQL vs NoSQL comparison
- Stack Overflow, 2026 Developer Survey: Databases and Methodology: Redis and MongoDB usage (survey run June 23 to August 5, 2026; 12,061 responses to the database question)
- Apache Cassandra, Overview and Dynamo: wide-column model, CQL, unsupported operations, consistency levels and consistent hashing
- Neo4j, What is a graph database?: the graph model and the absence of joins
- ISO, ISO/IEC 39075:2024 Database languages: GQL: the graph query language standard (April 2024)
- MongoDB, Introduction, Documents and Transactions: document model, BSON, the 16 MiB limit and transactions
- Redis, Data types, Key eviction, EXPIRE and Transactions: data types, cache use, TTLs and the lack of rollbacks
- Microsoft, Cache-Aside pattern: the cache-aside pattern and its consistency limits
- PostgreSQL, JSON Types: the json and jsonb types (PostgreSQL 18 documentation, read on October 13, 2026)
- Eric Brewer, Towards Robust Distributed Systems: the CAP conjecture, ACID and BASE (PODC keynote, July 19, 2000)
- Seth Gilbert and Nancy Lynch, Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services: proof of CAP and definitions (SIGACT News, June 2002)
- Seth Gilbert and Nancy Lynch, Perspectives on the CAP Theorem: publication details of the 2002 paper (reference list)
- AWS, DynamoDB read consistency: eventually and strongly consistent reads
- Microsoft, Consistency levels in Azure Cosmos DB: five consistency levels
- MongoDB, Sharding, Replication and Write Concern: shard keys, replica sets and the default write concern
- Redis, Scale with Redis Cluster: hash slots and consistency guarantees
- Redis, Security: trusted environments, protected mode, ACLs and TLS
- MongoDB, IP Binding in Self-Managed Deployments, Role-Based Access Control and Security Checklist: localhost binding, access control off by default, least privilege and TLS
- OWASP, WSTG v4.2 Testing for NoSQL Injection: NoSQL injection
- MongoDB, MongoDB Issues New Server Side Public License for MongoDB Community Server and SSPL FAQ: the license change and its scope (October 16, 2018)
- Redis, Redis Adopts Dual Source-Available Licensing (March 20, 2024), Redis is now available under the AGPLv3 open source license (May 1, 2025) and Licenses: Redis license changes
- How we run this layer: database platform engineering