Zerodha has replaced the older SSDB storage system used for saving user preferences on its Kite trading platform with a new open-source solution built on SQLite. Called Blobasaur, the distributed storage system is designed to handle the large volumes of customised interface data generated by millions of Kite users, including saved chart layouts, trading workspaces, indicators and drawings.

The migration addresses limitations in SSDB, which was no longer actively maintained and could operate on only a single machine. Zerodha developed Blobasaur using SQLite and Rust, combining the lightweight database with a distributed architecture designed for high-volume reads and writes. The company says the new system can handle tens of thousands of operations per second, with 99th-percentile latency of approximately two milliseconds during a full trading session.

Key Takeaways

  • Zerodha has migrated Kite’s user preference and workspace storage from SSDB to Blobasaur.
  • Blobasaur is an open-source distributed storage system built using SQLite and Rust.
  • SSDB had become difficult to scale because it was no longer maintained and operated on a single machine.
  • Zerodha previously limited stored preference blobs to 1 MB because larger records increased latency.
  • The new system supports tens of thousands of read and write operations per second.
  • Zerodha reports approximately 2-millisecond 99th-percentile latency during a full trading session.
  • Blobasaur is released under the AGPLv3 open-source licence.
  • Automatic failover and live data redistribution are among the capabilities not yet implemented.

What Is Blobasaur?

Blobasaur is a distributed blob-storage system developed by Zerodha to store the data behind customised features on Kite.

A blob, or binary large object, is a unit of data stored and retrieved as a single object. In Zerodha’s implementation, many of these objects contain JSON-based information describing a user’s interface settings.

Kite allows customers to customise their trading screens in several ways. Users can save multiple chart layouts, create workspaces, arrange widgets, configure financial indicators and store drawings.

All these preferences generate data that the platform must save and retrieve quickly. As the number of users and customised settings increases, the storage infrastructure must handle a large number of requests without slowing down the application.

Zerodha says Kite has around 20 million customers. The company built Blobasaur to support this workload while improving the ability to distribute storage across multiple machines.

The system is written in Rust and uses SQLite as its underlying database. It also supports the Redis protocol, allowing existing services to communicate with it using familiar client libraries.

Why Did Zerodha Move Away From SSDB?

SSDB had served Zerodha reliably for several years, but the engineering team eventually encountered limitations that made it less suitable for the platform’s growing storage requirements.

1. SSDB Was No Longer Maintained

One of the main reasons for the migration was that SSDB was no longer actively maintained.

The software also operated on a single machine, creating limitations as the amount of stored preference data and the number of requests increased.

Zerodha needed a solution that could distribute workloads across multiple machines rather than depending on a single storage server.

2. Larger Files Increased Latency

Kite’s customisation features generate records ranging from a few kilobytes to several megabytes.

As these records became larger, the performance of the existing system deteriorated. Zerodha consequently had to impose a 1 MB limit on individual blobs to control latency.

This restriction became increasingly inconvenient as users created more complicated workspaces and saved larger collections of chart settings.

3. Trading Activity Creates Unpredictable Workloads

Storage demand on a trading platform does not remain constant throughout the day.

Market volatility, changing prices and user activity can produce sudden increases in requests. During busy trading periods, the platform must handle large numbers of reads and writes without allowing storage operations to become a bottleneck.

Zerodha software engineer Sarat Chandra described these workloads as unpredictable and bursty because of stock-market volatility.

The company therefore needed a storage architecture capable of handling changing demand while maintaining low response times.

Why Did Zerodha Choose SQLite?

SQLite is widely used as a lightweight database embedded within applications. Unlike conventional database servers, it does not require a separate database-server process for every deployment.

However, SQLite has limitations when multiple processes attempt to write to the same database simultaneously. Its architecture generally permits only one active writer at a time for a database file.

Zerodha addressed this limitation by distributing data across multiple SQLite database files, or shards.

Each shard can handle its own write operations, allowing the system to distribute work rather than forcing every request through one database writer.

According to Zerodha’s engineering explanation, SQLite was also attractive because it performed well compared with raw filesystem operations in the company’s testing. The team reported that SQLite could be up to 35% faster than raw filesystem I/O in the evaluated workloads.

The choice allowed Zerodha to combine a relatively simple database with a distributed architecture tailored to its particular requirements.

How Blobasaur Works

Blobasaur combines SQLite, sharding and Redis-compatible communication to support Kite’s storage workload.

1. Data Is Distributed Across Shards

Instead of storing every record in one database file, Blobasaur divides data across multiple SQLite shards.

It uses a consistent-hashing approach to distribute keys between shards. This helps the system spread requests across different storage units.

When the number of shards increases, consistent hashing can reduce the amount of data that needs to move compared with simpler distribution methods.

2. Dedicated Writers Handle Database Updates

Each shard has a dedicated writer that batches incoming changes into database transactions.

Batching multiple writes can reduce the overhead associated with committing each individual request.

Blobasaur also maintains read-only database connections, allowing read operations to be handled separately from the main writing process.

This architecture helps the system support a mixture of read-heavy and write-heavy workloads.

3. Existing Redis Clients Can Connect

Blobasaur supports the Redis protocol and Redis Cluster communication.

