A key–value database, or key–value store, is a data storage paradigm designed for storing, retrieving, and managing associative arrays, and a data structure more commonly known today as a dictionary or hash table. Dictionaries contain a collection of objects, or records, which in turn have many different fields within them, each containing data. These records are stored and retrieved using a key that uniquely identifies the record, and is used to find the data within the database.
Key–value databases work in a very different fashion from the better known relational databases (RDB). RDBs predefine the data structure in the database as a series of tables containing fields with well defined data types. Exposing the data types to the database program allows it to apply a number of optimizations. In contrast, key–value systems treat the data as a single opaque collection, which may have different fields for every record. This offers considerable flexibility and more closely follows modern concepts like object-oriented programming. Because optional values are not represented by placeholders or input parameters, as in most RDBs, key–value databases often use far less memory to store the same database, which can lead to large performance gains in certain workloads.
Performance, a lack of standardization and other issues limited key–value systems to niche uses for many years, but the rapid move to cloud computing after 2010 has led to a renaissance as part of the broader NoSQL movement. Some graph databases, such as ArangoDB, are also key–value databases internally, adding the concept of the relationships (pointers) between records as a first class data type.
Types and notable examples
Every entity (record) is a set of key–value pairs. A key has multiple components, specified as an ordered list. The major key identifies the record and consists of the leading components of the key. The subsequent components are called minor keys. This organization is similar to a directory path specification in a file system (e.g., /Major/minor1/minor2/). The “value” part of the key–value pair is simply an uninterpreted string of bytes of arbitrary length.
The Unix system provides dbm (database manager), which is a 1979 library originally written by Ken Thompson. It is also ported to Microsoft Windows, provided through programming languages such as Perl for Win32. The dbm manages associative arrays of arbitrary data by use of a single key (a primary key). Modern implementations include Berkeley DB, sdbm, and GNU dbm. Although dbm precedes the concept of a NoSQL and is rarely mentioned in modern discourse, it is used by many pieces of software.
|Berkeley DB||AGPL, Proprietary||Yes|
|Clusterpoint Database Server||Proprietary|
|IBM Informix C-ISAM||Proprietary||Yes|
|Microsoft SQL Server||Proprietary||Yes||Yes|
|Oracle NoSQL Database||AL2, Proprietary||Yes|
|RocksDB||AL2 or GPL 2||Yes|
|OpenLink Virtuoso||GPLv2, proprietary||Yes||Yes|
- Big data
- Data analysis
- Distributed data store
- Document-oriented database
- Multi-model database
- Tuple space
- "Storage Engines". ArangoDB. Retrieved 16 November 2020.
- Oracle NoSQL Database.
- Tweed, Rob; James, George (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é.....*
- "Open Source key-value store with built-in cryptographic proofs".
The internal transaction processing flow and cryptographic linking were specifically designed for leveraging the key-value model. It supports indexing, scanning, data-compression among other capabilities you would expect from a key-value storage. It can be embedded into any system and by following a cryptographic protocol it’s capable of ensuring immutability to any extent.
- "Riak: An Open Source Scalable Data Store". 28 November 2010. Archived from the original on 31 December 2010. Retrieved 28 November 2010.