Run the server

Docker Hub has one Linux image. linux and latest are the same image, as is each version tag, built for linux/amd64 and linux/arm64 (Apple Silicon and other arm64 hosts run it natively).

Shell
docker run --rm -p 6379:6379 \
  -e RUVIO_REQUIREPASS=change-me \
  -v ruvio-data:/data \
  salihcantekin/ruvio:linux

The container sets RUVIO_PROTECTED_MODE=false because a published port is not loopback inside the namespace, so put a password on any bind that is not loopback. The image default durability is memory; a persistent deploy sets RUVIO_DURABILITY and keeps the volume. The process runs as UID 10001.

Two shards in one container

Two shards publish consecutive ports. Advertise the host clients can reach; without that, CLUSTER SLOTS hands out 127.0.0.1 and a remote app cannot follow MOVED.

Shell
docker run --rm -p 6379-6380:6379-6380 \
  -e RUVIO_SHARDS=2 \
  -e RUVIO_ADDR=0.0.0.0:6379 \
  -e RUVIO_ADVERTISE_HOST=YOUR_SERVER_IP \
  -e RUVIO_PROTECTED_MODE=false \
  -v ruvio-data:/data \
  salihcantekin/ruvio:linux

First-party clients take only YOUR_SERVER_IP:6379. They read the slot map and open 6380 themselves.

GitHub Releases has prebuilt binaries for Linux x64 and arm64, macOS arm64 and Windows x64. Each archive holds ruvio (the server), ruvio-ctl (backup, restore and checks), ruvio.example.toml, the README and the license; SHA256SUMS lists the checksums.

Shell
# Linux x64; swap the platform for linux-arm64 or macos-arm64
v=0.5.0
curl -LO https://github.com/salihcantekin/ruvio/releases/download/ruvio-$v/ruvio-$v-linux-x64.tar.gz
tar xzf ruvio-$v-linux-x64.tar.gz
cd ruvio-$v-linux-x64
./ruvio --requirepass change-me --data-dir ./data

On Windows, unzip ruvio-<version>-windows-x64.zip and run ruvio.exe. On macOS, a binary downloaded by a browser is quarantined; xattr -d com.apple.quarantine ruvio ruvio-ctl clears it (downloads with curl are not quarantined). ruvio --help lists every flag.

From a checkout of the repository, with the Rust toolchain installed:

Shell
cargo run --release --bin ruvio

The server is installed from the Docker image, a release binary, or built from a checkout; it is not published as a crate.

Connect with redis-cli

Ruvio speaks RESP2, so redis-cli and existing RESP clients connect as they would to Redis.

Shell
redis-cli -h 127.0.0.1 -p 6379 -a change-me PING
# PONG

Settings merge in this order: built-in defaults, ruvio.toml (or --config / RUVIO_CONFIG), RUVIO_* environment variables, then command-line flags. The file is read once, at process start, and unknown TOML fields are rejected. Memory limits, slowlog, connection limits, script limits and the password also change while the server runs with CONFIG SET, andCONFIG REWRITE writes them back to the file; see Changing settings at runtime.

Choose a durability profile

You choose how much a crash can lose, at startup. A write is checked, appended, then applied. If the log cannot take the record, the key stays as it was and later writes return MISCONF.

ProfileWhat a crash can lose
memoryThe whole dataset. This is the default. No WAL.
snapshotWrites since the last completed checkpoint.
everysecAbout one sync interval. The client is acknowledged after the append, and the file is synced on sync_interval_ms (default 1000).
alwaysThe record is synced before it is applied and before the reply.

Set it with --durability, RUVIO_DURABILITY or persistence.profile in ruvio.toml. Shard count, bind address and durability cannot change under a live process.

Shell
docker run --rm -p 6379:6379 \
  -e RUVIO_REQUIREPASS=change-me \
  -e RUVIO_DURABILITY=everysec \
  -v ruvio-data:/data \
  salihcantekin/ruvio:linux

Add a client

First-party clients speak RESP2, do not send CLIENT SETINFO, and learn CLUSTER SLOTS from one seed address. The Go module is released by git tag and served by the Go module proxy; the others are published to their registries.

