HOME

TheInfoList



OR:

Bitcask is an Erlang application that provides an API for storing and retrieving key/value data into a log-structured
hash table In computer science, a hash table is a data structure that implements an associative array, also called a dictionary or simply map; an associative array is an abstract data type that maps Unique key, keys to Value (computer science), values. ...
. The design owes a lot to the principles found in
log-structured file system A log-structured filesystem is a file system in which data and metadata are written sequentially to a circular buffer, called a log. The design was first proposed in 1988 by John K. Ousterhout and Fred Douglis and first implemented in 1992 by ...
s and draws inspiration from a number of designs that involve log file merging.


Strengths

Bitcask has a number of advantages owing to its write-once, append-only on-disk data-format and its use of an in-memory hash-table of keys for lookups: * Low latency for read and write operations. * High throughput, especially when writing an incoming stream of random items: Because the data being written doesn't need to be ordered on disk and because the log-structured design allows for minimal disk-head movement during writes, these operations generally saturate the I/O and disk bandwidth. * Single seek to retrieve any value: Bitcask's in-memory hash-table of keys points directly to the locations on disk where the data resides. Bitcask never needs more than one disk-seek to read a value, and the operating system's file-system caching can obviate the need for disk-seeks entirely for some lookups. * Predictable lookup and insert performance: Read operations as well as write operations have fixed, predictable behavior. Write operations require only a seek to the end of the current file that is open for writing and an append to that file. * Fast, bounded crash recovery: Bitcask's disk format makes recovery straightforward. The only items that might be lost are partially written records at the tail of the file last opened for writes. Recovery need only review the last record or two written and verify
checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify dat ...
s to ensure that the data is consistent. * Easy backup: Bitcask's disk format means that any utility that archives or copies files in disk-block order will properly backup or copy a Bitcask database.


Weakness

Because Bitcask keeps all keys in memory at all times, the system must have enough memory to contain the entire keyspace in addition to other operational components and the operating system's file-system buffers.


References

{{reflist


External links


Official Bitcask Design Paper

Bitcask Capacity Calculator



Which is Better Bitcask or LevelDB?
Free software programmed in Erlang Database engines Key-value databases Software using the Apache license