# Non-Relational Database

> The Non-Relational Database is a type of database that stores data in formats other than traditional tables, often optimized for unstructured data.

## What is a NoSQL database and when should I use it?

The databases, also known as NoSQL databases, that organize data in flexible formats such as documents, key-value pairs, graphs or wide columns. They are typically used for handling large volumes of unstructured or semi-structured data and are optimized for scalability and distributed data storage.

- Topic: Databases
- Type: concept

## Common mistakes

- Choosing NoSQL to skip the schema, then validating nothing and ending up with inconsistent data.
- Doing joins by hand in app code with many queries because the data was modeled like SQL tables.

## Key points

- Documents are shaped around the app's read queries, not copied from a normalized SQL schema.
- Unbounded lists, like all comments on a post, are separate documents, not one growing array.
- Fields used in queries have indexes.

## Interview questions

### What are the main types of NoSQL databases?

Document stores, key-value stores, wide-column stores and graph databases. Each is optimized for a different access pattern.

### Do NoSQL databases support transactions?

Many do, but often with limits, such as within one document or partition. Check the guarantees of the specific database.

### Is NoSQL faster than SQL?

Not in general. It can be faster for the access pattern it was modeled for, and slower for queries it wasn't designed around.

## Related cards

- [Relational Database](https://wonderium.dev/engineering/relational-db.md)
- [Databases](https://wonderium.dev/engineering/databases.md)
- [.json](https://wonderium.dev/engineering/json.md)
- [Cache](https://wonderium.dev/engineering/cache.md)
- [Vector Database](https://wonderium.dev/ai/vector-database.md)

---

- Level: [Engineering](https://wonderium.dev/engineering.md)
- HTML version: https://wonderium.dev/engineering/non-relational-db
- Last updated: 2026-11-25
