NoSQL

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computing, NoSQL (commonly interpreted as "not only SQL"[1]) is a broad class of database management systems identified by non-adherence to the widely used relational database management system model. NoSQL databases are not built primarily on tables, and generally do not use SQL for data manipulation.

NoSQL database systems are often highly optimized for retrieval and appending operations and often offer little functionality beyond record storage (e.g. key–value stores). The reduced run-time flexibility compared to full SQL systems is compensated by marked gains in scalability and performance for certain data models.

In short, NoSQL database management systems are useful when working with a huge quantity of data when the data's nature does not require a relational model. The data can be structured, but NoSQL is used when what really matters is the ability to store and retrieve great quantities of data, not the relationships between the elements. Usage examples might be to store millions of key–value pairs in one or a few associative arrays or to store millions of data records. This organization is particularly useful for statistical or real-time analyses of growing lists of elements (such as Twitter posts or the Internet server logs from a large group of users).

Contents

[edit] Characteristics

NoSQL databases have a number of distinctive characteristics relative to traditional SQL-based relational databases.[citation needed]

NoSQL does not use SQL as its query language. NoSQL database systems arose alongside major Internet companies, such as Google, Amazon, and Facebook, which had challenges in dealing with huge quantities of data with which conventional RDBMS solutions could not cope. Note that both the Facebook and Twitter infrastructures are largely based on MySQL databases.[2][3] NoSQL database systems are developed to manage large volumes of data that do not necessarily follow a fixed schema. Data is partitioned among different machines (for performance reasons and size limitations) so that traditional JOIN operations cannot be used.[citation needed]

NoSQL cannot necessarily give full ACID guarantees. Usually only eventual consistency is guaranteed or transactions limited to single data items. This means that given a sufficiently long period of time over which no changes are sent, all updates can be expected to propagate eventually through the system.[citation needed]

NoSQL has a distributed, fault-tolerant architecture. Several NoSQL systems employ a distributed architecture, with the data held in a redundant manner on several servers. In this way, the system can easily scale out by adding more servers, and failure of a server can be tolerated. This type of database typically scales horizontally and is used for managing large amounts of data, when the performance and real-time nature is more important than consistency (as in indexing a large number of documents, serving pages on high-traffic web sites, and delivering streaming media).[citation needed]

[edit] History

Carlo Strozzi used the term NoSQL in 1998 to name his lightweight, open-source relational database that did not expose the standard SQL interface.[4] Strozzi suggests that, as the current NoSQL movement "departs from the relational model altogether; it should therefore have been called more appropriately 'NoREL'.[5]

Eric Evans, a Rackspace employee, reintroduced the term NoSQL in early 2009 when Johan Oskarsson of Last.fm wanted to organize an event to discuss open-source distributed databases.[6] The name attempted to label the emergence of a growing number of non-relational, distributed data stores that often did not attempt to provide atomicity, consistency, isolation and durability guarantees that are key attributes of classic relational database systems.[7]

In 2011, work began on UnQL (Unstructured Query Language), a specification for a query language for NoSQL databases. Like XQuery it is designed to query collections (versus tables) of documents (versus rows) with loosely defined fields (versus columns). UnQL is claimed[by whom?] to be a superset of SQL within which SQL is a very constrained type of UnQL for which the queries always return the same fields (same number, names and types). However, UnQL does not cover the data definition language (DDL) SQL statements like CREATE TABLE or CREATE INDEX.[8]

[edit] Taxonomy

Often, NoSQL databases are categorized according to the way they store the data and fall under categories such as key–value stores, BigTable implementations, document store databases, and graph databases. With the rise of the real-time web, there was a need to provide information out of large volumes of data which more or less followed similar horizontal structures. As such, NoSQL databases are often highly optimized for retrieve and append operations and often offer little functionality beyond record storage (e.g. key–value stores). The reduced run time flexibility compared to full SQL systems is compensated by large gains in scalability and performance for certain data models.[citation needed]

NoSQL implementations can be categorized by their manner of implementation:

[edit] Document store

The central concept of a document store is the notion of a "document". While each document-oriented database implementation differs on the details of this definition, in general, they all assume that documents encapsulate and encode data (or information) in some standard formats or encodings. Encodings in use include XML, YAML, JSON, and BSON, as well as binary forms like PDF and Microsoft Office documents (MS Word, Excel, and so on).

Different implementations offer different ways of organizing and/or grouping documents:

  • Collections
  • Tags
  • Non-visible Metadata
  • Directory hierarchies

Compared to relational databases, for example, collections could be considered as tables as well as documents could be considered as records. But they are different: every record in a table has the same sequence of fields, while documents in a collection may have fields that are completely different.

Documents are addressed in the database via a unique key that represents that document. One of the other defining characteristics of a document-oriented database is that, beyond the simple key-document (or key–value) lookup that you can use to retrieve a document, the database will offer an API or query language that will allow retrieval of documents based on their contents.

Name Language Notes
ArangoDB C, C++ & Javascript Multi model JSON document store
BaseX Java, XQuery XML database
Clusterpoint C++ geared for Full text search
Couchbase Server Erlang, C++ Support for JSON and binary documents
Apache CouchDB Erlang JSON store
eXist Java, XQuery XML database
Jackrabbit Java
Lotus Notes and IBM Lotus Domino LotusScript, Java, IBM X Pages, others MultiValue
MarkLogic Server XQuery, Java, REST XML database with support for JSON, text, and binaries
MongoDB C++, C# BSON store (binary format JSON)
OpenLink Virtuoso C++, C#, Java, SPARQL middleware and database engine hybrid
OrientDB Java
Sedna XQuery, C++ XML database
SimpleDB Erlang
Oracle NoSQL Database Java

[edit] Graph

This kind of database is designed for data whose relations are well represented as a graph (elements interconnected with an undetermined number of relations between them). The kind of data could be social relations, public transport links, road maps or network topologies, for example.

Name Language Notes
AllegroGraph SPARQL RDF GraphStore
ArangoDB C, C++ & Javascript Multi model JSON document store with graph support
IBM DB2 SPARQL RDF GraphStore added in DB2 10
DEX Java, C++ High-performance Graph Database
FlockDB Scala
InfiniteGraph Java High-performance, scalable, distributed Graph Database
Neo4j Java
OpenLink Virtuoso C++, C#, Java, SPARQL middleware and database engine hybrid
OrientDB Java
Pregel
Sones GraphDB C#
OWLIM Java, SPARQL 1.1 RDF graph store with reasoning

[edit] Key–value store

Key–value stores allow the application to store its data in a schema-less way. The data could be stored in a datatype of a programming language or an object. Because of this, there is no need for a fixed data model.[9][10] The following types exist:

[edit] Eventually‐consistent key‐value store

[edit] Hierarchical key–value store

[edit] Hosted services

[edit] Key–value cache in RAM

[edit] Key–value stores on solid state or rotating disk

[edit] Ordered key–value stores

[edit] Multivalue databases

[edit] Object database

[edit] RDF database

[edit] Tabular

[edit] Tuple store

[edit] See also

[edit] References

  1. ^ "NoSQL Definition". http://nosql-database.org/.
  2. ^ Callaghan, Mark. "MySQL and Database Engineering". https://www.facebook.com/notes/facebook-engineering/mysql-and-database-engineering-mark-callaghan/10150599729938920. Retrieved 2012-03-07.
  3. ^ Cole, Jeremy. "MySQL at Twitter". http://engineering.twitter.com/2012/04/mysql-at-twitter.html. Retrieved 2012-04-16.
  4. ^ Lith, Adam; Jakob Mattson (2010). "Investigating storage solutions for large data: A comparison of well performing and scalable data storage solutions for real time extraction and batch insertion of data" (PDF). Göteborg: Department of Computer Science and Engineering, Chalmers University of Technology. p. 70. http://publications.lib.chalmers.se/records/fulltext/123839.pdf. Retrieved 12 May 2011. "Carlo Strozzi first used the term NoSQL in 1998 as a name for his open source relational database that did not offer a SQL interface[...]"
  5. ^ "NoSQL Relational Database Management System: Home Page". Strozzi.it. 2 October 2007. http://www.strozzi.it/cgi-bin/CSA/tw7/I/en_US/nosql/Home%20Page. Retrieved 29 March 2010.
  6. ^ "NoSQL 2009". Blog.sym-link.com. 12 May 2009. http://blog.sym-link.com/2009/05/12/nosql_2009.html. Retrieved 29 March 2010.
  7. ^ Mike Chapple. "The ACID Model". http://databases.about.com/od/specificproducts/a/acid.htm.
  8. ^ Avram, Abel (04). "Interview: Richard Hipp on UnQL, a New Query Language for Document Databases". http://www.infoq.com. http://www.infoq.com/news/2011/08/UnQL. Retrieved 7 September 2011.
  9. ^ Sandy (14 January 2011). "Key Value stores and the NoSQL movement". http://dba.stackexchange.com/questions/607/what-is-a-key-value-store-database: Stackexchange. http://dba.stackexchange.com/a/619. Retrieved 1 January 2012. "Key–value stores allow the application developer to store schema-less data. This data usually consists of a string that represents the key, and the actual data that is considered to be the value in the "key–value" relationship. The data itself is usually some kind of primitive of the programming language (a string, an integer, or an array) or an object that is being marshaled by the programming language's bindings to the key–value store. This structure replaces the need for a fixed data model and allows proper formatting."
  10. ^ Marc Seeger (21 September 2009). "Key-Value Stores: a practical overview". http://blog.marc-seeger.de/2009/09/21/key-value-stores-a-practical-overview/: Marc Seeger. http://blog.marc-seeger.de/assets/papers/Ultra_Large_Sites_SS09-Seeger_Key_Value_Stores.pdf. Retrieved 1 January 2012. "Key–value stores provide a high-performance alternative to relational database systems with respect to storing and accessing data. This paper provides a short overview of some of the currently available key–value stores and their interface to the Ruby programming language."
  11. ^ "Riak: An Open Source Scalable Data Store". 28 November 2010. https://wiki.basho.com. Retrieved 28 November 2010.
  12. ^ Tweed, Rob; George James (2010). "A Universal NoSQL Engine, Using a Tried and Tested Technology" (PDF). p. 25. http://www.mgateway.com/docs/universalNoSQL.pdf. "Without exception, the most successful and well-known of the NoSQL databases have been developed from scratch, all within just the last few years. Strangely, it seems that nobody looked around to see whether there were any existing, successfully implemented database technologies that could have provided a sound foundation for meeting Web-scale demands. Had they done so, they might have discovered two products, GT.M and Caché..."

[edit] Further reading

  • Pramod Sadalage and Martin Fowler (2012). NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley. ISBN 0-321-82662-0.

[edit] External links