NutsDB

active

by NutsDB contributors · since 2019

Pure-Go embedded key-value store with Bitcask storage and Redis-like lists, sets and sorted sets.

key-valueembedded libraryopen source (permissive)growing

Overview

NutsDB is an embeddable, persistent key-value store written in pure Go that uses a Bitcask-style append-only log with an in-memory index, giving fast writes and single-seek reads. Beyond plain buckets it offers Redis-like data structures (lists, sets and sorted sets), per-key TTLs and fully serializable transactions, which makes it convenient for Go services that want Redis-ish semantics without a server. Because the index is held in memory, the number of keys is bounded by RAM, and merges must be run to reclaim space.

Strengths & trade-offs

Strengths

  • +Redis-like lists, sets and sorted sets in an embedded Go library
  • +Fully serializable transactions
  • +Fast writes from an append-only Bitcask design
  • +Pure Go with no cgo

Trade-offs

  • −In-memory index limits how many keys you can store
  • −Merge (compaction) must be managed to reclaim disk
  • −Go-only and community-maintained

Great for

  • +Embedded queues and leaderboards in Go services
  • +Local caches with TTL
  • +Replacing a sidecar Redis for single-process apps

Think twice for

  • −Very large key counts
  • −Multi-process or networked access
  • −Non-Go applications

Capabilities

Native or official first-party support · 4 of 25 tracked

✓Transactions
✓TTL / expiry
✓In-memory
✓Durable persistence
–Joins
–Secondary indexes
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–Pub/Sub
–Columnar storage
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Schemaless
Architecture
Embedded
Query languages
Go API

Key index kept in memory, so key count is bounded by RAM.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsGo API
client languagesGo

Alternatives to NutsDB

Compare all→
BadgerKey-Value10.7

Pure-Go LSM key-value store that separates keys from values to cut write amplification.

nutsdb vs badger →
bboltKey-Value11.5

etcd's maintained fork of BoltDB: a simple, pure-Go B+tree store in a single file.

nutsdb vs bbolt →
PebbleKey-Value5.6

Cockroach Labs' Go LSM engine, inspired by RocksDB and tuned for CockroachDB.

nutsdb vs pebble →
RedisKey-Value84.3

The in-memory data structure server that became the default cache, now with search, JSON and vectors built in.

nutsdb vs redis →
EhcacheKey-Value17.6

The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering.

nutsdb vs ehcache →
Chronicle MapKey-Value8.7

Off-heap, memory-mapped key-value store for Java with microsecond latency and cross-process sharing.

nutsdb vs chronicle-map →

NutsDB FAQ

What is NutsDB?

NutsDB is a key-value database by NutsDB contributors, first released in 2019. NutsDB is an embeddable, persistent key-value store written in pure Go that uses a Bitcask-style append-only log with an in-memory index, giving fast writes and single-seek reads. Beyond plain buckets it offers Redis-like data structures (lists, sets and sorted sets), per-key TTLs and fully serializable transactions, which makes it convenient for Go services that want Redis-ish semantics without a server. Because the index is held in memory, the number of keys is bounded by RAM, and merges must be run to reclaim space.

Is NutsDB open source?

Yes. NutsDB is open source. License: Apache License 2.0.

Does NutsDB support ACID transactions?

Yes. NutsDB supports full ACID transactions, with strong consistency.

Does NutsDB scale horizontally?

NutsDB 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 NutsDB?

You can self-host it and embed it in your application.

What is NutsDB best for?

NutsDB is a strong fit for embedded queues and leaderboards in Go services; local caches with TTL; and replacing a sidecar Redis for single-process apps. Think twice for very large key counts.

What are the best alternatives to NutsDB?

Common alternatives to NutsDB include Badger, bbolt, Pebble, Redis and Ehcache. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is NutsDB?

NutsDB ranks #432 of 844 databases on the WhichDB Score (3.6/100), and #64 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.