NewsCrawler.org

Blobasaur: a sharded blob storage server built on SQLite by Zerodha

HSET payload size before and after compression
Two-level routing across Blobasaur nodes
Command latency (p50, p90, p99) per node over a trading session
p99 latency per command per node over a trading session
Image: zerodha.tech

Zerodha published a post about Blobasaur, a storage server it built for user preferences on Kite, its trading platform with about 20 million customers. Kite users save multi-chart layouts, indicator templates, drawings and interface settings, and the backend stores them as blobs, mostly JSON, from a few KB to several MB. Earlier the company stored these in CouchDB and then in SSDB[1], which became unmaintained, is written in C++, and runs on a single node, so at one point blob sizes had to be capped at 1 MB.

The team needed a distributed store that speaks the Redis protocol[2], has a simple key-value API, keeps latency low for payloads from 2 KB to 5 MB, compresses data, and supports TTLs[3]. Existing services already used Redis libraries, so compatibility would let them stay unchanged. Relaxed durability was accepted, because the store holds non-critical UI and workspace preferences, not financial data. The post explains why ScyllaDB, PostgreSQL, YugabyteDB, RocksDB, Ceph, SeaweedFS, S3, MinIO and a raw filesystem were rejected.

SQLite was chosen because it offered atomic writes, TTL cleanup and metadata handling that a raw filesystem lacked. Zerodha built Blobasaur in Rust as an open source sharded server that speaks the Redis protocol and uses SQLite as its storage engine. It ships as a single binary, is in production at Zerodha, and has replaced SSDB. According to the post, it handles thousands of reads and writes per second on commodity hardware with single-digit millisecond latency.

Read the original zerodha.techDiscussion

Discussion

Commenters mostly ask about fault tolerance and replication, which the post does not cover, and about what happens when a node goes down. Some doubt that outsiders can use it in its current state. Others suggest rqlite or a database-per-user design, and one says it is simply sharding.

Sources

Published: First seen: Читать по-русски

Open as a page