Against a sharded server each client sends a command straight to the shard that owns its key. A pipeline whose keys land on several shards is written to every shard before any reply is read, so it still costs one round trip. The rules and the measured cost per client are in Client behavior; the C# client also has an opt-in reader thread per socket (DedicatedReaderThread) for the lowest CPU per round trip. A read policy (prefer-replica or replica) sends read-only commands to the replicas the server lists; see Reads from replicas.

For ASP.NET Core, Ruvio.Client.AspNetCore registers the connection with dependency injection: dotnet add package Ruvio.Client.AspNetCore.

Replicas, failover and clusters

One process is enough to start. When you need a copy of the data, automatic failover or more than one machine's worth of keys, grow in this order. Each step keeps the one before it. The setup wizard writes these files for your own sizes.

A replica copies one primary. The primary opens a replication port with a password; the replica dials it. Set the same password on both. The replica is read-only; a client with a read policy can send reads to it.

Shell
# primary
ruvio --requirepass change-me --durability everysec --data-dir ./data   --address 0.0.0.0:6379
# with environment variables: RUVIO_REPLICATION_ROLE=primary
#   RUVIO_REPLICATION_LISTEN=0.0.0.0:26379 RUVIO_REPLICATION_PASSWORD=change-me-too

# replica, on another machine (or another port and data dir)
RUVIO_REPLICATION_ROLE=replica RUVIO_REPLICATION_PRIMARY=PRIMARY_HOST:26379 RUVIO_REPLICATION_PASSWORD=change-me-too   ruvio --requirepass change-me --durability everysec --data-dir ./data

INFO replication shows replication_role and the replica count. On its own a replica does not take over: if the primary dies you promote one with REPLICAOF NO ONE.RUVIO_REPLICATION_ROLE, RUVIO_REPLICATION_LISTEN and RUVIO_REPLICATION_PRIMARY are in Configuration.

Three data nodes and three ruvio coordinator processes: the coordinators watch the group, agree by majority that the primary is gone, promote the best replica and point the others at it. Clients that follow failover (the default in all six) reconnect on their own. Run three or five coordinators, never two.

Shell
git clone https://github.com/salihcantekin/ruvio && cd ruvio
export RUVIO_COORDINATOR_SECRET=change-me RUVIO_REPLICATION_PASSWORD=change-me-too
docker compose -f deploy/compose.failover.yml up -d

printf 'AUTH change-me
SENTINEL get-master-addr-by-name main
' | redis-cli -p 26401
docker compose -f deploy/compose.failover.yml stop ruvio-1   # ruvio-2 or ruvio-3 takes over

The compose file sets RUVIO_MIN_REPLICAS_TO_WRITE=1, so a primary cut off from its replicas stops taking writes after 10 s instead of diverging. For machines without Docker, deploy/coordinator.toml and deploy/ruvio-coordinator.service are the same setup; the details are in Automatic failover.

Several groups split the 16384 hash slots, and each group is a primary with replicas. A node answers a key of another group with MOVED; cluster-aware clients follow it from any one seed address. The coordinators keep the map current after every failover and every slot move.

Shell
export RUVIO_COORDINATOR_SECRET=change-me RUVIO_REPLICATION_PASSWORD=change-me-too
docker compose -f deploy/compose.cluster.yml up -d   # groups a and b, two nodes each, three coordinators

redis-cli -p 6381 SET c 1   # slot belongs to group a: OK
redis-cli -p 6381 SET a 1   # slot 15495 belongs to group b: MOVED ruvio-b1:6379
printf 'AUTH change-me
SENTINEL masters
' | redis-cli -p 26401
docker compose -f deploy/compose.cluster.yml stop ruvio-a1   # ruvio-a2 becomes the primary of group a

Three files have to agree: each data node's cluster_topology map (RUVIO_CLUSTER_TOPOLOGY) and cluster_group (RUVIO_CLUSTER_GROUP), and the coordinators' [[groups]] with the same names, shard counts and slots. deploy/cluster/ holds a working set. Because nodes name each other by service name here, run clients inside the compose network or advertise an address they can reach (RUVIO_ADVERTISE_HOST). A group of two nodes stops taking writes while its replica is down; add a third node per group for production. Moving slots between groups, rebalancing and upgrades are in A multi-node cluster and Cluster and failover.

