Lecture Notes: NoSQL Databases
Databases can be broadly classified into several "styles." The most common style is the relational database which organizes data into tables and emphasizes relationships between the tables. The SQL query language is used to combine tables and select data. Postgres, SQLite,MySQL, Oracle, SQL Server are examples of common relational database management systems. Alternative models include Key-Value, Columnar, Document, Graph, and Polyglot databases. Most of these use query mechanisms other than SQL -- hence the nameNoSQL databases. Although, some of them offer SQL to express queries due to SQLs versatility, ubiquity, and platform independence.
Columnar database are, as the name implies, column-oriented rather than the relational models row-orientation. It is relatively easy and computationally inexpensive to add new columns of data. Each record is identified through a key and each record contains zero or more columns (fields). The columns do not have to be of the same data type across rows and, in fact, may have different numbers of columns making sparse data efficient to store. Columnar databases are about half-way between relational and key-value databases. HBase, along with Cassandra and Hypertable, is among the most popular columnar database implementations.Databases can be broadly classified into several "styles." The most common style is the relational database which organizes data into tables and emphasizes relationships between the tables. The SQL query language is used to combine tables and select data. Postgres, SQLite,MySQL, Oracle, SQL Server are examples of common relational database management systems. Alternative models include Key-Value, Columnar, Document, Graph, and Polyglot databases. Most of these use query mechanisms other than SQL -- hence the nameNoSQL databases. Although, some of them offer SQL to express queries due to SQLs versatility, ubiquity, and platform independence.
Key-Value KV) databases is one of the simplest, if not the simplest, type of data store. A KV database stores keys along with values matching each key -- it's similar to a lookup table. The program provides a key (record ID or some other unique identifier) and the database returns a value corresponding to that key. Some KV database allow the values to be a list but most are simple values. As with relational databases, many open source implementations are available, including Voldemort, memcached, memcachedb, membase, Redis, and Riak.
For example, in Riak values matching the keys can be simple numbers of strings, but also XML documents or images. Riak is built on top of Amazon's Dynamo engine and it uses the HTTP REST mechanism for data queries. Redis, on the other hand, supports complex data types such as sorted sets and offers basic message patterns for data distribution such as publish-subscribe and blocking queues. Redis offers incredible performance but at the risk of occasional data loss due to its aggressive caching approach.
Columnar database are, as the name implies, column-oriented rather than the relational models row-orientation. It is relatively easy and computationally inexpensive to add new columns of data. Each record is identified through a key and each record contains zero or more columns (fields). The columns do not have to be of the same data type across rows and, in fact, may have different numbers of columns making sparse data efficient to store. Columnar databases are about half-way between relational and key-value databases. HBase, along with Cassandra and Hypertable, is among the most popular columnar database implementations.Databases can be broadly classified into several "styles." The most common style is the relational database which organizes data into tables and emphasizes relationships between the tables. The SQL query language is used to combine tables and select data. Postgres, SQLite,MySQL, Oracle, SQL Server are examples of common relational database management systems. Alternative models include Key-Value, Columnar, Document, Graph, and Polyglot databases. Most of these use query mechanisms other than SQL -- hence the nameNoSQL databases. Although, some of them offer SQL to express queries due to SQLs versatility, ubiquity, and platform independence.
Key-Value KV) databases is one of the simplest, if not the simplest, type of data store. A KV database stores keys along with values matching each key -- it's similar to a lookup table. The program provides a key (record ID or some other unique identifier) and the database returns a value corresponding to that key. Some KV database allow the values to be a list but most are simple values. As with relational databases, many open source implementations are available, including Voldemort, memcached, memcachedb, membase, Redis, and Riak.
For example, in Riak values matching the keys can be simple numbers of strings, but also XML documents or images. Riak is built on top of Amazon's Dynamo engine and it uses the HTTP REST mechanism for data queries. Redis, on the other hand, supports complex data types such as sorted sets and offers basic message patterns for data distribution such as publish-subscribe and blocking queues. Redis offers incredible performance but at the risk of occasional data loss due to its aggressive caching approach.