SDB
activeby pancake and the radare2 project · since 2012 · also known as sdb (string database), radare sdb
Tiny embeddable C string key-value database from the radare2 project, built on djb's cdb format.
Overview
SDB is a small string key-value database written in C by pancake (Sergi Alvarez) and maintained by the radare2 organisation, where it stores the metadata radare2 accumulates while analysing binaries. Data lives in memory and is synced atomically to a compact variant of D. J. Bernstein's cdb on-disk hash format, so a database file is never left half-written. On top of plain keys it adds namespaces, array syntax, JSON path get/set, numeric increment and decrement, glob-based deletes and a command-line shell; a companion mcsdbd daemon serves the data over the memcached protocol, and it compiles with Emscripten for JavaScript. It is MIT-licensed and actively maintained, with 2.5.x releases in 2026.
Strengths & trade-offs
Strengths
- +Very small, dependency-free C library that is easy to vendor
- +Atomic sync to cdb files means the on-disk database is never corrupted
- +Namespaces, arrays and JSON-path access on plain string keys
- +Battle-tested as radare2's internal metadata store
- +Permissive MIT license and active maintenance
Trade-offs
- −Values are strings; no typed data, secondary indexes or queries
- −Sync rewrites the cdb file, which gets slow for large databases
- −Single-process: no concurrent writers or networking beyond the memcached shim
Great for
- +Embedded configuration and metadata storage in C programs
- +Storing analysis state in reverse-engineering tools
- +Lightweight persistent caches with a memcached front end
Think twice for
- −Multi-user or networked databases
- −Large datasets
- −Relational queries
Capabilities
Native or official first-party support · 3 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- Limited ACID
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded, In memory
- Query languages
- sdb command syntax
Single-process library; whole databases are rewritten on sync, so it suits small to medium datasets.
Deployment
Ecosystem
Alternatives to SDB
Tiny memory-mapped B+tree with ACID transactions and lock-free readers; reached 1.0 in 2026.
sdb vs lmdb →Google's original small, fast LSM key-value library, now in limited-maintenance mode.
sdb vs leveldb →FAL Labs' C++ DBM library with hash and B+tree files; superseded by its author's Tkrzw.
sdb vs kyoto-cabinet →Embedded, transactional key-value and JSON document engine in a single C file, with Jx9 scripting.
sdb vs unqlite →The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.
sdb vs sqlite →Pure-Python document store that keeps every table in one human-readable JSON file.
sdb vs tinydb →SDB FAQ
What is SDB?
SDB is a key-value database by pancake and the radare2 project, first released in 2012. SDB is a small string key-value database written in C by pancake (Sergi Alvarez) and maintained by the radare2 organisation, where it stores the metadata radare2 accumulates while analysing binaries. Data lives in memory and is synced atomically to a compact variant of D. J. Bernstein's cdb on-disk hash format, so a database file is never left half-written. On top of plain keys it adds namespaces, array syntax, JSON path get/set, numeric increment and decrement, glob-based deletes and a command-line shell; a companion mcsdbd daemon serves the data over the memcached protocol, and it compiles with Emscripten for JavaScript. It is MIT-licensed and actively maintained, with 2.5.x releases in 2026.
Is SDB open source?
Yes. SDB is open source. License: MIT License.
Does SDB support ACID transactions?
Partly. SDB offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.
Does SDB scale horizontally?
SDB does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).
How can I run SDB?
You can self-host it and embed it in your application.
What is SDB best for?
SDB is a strong fit for embedded configuration and metadata storage in C programs; storing analysis state in reverse-engineering tools; and lightweight persistent caches with a memcached front end. Think twice for multi-user or networked databases.
What are the best alternatives to SDB?
Common alternatives to SDB include LMDB, LevelDB, Kyoto Cabinet, UnQLite and SQLite. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is SDB?
SDB ranks #530 of 844 databases on the WhichDB Score (1.6/100), and #85 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.
