Hot, cold and in memory.
One engine, one SQL.
Keep the working set in memory, the busy tables on local NVMe, and years of history in S3 at object-store prices. All three answer the same SQL in the same transaction, and a table moves between them with one statement while the application keeps running.
In memory: the KV cache and memory tables
In the same process as your data: no second server, no extra network hop.
The Redis-compatible store answers any Redis client on --kv-port and KV statements on the SQL ports, so an application caches, counts, rate-limits and queues without a second server. A table can live in memory too: same SQL, no disk under it.
- Strings, counters, hashes, lists, sets, sorted sets, expiry
- maxmemory and Redis's eviction policies, changed at runtime
- Optional persistence: periodic saves and on shutdown
- Authentication with the database's own roles
KV SET session:42 'ada' EX 3600; KV INCR rate:203.0.113.9; STORAGE MOVE TABLE hot_lookup TO 'memory:';
A table moves between tiers while it keeps answering
STORAGE MOVE TABLE copies a table to its new backend, flips its placement, then removes the original. The SQL that reads it never changes.
- 1Three tiers
Memory for what must be fastest, local NVMe for the working set, an S3 bucket for history.
- 2Copy
STORAGE MOVE TABLE events TO 'kv:archive' copies the table's files into the bucket's object layout.
- 3Flip
The placement flips in one step. New statements read the S3 copy; nothing in between sees half a table.
- 4Remove the original
The files on NVMe are deleted, and the disk has the space back.
- 5Read through a cache
Reads of the S3 table go through a byte-budgeted page cache; writes land in an overlay and commit crash-safely.
- 6And into memory
A hot lookup table moves the other way: STORAGE MOVE TABLE rates TO 'memory:'.
Faster than Redis and Valkey,
on the same machine.
memtier_benchmark against Redis 7.4 and Valkey 8.1 (official images, persistence off), each run single-threaded and with io-threads. 1M keys, random access, 50 connections per client thread. Medians of three interleaved rounds; the last column compares RasterizedDB's slowest run with the competitor's fastest.
| Server on 4 cores, client on 12 | RasterizedDB | Redis | Redis io-threads | Valkey | Valkey io-threads | vs best | worst vs their best |
|---|---|---|---|---|---|---|---|
| 32 B, 1 SET : 10 GET | 402k | 172k | 288k | 180k | 299k | 1.34× | 1.29× |
| same, pipeline 16 | 3.37M | 1.38M | 1.37M | 1.32M | 1.30M | 2.45× | 2.40× |
| 1 KiB, 1 : 1 | 403k | 170k | 281k | 173k | 280k | 1.43× | 1.32× |
| same, pipeline 16 | 1.53M | 816k | 724k | 821k | 853k | 1.79× | 1.70× |
Why it is fast
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. Unpipelined, 83% of the server's time is the kernel's TCP path; the win is doing that on every core at once.
Latency too
On 8 cores, 32 B values, no pipeline: p50 0.71 ms against Valkey io-threads' 0.77 ms, p99 2.85 ms against 4.08 ms. Pipelined, p50 1.53 ms against Redis's 4.29 ms.
What to know
Unbounded with noeviction until you set maxmemory; memory-only unless persistence is on; replicated to peers when replication is on, except PUBLISH, expiry and eviction; not part of SQL transactions. Pub/sub works over the Redis port.
Five places a table can live.
| Backend | Spec | For |
|---|---|---|
| Files, primary location | (default) | Most tables: NVMe, WAL, filter sidecars |
| Files, another location | '/mnt/nvme2' | Spreading a database over disks with storage pools |
| Memory | 'memory:' | Lookup and scratch tables that must be fast |
| Key/value store on a local directory | 'kv:scratch' | The object layout on local disk |
| Key/value store on S3 | 'kv:archive' | Cold history: audit, events, old partitions |
STORAGE MOVE TABLE events TO 'kv:archive'; -- files -> S3 STORAGE MOVE TABLE events TO 'kv:scratch'; -- S3 -> a local kv store STORAGE MOVE TABLE events TO 'memory:'; -- ... or into this process STORAGE MOVE TABLE events TO '/mnt/disk2'; -- ... and back onto files
Built to grow
past one disk.
The cold tier has no capacity ceiling of its own: it is as large as the bucket. Partitions spread one table over many disks, each with its own filter index, and sharding spreads partitions over many machines. Hot data stays in memory and on NVMe the whole way, so growth in total size does not slow the working set.
Sharding shipped in 1.1.0; see the sharding pages.
Running in one command.
Linux and Windows, x86-64 and ARM64, a static musl build, an Arch package, or Docker.
# PostgreSQL on 5432, native on 61170 docker run -d --name rasterizeddb \ -e RASTERIZEDDB_PG_PASSWORD=change-me \ -p 5432:5432 -p 61170:61170 \ -v rasterizeddb:/var/lib/rasterizeddb \ milendenev/rasterizeddb:latest psql "postgresql://superuser@127.0.0.1:5432/postgres"