Non-Relational Database

Term side of the Card.
Topic: Databases
Unit title: Non-Relational Database
Categories: Concept
Explanation side of the Card

Explanation: 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.

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.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy