NoSQL
NoSQL is the umbrella term for non-relational databases, including document, key-value, column-family, and graph models, designed for scalability and flexible schemas.
Purpose
To address relational database limitations in massive data volumes, flexible schemas, and horizontal scaling.
Mechanism
Four major types: document (MongoDB, JSON documents), key-value (Redis, simple and fast), column-family (Cassandra, wide sparse rows), graph (Neo4j, relationship-dense). Trades part of ACID for BASE eventual consistency and horizontal scaling. No fixed schema (or flexible schema).
Use cases
- Horizontal scaling of massive data
- Flexible/dynamic schemas
- Caching and session storage
- Social graphs and recommendations
Examples
- Input
db.users.insert({name:"Ada",tags:[...]})OutputNo fixed schemaDocument store
Common errors
- Assuming NoSQL needs no data modeling
- Document structure and indexes still need design
Related terms
SQL
SQL (Structured Query Language) is the standard query language of relational databases, defining and manipulating data declaratively (DDL/DML/DQL/DCL). GLOSSARY
ACID
ACID is the four properties of relational transactions: atomicity (all or nothing), consistency (constraints preserved), isolation (concurrency without interference), and durability (committed data is never lost). GLOSSARY
BASE
BASE is the weak-consistency NoSQL model: basically available, soft state, eventually consistent — trading strong consistency for availability and scalability. GLOSSARY
CAP Theorem
The CAP theorem states that under network partition a distributed system can satisfy only one of consistency (C) or availability (A); all three cannot hold at once. GLOSSARY