Installation
DiceDB is an in-memory real-time database with SQL-based reactivity. It is hyper-optimized for building and scaling truly real-time applications on modern hardware while being a drop-in replacement for Redis.
Note: DiceDB is still in development and it supports a subset of Redis commands. So, please do not use it in production. But, feel free to go through the open issues and contribute to help us speed up the development.
How is it different from Redis?
- DiceDB is multi-threaded and follows shared-nothing architecture.
- DiceDB supports a new command called
QWATCH
that lets clients listen to a SQL query and get notified in real-time whenever something changes.
With this, you can build truly real-time applications like Leaderboard with simple SQL query.
Get started
Using Docker
The easiest way to get started with DiceDB is using Docker by running the following command.
The above command will start the DiceDB server running locally on the port 7379
and you can connect
to it using DiceDB CLI and SDKs, or even Redis CLIs and SDKs.
Note: Given it is a drop-in replacement of Redis, you can also use any Redis CLI and SDK to connect to DiceDB.
Setting up DiceDB from source for development and contributions
To run DiceDB for local development or running from source, you will need
- Golang
- Any of the below supported platform environment:
- Linux based environment
- OSX (Darwin) based environment
- WSL under Windows
- Install GoLangCI
Live Development Server
DiceDB provides a hot-reloading development environment, which allows you to instantly view your code changes in a live server. This functionality is supported by Air
To Install Air on your system you have following options.
- If you’re on go 1.22+
- Install the Air binary
Once air
is installed you can verify the installation using the command air -v
To run the live DiceDB server for local development:
Setting up CLI
The best way to connect to DiceDB is using DiceDB CLI and you can install it by running the following command.
Because DiceDB speaks Redis dialect, you can connect to it with any Redis Client and SDK also. But if you are planning to use the
QWATCH
feature then you need to use the DiceDB CLI.