NoSQL

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

A NoSQL database provides a mechanism for storage and retrieval of data that use looser consistency models than traditional relational databases in order to achieve horizontal scaling and higher availability. Some authors refer to them as "Not only SQL" to emphasize that some NoSQL systems do allow SQL-like query language to be used.

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 (especially big 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 analysis of growing lists of elements (such as Twitter posts or the Internet server logs from a large group of users).

Other usages of this technology are related with the flexibility of the data model; a lot of applications might gain from this unstructured data model: tools like CRM, ERP, BPM, etc, could use this flexibility to store their data without performing changes on tables or creating generic columns in a database. These databases are also good to create prototypes or fast applications, because this flexibility provides a tool to develop new features very easily.

Contents

Characteristics [edit]

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]. Although most of the NoSQL systems have transactions over single documents, other NoSQL systems such as eXtreme Scale,[1] FoundationDB,[2] OrientDB,[3] and djondb[4] state that they are able to execute transactions over multiple documents, similar to what RDBMS systems support over multiple rows.[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]

History [edit]

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

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.[7] 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.[8]

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.[9]

Taxonomy [edit]

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:

Document store [edit]

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, and JSON as well as binary forms like BSON, 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. Some NoSQL document stores offer an alternative way to retrieve information using Map-Reduce techniques, in CouchDB the usage of map-reduce is mandatory if you want to retrieve documents based on the contents, this is called "Views" and it's an indexed collection with the results of the map/reduce algorithms.

Name Language Notes
BaseX Java, XQuery XML database
Cloudant Erlang, Java, Scala, C JSON store (online service)
Clusterpoint C++ XML, geared for Full text search
Couchbase Server Erlang, C++ Support for JSON and binary documents
Apache CouchDB Erlang JSON database
ElasticSearch Java JSON, Search Engine
eXist Java, XQuery XML database
Jackrabbit Java Java Content Repository implementation
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 JSON, SQL support
Sedna XQuery, C++ XML database
SimpleDB Erlang online service
Oracle NoSQL Database Java

Graph [edit]

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
IBM DB2 SPARQL RDF GraphStore added in DB2 10
DEX Java, C++, .NET 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
Sones GraphDB C#
OWLIM Java, SPARQL 1.1 RDF graph store with reasoning

Key–value store [edit]

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.[10][11] The following types exist:

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 [edit]

  1. ^ http://www-01.ibm.com/software/webservers/appserv/extremescale/
  2. ^ http://www.foundationdb.com
  3. ^ http://www.orientdb.org
  4. ^ http://djondb.com
  5. ^ 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. 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[...]" 
  6. ^ "NoSQL Relational Database Management System: Home Page". Strozzi.it. 2 October 2007. Retrieved 29 March 2010. 
  7. ^ "NoSQL 2009". Blog.sym-link.com. 12 May 2009. Retrieved 29 March 2010. 
  8. ^ Mike Chapple. "The ACID Model". 
  9. ^ Avram, Abel (04 August 2011). "Interview: Richard Hipp on UnQL, a New Query Language for Document Databases". http://www.infoq.com. Retrieved 7 September 2011. 
  10. ^ 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. 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." 
  11. ^ 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. 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." 
  12. ^ "Riak: An Open Source Scalable Data Store". 28 November 2010. Retrieved 28 November 2010. 
  13. ^ Tweed, Rob; George James (2010). "A Universal NoSQL Engine, Using a Tried and Tested Technology" (PDF). p. 25. "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é..." 
  14. ^ JBoss Infinispan

Further reading [edit]

  • 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. 

External links [edit]