NoSQL Databases

Something that NoSQL databases have in general adhered to is the CAP Theorem, which says that a web service cannot provide all of the following:

  • Consistency;
  • Availability; and
  • Partition Tolerance.

We'll look at this in the next page.

But first, what is NoSQL?

It is a very different way to store data than what we already know from SQL databases.

There are loads of different "products" in the NoSQL world.

Only use them when it makes sense to use them! They are not necessarily *better than SQL in all instances.

WARNING (might offend, strong language, but is true): MongoDB is web scale

Types of NoSQL database

  • Key-value (e.g. Redis);
  • Column-family (e.g. Cassandra);
  • Document databases (e.g. MongoDB); and
  • Graph databases (e.g. Neo4J).

Nowadays we may use multiple databases throughout our system. This is known as Polyglot Persistence.

Polyglot Persistence Diagram

What is Scalability?

The ability to maintain performance under load by adding more resources.

Scalability isn't reducing latency or increasing speed. In fact, adding more nodes to a multi-node implementation of a database might actually slow it down, BUT you'll be able to do more operations.

Oh, and don't believe all the benchmarks you see. We'll get to that soon as well.