Skip to content
IT glossary
DatabasesUpdated December 3, 2026

NoSQL

This is a family of databases that organize data around models such as documents, key–value pairs, or graphs rather than relational tables. The right model depends on what the application needs to read and update.

What NoSQL means

NoSQL is an umbrella term, not a database engine or a query language. The label tells you that a database's primary data model isn't relational. In a relational database, you can store related facts in separate tables and combine them in a query. A NoSQL database might instead store a whole record as a document or represent relationships directly as edges in a graph. Some NoSQL products offer SQL-like query languages, so the syntax alone doesn't tell you which model they use.

Common models and what they're good at

  • Key–value stores such as Redis work well when the application already knows the lookup key, as with a session ID. That doesn't mean you can efficiently search by any attribute inside the value.
  • Document databases such as MongoDB store nested records that can vary in shape. You can query and index selected fields inside a document.
  • Wide-column stores such as Cassandra group rows by a partition key. You typically design tables around known queries, such as fetching recent readings from one device.
  • Graph databases such as Neo4j store nodes and relationships. They're useful when following connections is the query itself, as when finding how two people are connected.

Example: modeling a product page

Suppose a store usually reads a product's name and specifications together, but the specifications differ by category. A MongoDB document could look like this:

{"_id": "monitor-42", "name": "Office monitor", "specs": {"refreshHz": 75}}

The product page can fetch the document by ID without a separate lookup for the specs. If shoppers frequently filter by refresh rate, an index on specs.refreshHz may help. The flexible document shape lets other products omit that field, but the application still needs a rule about its type: storing 75 as a number in one document and as text in another makes numeric filters behave differently.

Where the trade-offs show up

Embedding works best when the embedded data belongs to the parent and is usually read with it. Copying a supplier's address into every product is a different decision: a single address change now has to reach every copy. Keeping the supplier in a separate record avoids that duplication, at the cost of an additional lookup or a join-like operation. If the workload involves many relationships and frequently changing query requirements, a relational database may be simpler.

The NoSQL label doesn't tell you whether a database is faster, whether it supports transactions, or what a read from a replica will return after a write. MongoDB supports multi-document transactions, for example. Check the guarantees of the specific product and configuration rather than inferring them from the category.

What interviewers look for

In a design interview, describe the main reads and writes before naming a database. Explain which data you'd keep together, what must update atomically, and which queries need indexes. If you propose sharding, show how the shard key spreads traffic: dividing data evenly by size won't help much if most requests still hit one shard.