Getting Started
DiceDB is an open source, in-memory database that is wire-compatible with Redis and adds reactive query support. Unlike Redis, DiceDB lets clients subscribe to SQL-like queries and receive real-time push updates whenever the result set changes — without polling. It is a good fit for leaderboards, live dashboards, multiplayer game state, and any workload where clients need to react immediately to data changes. Available as an open web service in Eyevinn Open Source Cloud.
Prerequisites
- If you have not already done so, sign up for an Eyevinn OSC account
Step 1: Create a DiceDB instance
Navigate to the DiceDB service in the OSC web console. Go to the My dices tab and click Create dice. Enter:
- Name: a unique name for your instance (alphanumeric only, e.g.
myleaderboard)
Click Create and wait for the status indicator to turn green. Note the host and port shown on the instance card.
Step 2: Connect with redis-cli
DiceDB speaks the Redis Serialisation Protocol (RESP), so any Redis-compatible client works out of the box.
redis-cli -h <host> -p <port>
Basic key-value operations are identical to Redis:
SET player:alice 1200
GET player:alice
INCR player:alice
Step 3: Use reactive queries
DiceDB extends Redis commands with QWATCH (subscribe to a query) and QUNWATCH (unsubscribe). Clients that open a persistent connection receive a push notification every time the query result changes.
Example — subscribe to the top 3 players sorted by score:
QWATCH "SELECT $key, $value WHERE $key LIKE 'player:*' ORDER BY $value DESC LIMIT 3"
Every INCR player:alice or SET player:bob 1500 executed by any other client triggers an immediate push to all subscribers of that query.
Usage example (Node.js)
import { createClient } from 'redis';
const client = createClient({ url: 'redis://<host>:<port>' });
await client.connect();
// Standard Redis commands
await client.set('player:alice', 1200);
const score = await client.get('player:alice');
console.log(score); // "1200"
For reactive queries, use a second persistent connection via redis-cli or the DiceDB SDK.
CLI usage
osc create dicedb-dice myleaderboard