This is important because Zerodha’s existing services already use Redis-compatible clients. The company could therefore move the underlying storage infrastructure without rewriting every service that communicates with it.

The system uses 16,384 hash slots, following the Redis Cluster model, to distribute keys across the cluster.

4. The System Is Built in Rust

Zerodha chose Rust as the programming language for Blobasaur.

The engineering team cited considerations around its SQLite integration and the desire to avoid the CGo dependency associated with the Go SQLite driver used in its evaluation.

Rust is increasingly used in infrastructure software where performance, memory safety and control over system resources are important.

What Performance Improvements Has Zerodha Reported?

Zerodha published benchmark results to demonstrate how Blobasaur performs under different configurations.

In a test using a 16-core laptop, the system handled approximately 29,538 combined read and write operations per second with a 16-shard configuration.

The company also reported that write-heavy workloads benefited from distributing operations across more shards.

Benchmark configurationCombined read and write throughput
Single shard14,227 operations/second
16 shards29,538 operations/second

These figures come from a benchmark conducted on a laptop, with the server and load generator sharing the same machine. They should not be interpreted as a direct measurement of production throughput.

For production, Zerodha says Blobasaur runs across three nodes, each equipped with four virtual CPUs and 8 GB of memory.

During a full trading session, the company reports that 99th-percentile latency across commands remains around two milliseconds on each node.

The 99th percentile is a measure of how long almost all requests take to complete: approximately 99% of requests finish within the reported time.

These results indicate that the new system is designed to prioritise predictable response times as well as throughput.

How Did Zerodha Migrate Without Disrupting Kite?

Replacing the storage system required moving existing user preferences while ensuring that customers did not lose their saved settings.

Zerodha used a phased migration rather than switching everything at once.

The process involved three main stages:

First, new workloads were moved. When Kite Terminal mode was launched, its workspace storage was connected directly to Blobasaur.

Second, existing workloads used dual writes. For older features such as chart preferences, the company modified services to write new changes to both SSDB and Blobasaur. A background process also migrated historical records.

During this period, reads were directed to Blobasaur first. If a record was missing or an error occurred, the system could fall back to SSDB.

Third, Zerodha completed the cutover. The company ran dual writes for approximately one month and reported no discrepancies between the two systems. It then switched off SSDB.

This approach helped the engineering team validate the migration before retiring the older infrastructure.

What Are Blobasaur’s Current Limitations?

Despite the performance improvements, Blobasaur does not yet include every feature associated with mature distributed storage platforms.

Zerodha has identified automatic failover and live redistribution of data between nodes as capabilities that have not yet been implemented.

Automatic failover allows a system to continue operating when a server becomes unavailable. Live redistribution allows data to be moved between storage nodes while the system remains online.

The current architecture also requires the server to be stopped for certain shard-migration operations.

These limitations are important for developers considering Blobasaur for their own applications. The system was designed around Zerodha’s particular workload, and its suitability for other businesses will depend on their reliability, availability and data-durability requirements.

Zerodha also uses SQLite’s write-ahead logging mode with a synchronous setting chosen to balance performance and durability. The engineering trade-offs mean that the system should not automatically be treated as suitable for critical financial records.

The company uses it for interface preferences and workspace data, which have different durability requirements from transaction ledgers or account balances.

Blobasaur Is Open Source Under AGPLv3

Zerodha has released Blobasaur under the GNU Affero General Public License version 3 (AGPLv3).

The licence makes the project’s source code available for developers to inspect, use and modify under its terms.

The release could be useful to engineering teams dealing with large JSON records, distributed storage requirements and workloads that need low-latency reads and writes.

Developers can examine the architecture, benchmark results and implementation details through the project’s public GitHub repository.

The release also offers an example of how an engineering team can adapt an established database technology to solve a specialised infrastructure problem rather than adopting a conventional database platform without modification.

The Bigger Picture

Zerodha’s migration highlights an important trend in software infrastructure: companies do not always need a large, conventional database system to solve every storage problem. By combining SQLite with sharding, Rust and Redis-compatible communication, Zerodha has built a system tailored to a specific workload involving millions of users’ saved preferences.

The project is also notable because it addresses a practical engineering challenge rather than introducing a new database technology from scratch. SQLite provides the underlying storage engine, while Blobasaur adds the distributed architecture and operational features required by Kite.

For developers, the most useful lesson may be the importance of matching infrastructure to the data being stored. User-interface preferences can tolerate different durability trade-offs from financial transactions. That distinction allowed Zerodha to prioritise performance and operational simplicity for this particular use case.

What Happens Next?

Zerodha’s next engineering priorities may include addressing the distributed system’s remaining operational limitations, particularly automatic failover and live data redistribution. These capabilities would make the platform easier to manage as storage requirements change and individual nodes need to be replaced or expanded. The company has identified them as features that are not yet implemented.

Meanwhile, the public release of Blobasaur gives developers an opportunity to examine its design and evaluate whether the approach fits their own workloads. Its performance figures are promising, but organisations considering adoption will need to assess durability, availability, migration requirements and operational complexity against their specific needs.

Get the day’s top stories in your inbox

One concise email. No spam, unsubscribe anytime.