Ordered Key-Value Store
An Ordered Key-Value Store (OKVS) is a type of data storage paradigm that can support
History
The origin of Ordered Key-Value Store stems from the work of
Other notable implementation of the OKVS paradigm are Sophia[2] and SQLite3 LSM extension. Another notable use of OKVS paradigm is the multi-model database system called ArangoDB[3] 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.
Key concepts
Lexicographic encoding
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]
Range query
Inside an OKVS, keys are ordered, and because of that it is possible to do range queries. A range query allow to retrieve all keys between two keys such as all keys that are fetched are ordered.
Subspaces
Key composition
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
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.
Higher level abstractions
The following abstraction or databases were built on top Ordered Key-Value Stores:
- Timeseries database,
- Record Database,[5] also known as Row store databases, they behave similarly to what is dubbed RDBMS,
- Tuple Stores, also known as Triple Store or Quad Store but also Generic Tuple Store,[6][7]
- Document database,[8] that mimics MongoDB API,
- Full-text search[9]
- Geographic Information Systems[10]
- Property Graph[11]
- Versioned Data[12]
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.
Feature matrix
OKVS | License | Transactions | Distributed | In-memory | Multiple threads | Multiple processes |
---|---|---|---|---|---|---|
Berkeley DB | AGPL | Yes | No | No | yes | yes |
WiredTiger | GPL | Yes | No | Yes | yes | no |
LevelDB | Apache | No | No | No | no | |
Kyoto Cabinet
|
GPL | Yes | No | No | no | |
RocksDB | Apache | Yes | No | No | yes | no |
SQLite LSM Extension | Public domain | Yes1 | No | Yes | yes2 | yes2 |
TiKV
|
Apache | Yes | Yes | No | yes | yes |
FoundationDB | Apache | Yes | Yes | Yes | yes | yes |
- SQLite LSM extension's transactions can be nested
- SQLite LSM extension support multiple readers, and only a single writer that do not block readers
See also
- Key–value_database
- Wide Column Store
- Multi-model database
References
- ^ "11.11. bsddb — Interface to Berkeley DB library — Python 2.7.17 documentation". docs.python.org. Retrieved 2020-01-16.
- ^ "sophia - modern transactional key-value/row storage library". sophia.systems. Retrieved 2020-01-16.
- ^ "Comparing new RocksDB and MMFiles storage engines". ArangoDB. Retrieved 2020-01-16.
- ^ "Python API — FoundationDB 6.2". apple.github.io. Retrieved 2020-01-19.
- ^ A record-oriented store built on FoundationDB., FoundationDB, 2020-01-16, retrieved 2020-01-17
- ^ "Generic Tuple Store Database". srfi.schemers.org. Retrieved 2020-01-17.
- ^ "Generic Tuple Store". GitHub.
- ^ A document data model on FoundationDB, implementing MongoDB® wire protocol: FoundationDB/fdb-document-layer, FoundationDB, 2019-12-09, retrieved 2020-01-17
- ^ meilisearch/MeiliSearch, MeiliSearch, 2021-06-19, retrieved 2021-06-19
- ^ "6.1. GeoMesa Index Structure — GeoMesa 1.3.1 Manuals". www.geomesa.org. Retrieved 2020-01-19.
- ^ "The JanusGraph FoundationDB Storage Adapter - Ted Wilmes, Expero Inc". www.youtube.com. Retrieved 2020-01-17.
- ^ "Lightning Talk: Entity Store: A FoundationDB Layer for Versioned... - Stephen Pimentel, - YouTube". www.youtube.com. Retrieved 2020-01-17.