The origin of Ordered Key-Value Store stems from the work of Ken Thompson on dbm in 1979. Later in 1991, Berkeley DB was released that featured a B-Tree backend that allowed the keys to stay sorted. Berkeley DB was said to be very fast and made its way into various commercial product. It was included in Python standard library until 2.7.1 In 2009, Tokyo Cabinet was released that was superseded by Kyoto Cabinet that support both transaction and ordered keys. In 2011, LMDB was created to replace Berkeley DB in OpenLDAP. There is also Google's LevelDB that was forked by Facebook in 2012 as RocksDB. In 2014, WiredTiger, successor of Berkeley DB was acquired by MongoDB and is since 2019 the primary backend of MongoDB database.
Other notable implementation of the OKVS paradigm are Sophia2 and SQLite3 LSM extension. Another notable use of OKVS paradigm is the multi-model database system called ArangoDB3 based on RocksDB.
Some NewSQL databases are supported by Ordered Key-Value Stores. JanusGraph, a property graph database, has both a Berkeley DB backend and FoundationDB backend.
There are algorithms that encode basic data types (boolean, string, number) and composition of those data types inside sorted containers (tuple, list, vector) that preserve their natural ordering. It is possible to work with an Ordered Key-Value Store without having to work directly with bytes. In FoundationDB, it is called the tuple layer.4
Inside an OKVS, keys are ordered, and because of that it is possible to do range queries. A range query retrieves all keys between two specified keys, ensuring that the fetched keys are returned in a sorted order.
One can construct key spaces to build higher level abstractions. The idea is to construct keys, that takes advantage of the ordered nature of the top level key space. When taking advantage of the ordered nature of the key space, one can query ranges of keys that have particular pattern.
Denormalization, as in, repeating the same piece of data in multiple subspace is common practice. It allows to create secondary representation, also called indices, that will allow to speed up queries.
The following abstraction or databases were built on top Ordered Key-Value Stores:
All those abstraction can co-exist with the same OKVS database and when ACID is supported, the operations happens with the guarantees offered by the transaction system.
"11.11. bsddb — Interface to Berkeley DB library — Python 2.7.17 documentation". docs.python.org. Retrieved 2020-01-16. https://docs.python.org/2/library/bsddb.html ↩
"sophia - modern transactional key-value/row storage library". sophia.systems. Retrieved 2020-01-16. http://sophia.systems/ ↩
"Comparing new RocksDB and MMFiles storage engines". ArangoDB. Retrieved 2020-01-16. https://www.arangodb.com/why-arangodb/rocksdb-storage-engine/ ↩
"Python API — FoundationDB 6.2". apple.github.io. Retrieved 2020-01-19. https://apple.github.io/foundationdb/api-python.html#api-python-tuple-layer ↩
A record-oriented store built on FoundationDB., FoundationDB, 2020-01-16, retrieved 2020-01-17 https://github.com/FoundationDB/fdb-record-layer ↩
"Generic Tuple Store Database". srfi.schemers.org. Retrieved 2020-01-17. https://srfi.schemers.org/srfi-168/ ↩
"Generic Tuple Store". GitHub. https://github.com/amirouche/hoply/ ↩
A document data model on FoundationDB, implementing MongoDB® wire protocol: FoundationDB/fdb-document-layer, FoundationDB, 2019-12-09, retrieved 2020-01-17 https://github.com/FoundationDB/fdb-document-layer ↩
meilisearch/MeiliSearch, MeiliSearch, 2021-06-19, retrieved 2021-06-19 https://github.com/meilisearch/MeiliSearch ↩
"6.1. GeoMesa Index Structure — GeoMesa 1.3.1 Manuals". www.geomesa.org. Retrieved 2020-01-19. https://www.geomesa.org/documentation/1.3.1/user/datastores/index_structure.html ↩
"The JanusGraph FoundationDB Storage Adapter - Ted Wilmes, Expero Inc". www.youtube.com. Retrieved 2020-01-17. https://www.youtube.com/watch?v=rQM_ZPZy8Ck ↩
"Lightning Talk: Entity Store: A FoundationDB Layer for Versioned... - Stephen Pimentel, - YouTube". www.youtube.com. Retrieved 2020-01-17. https://www.youtube.com/embed/16uU_Aaxp9Y?autoplay=1&feature=oembed&wmode=opaque ↩
meilisearch/arroy, Meilisearch, 2024-08-05, retrieved 2024-08-06 https://github.com/meilisearch/arroy ↩