BuntDB
maintenanceby Josh Baker (tidwall) · since 2016
Embeddable in-memory key/value store for Go with ACID transactions, custom and spatial indexes, and TTLs.
maintenance. Feature-complete; last code release v1.3.2 (Sept 2024), with only documentation commits since.
Overview
BuntDB is a pure-Go, in-process key/value store by Josh Baker (tidwall) that keeps the whole dataset in memory and persists it to a durable append-only file that it compacts in the background. What sets it apart from a map or bbolt is indexing: you can declare B-tree indexes over values with custom comparators, index fields inside JSON values, build multi-value indexes, and create R-tree spatial indexes over up to 20 dimensions, then iterate ranges or nearby items inside read-only or read/write transactions with rollback. Keys can carry TTLs for cache-style eviction. It is mature and essentially feature-complete: v1.3.2 shipped in September 2024 and later commits are documentation only. Use it when the data fits in RAM and you want indexes without running a server.
Strengths & trade-offs
Strengths
- +Secondary B-tree indexes with custom comparators, including indexes on JSON fields
- +R-tree spatial indexes over up to 20 dimensions for intersects and nearby queries
- +Read/write transactions with rollback on a single-writer, multi-reader lock
- +Per-key TTL expiry and a durable append-only file with configurable fsync
- +Pure Go with no cgo, so it embeds trivially
Trade-offs
- −Entire dataset lives in memory, so capacity is bounded by RAM
- −Only one writer at a time limits write concurrency
- −No replication or network server; you build that yourself
- −Little ongoing development beyond fixes
Great for
- +Embedded state or config store inside Go services
- +In-process geospatial lookups
- +Local cache with TTL-based eviction
- +Indexed data access in prototypes without a database server
Think twice for
- −Datasets larger than available RAM
- −Write-heavy concurrent workloads
- −Multi-process or networked access
Capabilities
Native or official first-party support · 7 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- Full ACID
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded, In memory
- Query languages
- Go API
Whole dataset must fit in RAM; persistence is a single append-only file rewritten in the background.
Deployment
Ecosystem
Alternatives to BuntDB
etcd's maintained fork of BoltDB: a simple, pure-Go B+tree store in a single file.
buntdb vs bbolt →Pure-Go LSM key-value store that separates keys from values to cut write amplification.
buntdb vs badger →Cockroach Labs' Go LSM engine, inspired by RocksDB and tuned for CockroachDB.
buntdb vs pebble →In-memory geospatial database and geofencing server that speaks the Redis protocol and HTTP.
buntdb vs tile38 →The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.
buntdb vs redis →The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.
buntdb vs sqlite →BuntDB FAQ
What is BuntDB?
BuntDB is a key-value database by Josh Baker (tidwall), first released in 2016. BuntDB is a pure-Go, in-process key/value store by Josh Baker (tidwall) that keeps the whole dataset in memory and persists it to a durable append-only file that it compacts in the background. What sets it apart from a map or bbolt is indexing: you can declare B-tree indexes over values with custom comparators, index fields inside JSON values, build multi-value indexes, and create R-tree spatial indexes over up to 20 dimensions, then iterate ranges or nearby items inside read-only or read/write transactions with rollback. Keys can carry TTLs for cache-style eviction. It is mature and essentially feature-complete: v1.3.2 shipped in September 2024 and later commits are documentation only. Use it when the data fits in RAM and you want indexes without running a server.
Is BuntDB open source?
Yes. BuntDB is open source. License: MIT License.
Does BuntDB support ACID transactions?
Yes. BuntDB supports full ACID transactions, with strong consistency.
Does BuntDB scale horizontally?
BuntDB 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 BuntDB?
You can self-host it and embed it in your application.
What is BuntDB best for?
BuntDB is a strong fit for embedded state or config store inside Go services, in-process geospatial lookups and local cache with TTL-based eviction. Think twice for datasets larger than available RAM.
What are the best alternatives to BuntDB?
Common alternatives to BuntDB include bbolt, Badger, Pebble, Tile38 and Redis. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
Is BuntDB still maintained?
BuntDB is in maintenance mode. Feature-complete; last code release v1.3.2 (Sept 2024), with only documentation commits since.
How popular is BuntDB?
BuntDB ranks #424 of 844 databases on the WhichDB Score (3.8/100), and #63 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.


