MCPcopy Index your code
hub / github.com/dicedb/dicedb

github.com/dicedb/dicedb @1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.0 ↗ · + Follow
10,457 symbols 37,642 edges 759 files 3,602 documented · 34%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DiceDB

DiceDB is a fork of Valkey (a fork of Redis). DiceDB extends Valkey with additional capabilities while staying fully compatible with Valkey and Redis tooling and SDK ecosystem.

This is a quick start guide. For full documentation, visit dicedb.io.

DiceDB builds on Valkey, so you may still see Valkey references in logs, metrics, and parts of the codebase.

[!NOTE] DiceDB originally started as a Golang-based storage engine and offered reactivity and higher throughput as its core offering. That implementation is now archived: dice-legacy. Selected features from the legacy engine will be gradually ported into the current codebase.

Get Started

The quickest and easiest way to start using DiceDB is with the official Docker image. It comes with everything pre-configured, so you can get up and running in seconds without worrying about setup details.

docker run \
  --name dicedb-1 -p 6379:6379 -v $(pwd)/data:/data/ \
  dicedb:latest

This command starts a DiceDB container with the spill module already enabled. By default, the spill module uses RocksDB and is configured with a maximum memory limit of 250MB.

Custom Configuration

If you prefer not to use the defaults and want to explicitly configure DiceDB, you can run DiceDB with explicit configuration

docker run \
  --name dicedb-1 -p 6379:6379 -v $(pwd)/data:/data/ \
  dicedb:latest \
  dicedb-server \
  --port 6379 \
  --maxmemory 500mb \
  --protected-mode no \
  --loadmodule /usr/local/lib/lib-spill.so path /data/spill/ max-memory 262144000

This configuration sets:

  • DiceDB max memory limit to 500MB
  • Spill memory limit to 250MB

What's Different

DiceDB extends Valkey with the following key capabilities:

  • dicedb-spill - transparently persists evicted keys to disk and restores them on cache misses, enabling larger working sets within fixed memory budgets.

Building DiceDB from Source

DiceDB supports Linux, macOS, OpenBSD, NetBSD, and FreeBSD. Both little-endian and big-endian systems are supported, including 32-bit and 64-bit architectures.

Basic build:

make
make test

For additional build and configuration options, refer to DiceDB documentation.

Running DiceDB

Start server with default configuration:

./src/dicedb-server

Start with a configuration file:

./src/dicedb-server /path/to/valkey.conf

You can also pass configuration options directly:

./src/dicedb-server --port 9999 --replicaof 127.0.0.1 6379
./src/dicedb-server --loglevel debug

For advanced configuration, refer to DiceDB or Valkey documentation.

Using DiceDB

Use dicedb-cli or any compatible client.

Example:

./src/dicedb-cli

> ping
> set foo bar
> get foo
> incr counter

Sponsors

We are incredibly grateful to our sponsor(s) for their generous support, which makes the development of DiceDB possible.

<img alt="CodeRabbit" src="https://www.coderabbit.ai/images/logo-orange.svg" width="240">

Support

DiceDB has a strong vision and roadmap. If you find DiceDB useful, please consider supporting us by starring this repo and sponsoring us on GitHub.

Core symbols most depended-on inside this repo

sdslen
called by 681
src/sds.h
sdsfree
called by 636
src/sds.c
zfree
called by 601
src/zmalloc.c
tsd_tsdn
called by 511
deps/jemalloc/include/jemalloc/internal/tsd.h
addReplyBulkCString
called by 349
src/networking.c
sdsnew
called by 340
src/sds.c
addReplyError
called by 311
src/networking.c
zmalloc
called by 277
src/zmalloc.c

Shape

Function 9,345
Class 1,011
Method 65
Enum 36

Languages

C85%
C++14%
Python1%
Ruby1%
TypeScript1%

Modules by API surface

src/module.c584 symbols
src/valkey-cli.c232 symbols
src/server.c230 symbols
src/cluster_legacy.c225 symbols
src/networking.c176 symbols
src/config.c159 symbols
src/t_zset.c145 symbols
src/sentinel.c136 symbols
src/replication.c117 symbols
src/db.c116 symbols
src/rdma.c108 symbols
deps/jemalloc/src/jemalloc.c104 symbols

For agents

$ claude mcp add dicedb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact