An embeddable, persistent key-value database written in pure Go, with ACID transactions and SSD-oriented design.
google/leveldb
A fast embedded key-value storage library from Google that keeps string keys and values in sorted order.
- Stars
- 39,503
- Forks
- 8,230
- Open issues
- 425
- Last commit
- 13 days ago
What is it?
LevelDB is an embedded key-value store written in C++ at Google. It maps arbitrary byte-string keys to byte-string values and keeps the data sorted by key, so applications can iterate forward or backward over ranges. It is a library linked into a process rather than a server, and a single process (possibly multi-threaded) can open a given database at a time.
The API centers on Put, Get and Delete, with atomic write batches and transient snapshots for consistent reads. Data is compressed with Snappy by default, and Zstd is also supported. Operating system interactions such as file access go through a virtual interface that callers can replace.
LevelDB is not a SQL database and has no indexes, relational model or built-in client-server layer. The project is in limited maintenance mode, accepting mainly critical bug fixes and compatibility changes. It builds with CMake on POSIX systems and Windows.
Key features
- 01Keys and values are arbitrary byte arrays, stored sorted by key.
- 02Supports custom comparison functions to change the sort order.
- 03Provides atomic write batches and transient snapshots.
- 04Supports forward and backward iteration over data.
- 05Compresses data with Snappy by default, with Zstd support.
- 06Lets callers replace the OS interaction layer through a virtual interface.
Use cases
- Embedding a fast local key-value cache or index inside a C++ application.
- Storing ordered data that needs range scans by key.
- Building a custom storage engine or server on top of an embedded store.
Quick start
- 1
Clone the repository with submodules
git clone --recurse-submodules https://github.com/google/leveldb.git - 2
Create a build directory and configure with CMake
mkdir -p build && cd build cmake -DCMAKE_BUILD_TYPE=Release .. - 3
Build the library
cmake --build .
Things to know
- Only a single process (possibly multi-threaded) can access a particular database at a time.
- It is not a SQL database and has no built-in client-server support, indexes, or relational model.
- The repository receives very limited maintenance; only critical bug fixes and breakage fixes are reviewed.
Topics
FAQ
- What is leveldb?
- A fast embedded key-value storage library from Google that keeps string keys and values in sorted order. LevelDB is an embedded key-value store written in C++ at Google. It maps arbitrary byte-string keys to byte-string values and keeps the data sorted by key, so applications can iterate forward or backward over ranges. It is a library linked into a process rather than a server, and a single process (possibly multi-threaded) can open a given database at a time.
- Is leveldb free to use? What license does it have?
- leveldb is open source under the BSD-3-Clause license. Check the license terms before using it in commercial products.
- Is leveldb still maintained?
- Actively maintained. The last commit to leveldb was on Oct 8, 2026.
- What can I use leveldb for?
- Embedding a fast local key-value cache or index inside a C++ application. Storing ordered data that needs range scans by key. Building a custom storage engine or server on top of an embedded store.
- How do I install leveldb?
- Clone the repository with submodules: git clone --recurse-submodules https://github.com/google/leveldb.git Create a build directory and configure with CMake: mkdir -p build && cd build cmake -DCMAKE_BUILD_TYPE=Release .. Build the library: cmake --build .
- Where can I get leveldb?
- The source code and installation instructions are on GitHub: https://github.com/google/leveldb
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
DuckDB is an in-process analytical SQL database that runs inside your application with no separate server to manage.
An in-process SQL database written in Rust, compatible with SQLite's dialect, file format and C API, with an experimental Postgres frontend.
A free, cross-platform visual tool for creating, browsing, editing and querying SQLite database files without writing SQL.
An open source, open contribution fork of SQLite that adds embedded replicas, a remote server mode, and extensions to the SQLite core.
A cross-platform hex editor for reverse engineering and binary analysis, with a pattern language for parsing file structures.