Concepts

The idea of key/value-based storage systems is similar to the concept of hash tables in programming languages. Like in the relational model, entities are stored as tuples, but with just one key that can uniquely identify the tuple. Relationships are not maintained at the storage level. The Value part of the tuple is pretty much opaque to the storage system.

The advantage with these reduced constraints is the scalability of the system. Using concepts such as distributed hash tables, the data space can now be sharded across multiple instances easily. Reads/writes need to go to only one shard (node) since there are no relationships that could affect other tuples. Scale-out can be easily handled by an efficient redistribution of tuples across new nodes. Another advantage of these systems is performance—they are generally a magnitude of times faster than relational systems. We will look at distributed hash tables in detail in the Scaling data section.

A variant of the key-value store is document stores. Here, the data has a structure—usually XML or JSON. However, these systems allow documents of varying schemas to be stored in the same database. This allows storage of things such as optional columns for entities. These values are referred to as documents, hence the name. Compared to key/value stores, document stores allow for more complex queries, and aggregations over documents.

In the next section, we will do a deep-dive into a very popular key-value store, called Redis.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset