Pebble
activeby Cockroach Labs · since 2020 · also known as CockroachDB Pebble
Cockroach Labs' Go LSM engine, inspired by RocksDB and tuned for CockroachDB.
Overview
Pebble is a LevelDB/RocksDB-inspired log-structured merge-tree key-value store written in Go by Cockroach Labs, which replaced RocksDB as CockroachDB's storage engine in 2020. Writing it in Go removed the cgo boundary and let the team implement only the features CockroachDB needs, with improvements such as range keys, faster ingestion and better compaction heuristics. Outside CockroachDB it is used by Ethereum's Geth client and other Go systems that want a fast, well-tested LSM. Its API and feature set track CockroachDB's needs, so some RocksDB features (transactions, column families) are deliberately absent.
Strengths & trade-offs
Strengths
- +Pure Go LSM with no cgo overhead
- +Battle-tested as CockroachDB's storage engine
- +Range keys, range deletions and efficient SST ingestion
- +Extensive metrics and tooling for compaction debugging
Trade-offs
- −No built-in transactions or column families
- −API evolves with CockroachDB's needs
- −Go-only
- −Tuning LSM compaction still requires expertise
Great for
- +Storage engine for Go databases
- +Blockchain node state (Geth)
- +Write-heavy embedded key-value stores in Go services
Think twice for
- −Applications needing multi-key transactions from the engine
- −Non-Go stacks
- −Simple read-mostly embedded storage (bbolt is simpler)
Capabilities
Native or official first-party support · 3 of 25 tracked
Scale & consistency
- Comfortable data size
- Medium · ≤ 10 TB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- Limited ACID
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded
- Query languages
- Go API
Single-process engine; multi-TB stores per node in CockroachDB.
Deployment
Ecosystem
Alternatives to Pebble
Meta's embeddable LSM-tree key-value engine, the storage layer under dozens of databases.
pebble vs rocksdb →Pure-Go LSM key-value store that separates keys from values to cut write amplification.
pebble vs badger →etcd's maintained fork of BoltDB: a simple, pure-Go B+tree store in a single file.
pebble vs bbolt →Google's original small, fast LSM key-value library, now in limited-maintenance mode.
pebble vs leveldb →Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.
pebble vs cockroachdb →Heavily reworked LMDB descendant: memory-mapped ACID B+tree with auto-growing files.
pebble vs libmdbx →Pebble FAQ
What is Pebble?
Pebble is a key-value database by Cockroach Labs, first released in 2020. Pebble is a LevelDB/RocksDB-inspired log-structured merge-tree key-value store written in Go by Cockroach Labs, which replaced RocksDB as CockroachDB's storage engine in 2020. Writing it in Go removed the cgo boundary and let the team implement only the features CockroachDB needs, with improvements such as range keys, faster ingestion and better compaction heuristics. Outside CockroachDB it is used by Ethereum's Geth client and other Go systems that want a fast, well-tested LSM. Its API and feature set track CockroachDB's needs, so some RocksDB features (transactions, column families) are deliberately absent.
Is Pebble open source?
Yes. Pebble is open source. License: BSD 3-Clause License.
Does Pebble support ACID transactions?
Partly. Pebble offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.
Does Pebble scale horizontally?
Pebble does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at medium scale (≤ 10 TB).
How can I run Pebble?
You can self-host it and embed it in your application.
What is Pebble best for?
Pebble is a strong fit for storage engine for Go databases, blockchain node state (Geth) and write-heavy embedded key-value stores in Go services. Think twice for applications needing multi-key transactions from the engine.
What are the best alternatives to Pebble?
Common alternatives to Pebble include RocksDB, Badger, bbolt, LevelDB and CockroachDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is Pebble?
Pebble ranks #379 of 844 databases on the WhichDB Score (5.6/100), and #54 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.