Zerodha Builds High-Performance Blob Store with SQLite
Zerodha operates a trading platform serving 20 million users who customize their interface with chart layouts, indicators, and workspace configurations. These preferences—mostly JSON blobs ranging from kilobytes to megabytes—experience thousands of concurrent read/write operations per second. When their legacy SSDB storage became unmaintained and hit single-node scaling limits, the company built Blobasaur, an open-source distributed blob storage system in Rust with Redis protocol compatibility.
The evaluation process tested major alternatives with specific drawbacks: ScyllaDB struggled with large payloads and high resource consumption, PostgreSQL’s BYTEA columns proved storage-inefficient, SeaweedFS’s append-before-compact model caused disk bloat under heavy overwrites, and S3-compatible systems incurred unacceptable per-request latency and costs at scale. SQLite emerged as an unexpected fit—benchmarks showed it outperforms raw filesystem I/O for small objects, and because 99% of compressed payloads stay below 100 kilobytes, the database delivered essential features like ACID guarantees, crash recovery, and standard introspection tooling.
Zerodha implemented Blobasaur in Rust to avoid Go’s CGo overhead and garbage collection pressure when processing multi-megabyte buffers under high concurrency. The system maintains single-digit millisecond latency across payload sizes, includes built-in compression for repetitive JSON, and partitions data across multiple nodes for horizontal scaling. The team accepted relaxed durability guarantees—acceptable since the store holds only non-critical UI state—enabling significant performance optimizations without compromising the core trading platform.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.