Open SourceDatabasesInfrastructure

Blobasaur: Redis Protocol, SQLite Backend, Zero Client Changes

Zerodha, India’s largest stock broker, open-sourced Blobasaur today — a Rust blob server that speaks the Redis Cluster protocol while storing everything in SQLite shards on disk. It is in production at Zerodha right now, replacing an abandoned SSDB deployment, and benchmarks at 25,324 HSET ops/second with 64 KiB payloads at single-digit millisecond latency. The part worth your attention: your existing Redis client connects unchanged.

Why Redis Falls Short for Blobs

Redis is an in-memory database. For small keys and hot data, that is a feature. For multi-megabyte JSON blobs that need to persist across restarts, it is an expensive liability. You end up paying for large RAM instances to store data that is only occasionally read — most of which could live happily on disk.

Zerodha’s previous solution was SSDB, a C++ disk-backed store that speaks the Redis protocol. SSDB solved the RAM problem but introduced a worse one: the project is abandoned. For a financial services platform processing millions of trades, running critical infrastructure on dead software is not an option. The team needed something disk-backed, Redis-protocol compatible, and actively maintained. Rather than adopt Kvrocks — the Apache project that provides Redis protocol over RocksDB — they built Blobasaur.

The Architecture: Two Levels of Routing

The design is straightforward once you see it. Blobasaur uses two-level routing to distribute keys across a cluster.

At the cluster level, it uses CRC16(key) % 16384 — the exact same hash slot calculation as Redis Cluster. Clients using the Redis Cluster protocol connect, discover nodes via gossip, and get redirected with MOVED and ASK responses exactly as they would with Redis. No client code changes required.

At the node level, multi-probe consistent hashing selects which SQLite shard file on that node holds the key. Each shard has its own dedicated writer process. This is the performance lever: parallel writes without locking contention, because no two shards share a writer.

The SQLite files themselves are a practical bonus. Any shard can be opened and inspected with the standard sqlite3 CLI — no proprietary tooling required, no vendor lock-in on your storage format.

The Benchmark Numbers

Zerodha’s production deployment runs three nodes, each with 4 vCPUs and 8 GB RAM. At benchmark, Blobasaur handles 25,324 HSET operations per second with 64 KiB JSON payloads — roughly 1.66 GB/s of uncompressed write throughput at single-digit millisecond latency.

Compression changes those economics significantly. Blobasaur supports zstd, lz4, gzip, and brotli. With zstd, the JSON test payloads compress approximately 9x, bringing actual disk I/O down to around 184 MB/s. For JSON-heavy workloads, zstd is the right default.

Blobasaur vs. Kvrocks

The honest comparison is Blobasaur versus Kvrocks. Both give you Redis protocol over a disk-backed store. The difference is the backend: Kvrocks uses RocksDB, Blobasaur uses SQLite.

RocksDB is more powerful — it handles higher write amplification scenarios and gives you more tuning knobs. It is also more complex to operate. SQLite is boring in the best way: stable, well-understood, readable with a standard tool, and easy to vacuum. For teams that want operational simplicity over configurability, Blobasaur wins. For teams already comfortable with RocksDB internals, Kvrocks has more surface area to work with.

When to Use It

Blobasaur is purpose-built for one use case: large blob storage where you want Redis protocol compatibility without the RAM cost. It is not a general Redis replacement. It does not implement sorted sets, streams, pub/sub, or the full Redis command surface. If you use Redis primarily as a key-value store for multi-megabyte objects — JSON payloads, serialized state, cached renders — Blobasaur is worth evaluating.

If your Redis usage is built around data structures or requires in-memory speed at any cost, stay on Redis or move to Valkey.

Getting Started

Blobasaur is available on GitHub under the AGPLv3 license. The README covers single-node setup and cluster configuration. Railway has a one-click deploy if you want to try it without touching infrastructure. The Zerodha tech blog post is worth reading in full — it covers the SSDB migration, the sharding algorithm decision, and the compression benchmarks in detail.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:Open Source