DiceDB is an open-source in-memory database with query subscriptions.
Caution
DiceDB is under active development and supports a wide range of commands. Inconsistent behavior is expected. Feel free to go through the open issues and contribute to help us speed up the development.
We have multiple repositories where you can contribute. So, as per your interest, you can pick one and build a deeper understanding of the project on the go.
- dicedb/dice for core database features and engine / Stack - Go
- dicedb/dicedb-cli command line interface for DiceDB / Stack - Go
- dicedb/playground-mono backend APIs for DiceDB playground / Stack - Go
- dicedb/alloy frontend and marketplace for DiceDB playground / Stack - NextJS
The easiest way to get started with DiceDB is using Docker by running the following command.
docker run -p 7379:7379 dicedb/dicedb --enable-watchThe above command will start the DiceDB server running locally on the port 7379 and you can connect
to it using DiceDB CLI and SDKs.
To build DiceDB from source, you need to have the following
- Golang
- Any of the below supported platform environments:
- Linux based environment
- OSX (Darwin) based environment
- WSL under Windows
git clone https://github.com/dicedb/dice
cd dice
make buildThe above command will create a binary dicedb. Execute the binary and that will
start the DiceDB server., or, you can run the following command to run like a usual
Go program
go run main.go --enable-watchYou can skip passing the flag if you are not working with .WATCH feature.
The best way to connect to DiceDB is using DiceDB CLI and you can install it by running the following command
sudo su
curl -sL https://raw.githubusercontent.com/DiceDB/dicedb-cli/refs/heads/master/install.sh | shIf you are working on unsupported OS (as per above script), you can always follow the installation instructions mentioned in the dicedb/cli repository.
git clone https://github.com/DiceDB/dicedb-cli
cd dicedb-cli
make buildThe above command will create a binary dicedb-cli. Execute the binary will
start the CLI and will try to connect to the DiceDB server.
sudo su
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /bin v1.60.1Unit tests and integration tests are essential for ensuring correctness and in the case of DiceDB, both types of tests are available to validate its functionality.
For unit testing, you can execute individual unit tests by specifying the name of the test function using the TEST_FUNC environment variable and running the make unittest-one command. Alternatively, running make unittest will execute all unit tests.
TEST_FUNC=<name of the test function> make unittest-one
TEST_FUNC=TestByteList make unittest-onemake unittestIntegration tests, on the other hand, involve starting up the DiceDB server and running a series of commands to verify the expected end state and output. To execute a single integration test, you can set the TEST_FUNC environment variable to the name of the test function and run make test-one. Running make test will execute all integration tests.
Make sure you have DiceDB running before you run the following commands.
By default it connects to the local instance of DiceDB running on port 7379.
TEST_FUNC=<name of the test function> make test-one
TEST_FUNC=^TestSet$ make test-onemake testmake run_benchmarkTo get started with building and contributing to DiceDB, please refer to the issues created in this repository.
We use Astro framework to power the dicedb.io website and Starlight to power the docs. Once you have NodeJS installed, fire the following commands to get your local version of dicedb.io running.
cd docs
npm install
npm run devOnce the server starts, visit http://localhost:4321/ in your favourite browser. This runs with a hot reload which means any changes you make in the website and the documentation can be instantly viewed on the browser.
docs/src/content/docs/commandsis where all the commands are documenteddocs/src/content/docs/tutorialsis where all the tutorials are documented
The Code Contribution Guidelines are published at CONTRIBUTING/README.md; please read them before you start making any changes. This would allow us to have a consistent standard of coding practices and developer experience.
Contributors can join the Discord Server for quick collaboration.
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
$ sudo netstat -atlpn | grep :7379
$ sudo kill -9 <process_id>