NoSQL Families
Definition
NoSQL database
- In plain English
- A NoSQL database stores data in shapes other than linked tables, often trading some relational features for flexibility or scale.
- Think of it like
- It is like choosing a filing system shaped for your papers instead of forcing everything into one spreadsheet.
Why it exists
Your exhibit catalogue contains paintings, fossils, and sculptures. Each type needs different fields, so one rigid form becomes awkward.
Another app mostly follows chains of friendships. Its main question differs from finding one record by its ID.
JSON
- In plain English
- JSON is a text format that represents records with named fields, values, and lists.
- Think of it like
- It is like a labelled form that another program can read.
How it works
Key-value store
- In plain English
- A key-value store saves each value under a unique key and finds it only by that key.
- Think of it like
- Like a coat check: hand over the ticket, get the coat.
Document store
- In plain English
- A document store saves self-contained records, usually JSON, whose fields can differ from one record to the next.
- Think of it like
- Like a folder of forms where each form can have extra pages.
Wide-column store
- In plain English
- A wide-column store groups data by a key and stores many columns per key, built for huge write volumes spread over many machines.
- Think of it like
- Like a ledger with one long row per sensor, adding a new column for every reading.
Graph database
- In plain English
- A graph database stores things and the relationships between them, and is fast at following chains of links.
- Think of it like
- Like a map of who knows whom at a party.
| Family | Shape | Good fit | Harder work |
|---|---|---|---|
| Key-value | One value per key | Fetch one session by ID | Search inside arbitrary fields |
| Document | Self-contained records | Varied exhibit fields | Combine many related records |
| Wide-column | Rows grouped by a key | Large grouped reading streams | Unplanned questions across groups |
| Graph | Things and links | Follow friendship chains | Bulk numerical summaries |
Alice follows Bob, and both Alice and Bob have attendance links to Stage A.
These families differ in query support, transactions, and scaling. NoSQL does not automatically mean faster, more scalable, or less correct. Products can add lookup tools beyond these basic models.
Examples
Keep different exhibit fields
You store paintings with artists and fossils with ages. Each exhibit becomes one document.
[
{"id": "P7", "type": "painting", "artist": "Mira Sen"},
{"id": "F9", "type": "fossil", "age_years": 65000000}
]JSON uses named fields and values inside braces. Your app still validates required fields, even when the database allows different shapes.
The insight
Documents fit records whose shape varies.
Look up one guest
At opening, your queue app receives 80 guest-position lookups each second. Every lookup includes the guest ID.
SET guest:9142 "Rapids, position 37"
GET guest:9142
→ "Rapids, position 37"A key-value store is a direct fit. Measure response time on your setup; one millisecond is a possible result, not a promise.
The insight
A lookup by one key fits a key-value model directly.
Group each panel’s readings
Your 50,000 panels report every ten seconds. Operators ask for one panel’s readings over the last day.
Incoming readings split into groups for panels 42 and 43 on a given day, each holding time-ordered readings.
50,000 ÷ 10 gives 5,000 readings per second, or 432,000,000 per day. Grouping by panel and day keeps each group manageable.
The insight
Wide-column models suit large write streams grouped by a known key.
Trade-offs
Pros
- Shapes can match particular workloads.
- Some products spread work across machines.
- Direct access patterns can be efficient.
Cons
- Joins and transaction support vary.
- Queries often shape the stored layout.
- New tools add operational work.
Use when
- A known workload fits one family.
- Measurements support the product choice.
Avoid when
- Flexible questions and relationships dominate.
- One relational database already meets your needs.
Quick check
Takeaways
- NoSQL groups several different database families.
- Choose by data shape and access pattern.
- Check each product’s query and transaction guarantees.