Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:LevelDB

From ReverseEngineering.wiki
Library
Developer Google
License BSD-3-Clause
Website https://github.com/google/leveldb
On this wiki Facts · Code · Notes · Topics

Google's embedded ordered key-value store (C++, BSD-3-Clause), linked into Chromium, Electron apps and many desktop and mobile apps; its on-disk format is described at Format:LevelDB database.

Overview

LevelDB provides a single-process, sorted key-value store with an LSM-tree design (memtable, write-ahead log, leveled tables). Applications embed it as a static library, so binaries rarely export symbols. File formats: Format:LevelDB database.

Identifying it in a binary

The table magic bytes 57 FB 80 8B 24 75 47 DB (0xdb4775248b80fb57) appear in the code that writes and checks footers, and the MANIFEST holds the comparator name (default leveldb.BytewiseComparator). Source check (google/leveldb commit bb74ef739973a70ca9f0d90788a1da89b788c0ad): the comparator name is one literal, return "leveldb.BytewiseComparator"; in util/comparator.cc line 25. The property names are not stored whole: DBImpl::GetProperty in db/db_impl.cc (lines 1412-1417) tests the prefix "leveldb.", removes it, then compares the rest with "num-files-at-level", so a binary holds leveldb. and num-files-at-level as separate strings and a search for the joined leveldb.num-files-at-level finds nothing in this version.

Forks

Library:RocksDB is a fork with extra table formats and options. Unverified: Chromium carries its own copy under third_party/leveldatabase and differences from upstream.

Code & repositories

  • https://github.com/google/leveldb @ bb74ef739973a70ca9f0d90788a1da89b788c0ad · license: BSD-3-Clause (read from LICENSE; GitHub's API was busy)
    Reference LevelDB implementation; doc/log_format.md and doc/table_format.md define the file formats.
    Tested on: source read, not run: read source and docs · checked 2026-10-18

See also

Library:Snappy, Library:SQLite