LevelDB
Encyclopedia
LevelDB is an open source
on-disk key-value store written by Google
Fellows Jeffrey Dean and Sanjay Ghemawat, who built parts of Google's platform
. Inspired by BigTable
, LevelDB is hosted on Google Code
under the New BSD License and has been ported to a variety of Unix
-based systems, Mac OS X
, Windows
, and Android.
compression library.
Still, LevelDB is not a SQL
database. Like other NoSQL
and Dbm
stores, it does not have a relational data model, it does not support SQL queries, and it has no support for indexes
. Applications use LevelDB as a library, as it does not provide a server or command-line interface.
database system. The tablet 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.
and Kyoto Cabinet
in different scenarios. 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.
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...
on-disk key-value store written by Google
Google
Google Inc. is an American multinational public corporation invested in Internet search, cloud computing, and advertising technologies. Google hosts and develops a number of Internet-based services and products, and generates profit primarily from advertising through its AdWords program...
Fellows Jeffrey Dean and Sanjay Ghemawat, who built parts of Google's platform
Google platform
Google requires large computational resources in order to provide their services. This article describes the technological infrastructure behind Google's websites, as presented in the company's public announcements.-Original hardware:...
. Inspired by BigTable
BigTable
BigTable is a compressed, high performance, and proprietary database system built on Google File System , Chubby Lock Service, SSTable and a few other Google technologies; it is currently not distributed nor is it used outside of Google, although Google offers access to it as part of their Google...
, LevelDB is hosted on Google Code
Google Code
Google Code is Google's site for developer tools, APIs and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products....
under the New BSD License and has been ported to a variety of Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
-based systems, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
, Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, and Android.
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 SnappySnappy
Snappy is a fast compression and decompression library based on LZ77's ideas developed by Google. It was designed to be very fast and stable, but not to achieve a high compression ratio. Compression speed is 250 MB/s and decompression speed is 500 MB/s using a single threaded, 64-bit Core i7...
compression library.
Still, LevelDB is not a SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....
database. Like other NoSQL
Nosql
In computing, NoSQL is a broad class of database management systems that differ from the classic model of the relational database management system in some significant ways. These data stores may not require fixed table schemas, usually avoid join operations, and typically scale horizontally...
and Dbm
Dbm
dbm was the first of a family of simple database engines, originally written by Ken Thompson and released by AT&T in 1979. The name is a three letter acronym for database manager....
stores, it does not have a relational data model, it does not support SQL queries, and it has no support for indexes
Index (database)
A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space...
. Applications use LevelDB as a library, as it does not provide a server or command-line interface.
History
LevelDB is based on concepts from Google's BigTableBigTable
BigTable is a compressed, high performance, and proprietary database system built on Google File System , Chubby Lock Service, SSTable and a few other Google technologies; it is currently not distributed nor is it used outside of Google, although Google offers access to it as part of their Google...
database system. The tablet 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.
Performance
Google has provided benchmarks comparing LevelDB's performance to SQLiteSQLite
SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...
and Kyoto Cabinet
Dbm
dbm was the first of a family of simple database engines, originally written by Ken Thompson and released by AT&T in 1979. The name is a three letter acronym for database manager....
in different scenarios. 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.