NoSQL Databases
NoSQL databases provide an alternative data model to the relational database model. Here's an overview.
Most of this database tutorial has focused on relational database management systems. Although currently the most popular type of database, relational is not the only model available.
There's a new breed of database management system that is often referred to as a "NoSQL database". This type of database doesn't use the relational model — it uses a completely different model altogether.
The actual data model that it uses depends on the database. NoSQL is a very broad term that doesn't refer to one particular database model. Rather, it refers to a whole variety of different models that don't fit into the relational model.
Although NoSQL databases have been around since the 1960s, it wasn't until the early 2000s that the NoSQL approach started to pick up steam, and a whole new generation of NoSQL systems was born.
NoSQL Types
NoSQL databases are usually categorized under one (or more) of following types.
-
Key-Value
A key-value database, is a database that uses a simple key/value method to store data.
The key-value part refers to the fact that the database stores data as a collection of key/value pairs. This is a simple method of storing data, and it is known to scale well.
A simple phone directory is a classic example of a key-value database:
Key Value Homer (123) 456-7890 Jay (234) 567-8901 Grace (345) 678-9012 Bart (456) 789-0123 -
Document Store
A document store database uses a document-oriented model to store data. It is similar to a key-value database in that it uses a key-value approach. The difference is that, the value in a document store database consists of semi-structured data.
The documents in document stores are usually XML or JSON, but some DBMSs use other languages, such as BSON, YAML, etc.
A JSON document looks like this:
{ '_id' : 1, 'artistName' : { 'Iron Maiden' }, 'albums' : [ { 'albumname' : 'The Book of Souls', 'datereleased' : 2015, 'genre' : 'Hard Rock' }, { 'albumname' : 'Killers', 'datereleased' : 1981, 'genre' : 'Hard Rock' }, { 'albumname' : 'Powerslave', 'datereleased' : 1984, 'genre' : 'Hard Rock' }, { 'albumname' : 'Somewhere in Time', 'datereleased' : 1986, 'genre' : 'Hard Rock' } ] }
See the MongoDB tutorial for an example of a document store database management system.
-
Column Store