Giter VIP home page Giter VIP logo

dice's Introduction

DiceDB

Dice ๐ŸŽฒ is a drop-in replacement of Redis with SQL-based realtime reactivity baked in.

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?

  1. DiceDB is multi-threaded and follows shared-nothing architecture.
  2. DiceDB supports a new command called QWATCH that lets clients listen to a SQL query and get notified in real-time whenever something changes.

Get started

Using Docker

The easiest way to get started with DiceDB is using Docker by running the following command.

$ docker run dicedb/dice-server

Setting up

To run DiceDB for local development or running from source, you will need

  1. Golang
  2. Any of the below supported platform environment:
    1. Linux based environment
    2. OSX (Darwin) based environment
$ git clone https://github.com/dicedb/dice
$ cd dice
$ go run main.go

Dice in action

Because Dice speaks Redis' dialect, you can connect to it with any Redis Client and the simplest way it to use a Redis CLI. Programmatically, depending on the language you prefer, you can use your favourite Redis library to connect.

But if you are planning to use QWATCH feature then you need to use the DiceDB CLI that you can download from PyPI by running the following command. The codebase for the same can be found at dicedb/cli.

$ pip install dicedb-cli

Running Tests

Unit 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.

Executing a single unit test

$ TEST_FUNC=<name of the test function> make unittest-one
$ TEST_FUNC=TestByteList make unittest-one

Running all unit tests

$ make unittest

Integration 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.

Executing a single integration test

$ TEST_FUNC=<name of the test function> make test-one
$ TEST_FUNC=TestSet make test-one

Running all integration tests

$ make test

Work to add more tests in DiceDB is in progress and we will soon port the test Redis suite to this codebase to ensure full compatability.

Running Benchmark

$ go test -test.bench <pattern>
$ go test -test.bench BenchmarkListRedis

Getting Started

To get started with building and contributing to DiceDB, please refer to the issues created in this repository.

The story

DiceDB started as a re-implementation of Redis in Golang and the idea was to - build a DB from scratch and understand the micro-nuances that comes with its implementation. The database does not aim to replace Redis, instead it will fit in and optimize itself for multi-core computations running on a single-threaded event loop.

How to contribute

The Code Contribution Guidelines are published at CONTRIBUTING.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.

Contributors

Troubleshoot

Forcefully killing the process

$ sudo netstat -atlpn | grep :7379
$ sudo kill -9 <process_id>

dice's People

Contributors

arpitbbhayani avatar jyotindersingh avatar manav2401 avatar asutosh97 avatar yashs360 avatar rohanverma94 avatar thedarkmatter10 avatar yakshit-criodo avatar hakai-shin avatar zeu5 avatar rishabh-prodigal avatar sriramr98 avatar ayush571995 avatar mrchocha avatar reapedjuggler avatar sahil1913 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.