Jump to content

LevelDB

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 62.192.249.33 (talk) at 10:53, 22 October 2016 (Fixed MDB microbenchmarks link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

LevelDB
Developer(s)Jeffrey Dean, Sanjay Ghemawat
Repository
Written inC++
Size350 kB (binary size)
TypeDatabase library
LicenseNew BSD License
Websitegithub.com/google/leveldb

LevelDB is an open source on-disk key-value store written by Google fellows Jeffrey Dean and Sanjay Ghemawat.[1][2] Inspired by Bigtable,[3] LevelDB is hosted on GitHub under the New BSD License and has been ported to a variety of Unix-based systems, Mac OS X, Windows, and Android.[4]

Features

LevelDB stores keys and values in arbitrary byte arrays, and data is sorted by key. It supports batching writes, forward and backward iteration, and compression of the data via Google's Snappy compression library.

LevelDB is not an SQL database. Like other NoSQL and Dbm stores, it does not have a relational data model and it does not support SQL queries. Also, it has no support for indexes. Applications use LevelDB as a library, as it does not provide a server or command-line interface.

MariaDB 10.0 comes with a storage engine which allows users to query LevelDB tables from MariaDB.[5]

History

LevelDB is based on concepts from Google's BigTable database system. The table implementation for the BigTable system was developed starting in about 2004, and is based on a different Google internal code base than the LevelDB code. That code base relies on a number of Google code libraries that are not themselves open sourced, so directly open sourcing that code would have been difficult. Jeff Dean and Sanjay Ghemawat wanted to create a system resembling the BigTable tablet stack that had minimal dependencies and would be suitable for open sourcing, and also would be suitable for use in Chrome for the IndexedDB implementation. They wrote LevelDB starting in early 2011, with the same general design as the BigTable tablet stack, but not sharing any of the code.[6]

Usage

LevelDB is used as the backend database for Google Chrome's IndexedDB and is one of the supported backends for Riak.[7] Additionally, Bitcoin Core stores the blockchain metadata using a LevelDB database.[8] Minecraft: Pocket Edition uses a modified version for chunk and entity data storage.[9] Autodesk AutoCAD 2016 also uses LevelDB.

Performance

Google has provided benchmarks comparing LevelDB's performance to SQLite and Kyoto Cabinet in different scenarios.[10] LevelDB outperforms both SQLite and Kyoto Cabinet in write operations and sequential-order read operations. LevelDB also excels at batch writes, but is slower than SQLite when dealing with large values. The currently published benchmarks were updated after SQLite configuration mistakes were noted in an earlier version of the results.[11] Updated benchmarks[12] show that LevelDB also outperforms Berkeley DB, but these tests also show that OpenLDAP LightningDB is much faster (~10 times in some scenarios) in read operations and some write types (e.g. batch and synchronous writes, see the link above), and is almost equal in the rest of the test.

Bugs and reliability

LevelDB is widely noted for being unreliable and databases it manages are prone to corruption.[13][14][15][16][17][18][19][20] Academic studies of past versions of LevelDB[21][22] have found that, under some file systems, the data stored in those versions of LevelDB might become inconsistent after a system crash or power failure. LevelDB corruption is so commonplace that corruption detection has to be built in to applications that use it.[23]

See also

References

  1. ^ "Google Research Scientists and Engineers: Jeffrey Dean". Google, Inc.
  2. ^ "Research Scientists and Engineers: Sanjay Ghemawat". Google, Inc.
  3. ^ "Google Open-Sources NoSQL Database Called LevelDB". ReadWriteWeb. July 30, 2011. Retrieved July 30, 2011.
  4. ^ "Google Open Source Blog: LevelDB: A Fast Persistent Key-Value Store". Google, Inc.
  5. ^ LevelDB storage engine
  6. ^ Jeff Dean. "LevelDB mailing list: "Current Status of LevelDB"".
  7. ^ LevelDB. Docs.basho.com. Retrieved on 2013-09-18.
  8. ^ Andreas M. Antonopoulos. "Chapter 7. The Blockchain". Retrieved 8 January 2015.
  9. ^ https://minecraft.gamepedia.com/Pocket_Edition_level_format
  10. ^ "LevelDB Benchmarks". Google, Inc.
  11. ^ "LevelDB Benchmark discussion".
  12. ^ Database Microbenchmarks, Symas Corp., 2012-09. Retrieved 22 October 2016
  13. ^ Repairing LevelDB
  14. ^ Claiming Bitcoin's Bug Bounty
  15. ^ Issues · google/leveldb · GitHub
  16. ^ Unrecoverable corruption in Chromium
  17. ^ Corruption in syncthing
  18. ^ Corruption after power loss
  19. ^ Corruption in Ethereum
  20. ^ Corruption in Bitcoin for multiple users
  21. ^ "Application-Level Crash Vulnerabilities" (PDF).
  22. ^ "All File Systems Are Not Created Equal: On the Complexity of Crafting Crash-Consistent Applications".
  23. ^ ActiveMQ paranoidChecks