Encrypt with TLS

TLS is off by default. Give the server a certificate and key and its client port speaks TLS only; every first-party client can then connect with it, checking the certificate chain and the host name.

Shell
ruvio --tls-cert server.pem --tls-key server-key.pem
# or RUVIO_TLS_CERT / RUVIO_TLS_KEY, or security.tls_cert / security.tls_key in ruvio.toml
# add tls_client_ca and tls_client_auth to demand client certificates (mutual TLS)
// Cargo.toml: ruvio-client = { version = "...", features = ["tls"] }
use ruvio_client::{Client, ClientOptions, TlsOptions};

let mut db = Client::connect_with(ClientOptions {
    host: "cache.internal".to_owned(),
    tls: Some(TlsOptions {
        ca_pem: Some(std::fs::read("ca.pem")?),
        ..TlsOptions::default()
    }),
    ..ClientOptions::default()
})?;

Every client also takes a client certificate for mutual TLS and a server name for connecting by IP address. Skipping verification is a separate, clearly named option for throwaway tests only. The settings are in Configuration, and each client guide has a TLS section: Clients. The operator UI connects to a TLS server with RUVIO_UI_TLS; see UI connections.

Operator UI

A browser view of a running server or cluster: a dashboard of time charts you choose, a read-only cluster view (groups, shards, slots, replicas and, with RUVIO_UI_COORDINATORS, the coordinators), data, command forms, a command console, Pub/Sub and ACL users. The container serves the browser and connects to the Ruvio server named by RUVIO_UI_TARGET_HOST and RUVIO_UI_TARGET_PORT. Sign-in is the server ACL user.

Shell
docker pull salihcantekin/ruvio-ui:linux
docker run --rm -p 8080:8080 \
  -e RUVIO_UI_TARGET_HOST=127.0.0.1 \
  -e RUVIO_UI_TARGET_PORT=6379 \
  salihcantekin/ruvio-ui:linux

Then open http://127.0.0.1:8080. Port 8080 is only the UI.

Operator UI overview: groups, slot map, keys, memory and shard health of a two-group cluster

Dashboard and cluster view

The Dashboard, below Console in the menu, draws time charts of the INFO fields: commands per second, network bytes, memory and its breakdown, keys, WAL records, replication lag and more. You pick the charts, a 5, 15 or 30 minute window, and whether lines are added up or drawn per node. The charts come from the same single INFO per node that each refresh already reads, so they add no load on the server. The Cluster screen shows each group with its shards, slot ranges, primaries and replicas, and, with coordinators configured, the leader, each group's agreed primary and the failovers seen while it is open.

Dashboard with time charts of commands per second, network bytes and memory
Cluster screen with two groups, their replicas and three coordinators

Console

The Console tab, at the bottom of the menu, runs server commands from the browser. It opens only when you press Connect console, and commands run with the permissions of the user you signed in as. Replies are formatted: JSON is pretty-printed, multi-line text such as INFO shows as plain lines, and large results are cut on screen with Show more, Copy all and Download for the full text. Errors keep the server's message and add a short hint, and destructive commands such as FLUSHALL ask before they run. Subscriptions and blocking commands are refused; Pub/Sub has its own screen.

Console running commands and showing a formatted JSON reply
Data screen showing a JSON document as a tree

UI in Docker, Ruvio on the same machine

Inside the container, localhost is the container itself. Give the UI the name of the machine that runs Docker, host.docker.internal, and start the Ruvio binary on an address the container can reach, with a password:

Shell
ruvio --address 0.0.0.0:6379 --requirepass change-me

docker run --rm -p 8080:8080 \
  -e RUVIO_UI_TARGET_HOST=host.docker.internal \
  -e RUVIO_UI_TARGET_PORT=6379 \
  -e RUVIO_UI_TARGET_PASSWORD=change-me \
  salihcantekin/ruvio-ui:linux

With more than one shard, sign in to any one shard port; the UI finds the others from the server and needs every shard port reachable. Set RUVIO_ADVERTISE_HOST on the server to a name the UI can reach. The Windows firewall rule, Linux notes and a list of connection errors are in Connecting the Operator UI; the same file ships in every server download.

Next steps