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.
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.
- 1Connections are assigned
Each new client connection is given to one I/O thread and stays there.
- 2Read
The thread reads the request from its own socket. No queue, no other thread involved.
- 3Look up
The key hashes to one shard of the store; the shard lock is held for a single probe.
- 4Answer
The same thread encodes the reply in RESP2 or RESP3.
- 5Write
And writes it back on the same socket. Pipelined requests are answered in one write.
- 6Every 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.
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
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;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:
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.
--kv-port 6379 --kv-max-memory 4gb --kv-eviction allkeys-lru --kv-persist redis-cli -p 6379 -a <password> CONFIG SET maxmemory 1gb