NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›
PROTOCOLS · REDIS

Your cache is already here.

Any Redis client connects to --kv-port unchanged, and the same store answers KV statements on the SQL ports. An application that talks SQL to RasterizedDB can cache, count, rate-limit, queue and publish without a second server.

HOW IT WORKS · ANIMATED 12 s cycle

Why the KV store outruns Redis on the same box

Each I/O thread runs its own single-threaded runtime and owns its connections. A request is read, answered and written by one thread, with no hand-off between threads.

client 1 client 2 client 3 client 4 client 5 client 6 I/O THREAD 1 · OWN RUNTIME · OWN CONNECTIONS READ LOOK UP ANSWER WRITE I/O THREAD 2 · OWN RUNTIME · OWN CONNECTIONS READ LOOK UP ANSWER WRITE I/O THREAD 3 · OWN RUNTIME · OWN CONNECTIONS READ LOOK UP ANSWER WRITE STORE · SHARDS shard 0shard 1shard 2shard 3shard 4shard 5shard 6shard 7 32 B, unpipelined, server on 4 cores: 402k ops/s · best of Redis 7.4 / Valkey 8.1: 299k
  1. 1
    Connections are assigned

    Each new client connection is given to one I/O thread and stays there.

  2. 2
    Read

    The thread reads the request from its own socket. No queue, no other thread involved.

  3. 3
    Look up

    The key hashes to one shard of the store; the shard lock is held for a single probe.

  4. 4
    Answer

    The same thread encodes the reply in RESP2 or RESP3.

  5. 5
    Write

    And writes it back on the same socket. Pipelined requests are answered in one write.

  6. 6
    Every core at once

    Unpipelined, most of the time is the kernel's TCP path; doing it on every core is where the 1.3-2.4× over Redis comes from.

1 / 3

From Redis clients, or from SQL

  • RESP2 and RESP3, pipelining, pub/sub on the Redis port
  • Strings, counters, hashes, lists, sets, sorted sets, expiry
  • SELECT 0 to 15, per database
  • AUTH against the database's own roles; TLS on the port if asked
SQL
KV SET session:42 '{"user":7}' EX 3600;
KV GET session:42;
KV INCR page:/home:hits;
KV HSET user:7 name 'Ada' plan 'pro';
KV ZADD board 1500 ada 1320 bob;
KV ZRANGE board 0 9 REV WITHSCORES;
KV SCAN 0 MATCH 'session:*' COUNT 100;
2 / 3

Faster than Redis on the same box

memtier_benchmark, 1M keys, against Redis 7.4 and Valkey 8.1 with and without io-threads, medians of three interleaved rounds:

402kops/s, 32 B, 1:10, no pipeline: 1.34× the best
3.37Mops/s pipelined: 2.45× the best
1.53Mops/s, 1 KiB, pipelined: 1.79× the best
3 / 3

Settings you know

Unbounded with noeviction until you set maxmemory, memory-only unless persistence is on, and replicated to peers when replication is on (PUBLISH, expiry and eviction stay per node). Values that must survive belong in a table: the KV store is for what is cheaper to recompute than to read.

shell
--kv-port 6379 --kv-max-memory 4gb --kv-eviction allkeys-lru --kv-persist
redis-cli -p 6379 -a <password> CONFIG SET maxmemory 1gb
✓ page rendered in 232 µs axum + tera + htmx · no other javascript