BT

Google Has Open Sourced LevelDB, A Key-Value Datastore

by Abel Avram on Jul 29, 2011 |

Google has open sourced LevelDB under the New BSD license. LevelDB is an embedded key-value datastore whose keys and associated values are arbitrary byte arrays sorted by key, a sorting mechanism that can be overridden. The datastore is pretty simple, accepting Put, Get, and Delete commands along with forward and backward iterations.

Data is automatically compressed using Snappy, a compression library used by Google for BigTable, MapReduce, and RPC and open sourced in April. LevelDB has some limitations: no support for SQL queries or indexes, supports multi-threaded single process access and is embedded, which is an advantage for some projects and a problem for others.

LevelDB is optimized for batch write operations. Multiple changes are accumulated and sorted in memory then written to disk when a certain configurable file size threshold is reached. The result is good performance for sequential and random writes, and sequential reads, beating SQLite by two orders of magnitude in some tests, according to a Google performance benchmark. SQLite remains a bit faster than LevelDB for random reads and at least twice as fast in writing large values. LevelDB also performed better than Kyoto Cabinet, a similar key-value store, but not as well as compared to SQLite. Also, some tests were performed by Riak comparing LevelDB with InnoDB, Google’s DB outperforming InnoDB in some tests or had similar performance.

LevelDB has been written in C++, and has few external dependencies being ported successfully to Windows, Mac OS X, Android, and various UNIXs. LevelDB is used by experimental versions of Chrome as the implementation for IndexDB API, by Riak for storage at node level, and by UpNext, a company doing 3D mapping software.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Check out RaptorDB by M. Gholam

It's a KV store which operates at 80% hard disk speed built on .net

www.codeproject.com/KB/database/RaptorDB.aspx

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT