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 ›
STORAGE TIERS

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
sql
KV SET session:42 'ada' EX 3600;
KV INCR rate:203.0.113.9;
STORAGE MOVE TABLE hot_lookup TO 'memory:';
HOW IT WORKS · ANIMATED 12 s cycle

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.

IN MEMORYHOT · LOCAL NVMeCOLD · S3 BUCKET kv cache · sessions orders events rates events · copying… events placement flipped: new statements read S3 PAGE CACHE · BYTE BUDGETreads: cache, then bucketwrites: overlay, crash-safe commit rates STORAGE MOVE TABLE events TO 'kv:archive'; STORAGE MOVE TABLE rates TO 'memory:';
  1. 1
    Three tiers

    Memory for what must be fastest, local NVMe for the working set, an S3 bucket for history.

  2. 2
    Copy

    STORAGE MOVE TABLE events TO 'kv:archive' copies the table's files into the bucket's object layout.

  3. 3
    Flip

    The placement flips in one step. New statements read the S3 copy; nothing in between sees half a table.

  4. 4
    Remove the original

    The files on NVMe are deleted, and the disk has the space back.

  5. 5
    Read through a cache

    Reads of the S3 table go through a byte-budgeted page cache; writes land in an overlay and commit crash-safely.

  6. 6
    And into memory

    A hot lookup table moves the other way: STORAGE MOVE TABLE rates TO 'memory:'.

IN MEMORY · MEASURED

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 12RasterizedDBRedisRedis io-threadsValkeyValkey io-threadsvs bestworst vs their best
32 B, 1 SET : 10 GET402k172k288k180k299k1.34×1.29×
same, pipeline 163.37M1.38M1.37M1.32M1.30M2.45×2.40×
1 KiB, 1 : 1403k170k281k173k280k1.43×1.32×
same, pipeline 161.53M816k724k821k853k1.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.

DRIVERS

Five places a table can live.

BackendSpecFor
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
sql
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
SCALE

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.

S3 bucketas large as the bucket
× shardsmachines, behind a gateway
× storage poolsdisks per machine
× partitionsup to 2²⁰ per table
GET STARTED

Running in one command.

Linux and Windows, x86-64 and ARM64, a static musl build, an Arch package, or Docker.

terminalDOCKER
# 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"
✓ page rendered in 97 µs axum + tera + htmx · no other javascript