FOUNDING PRICING · 40% OFFfor the first 1,000 members · from ₹95/month
ArchitectureZerodha11 min read

How Zerodha Kite Handles the 9:15 Market Open Rush

How Zerodha serves the 9:15 am market open with a team of about 30 engineers, using a Redis hot cache, Go services, PostgreSQL and leased lines.

ShareXLinkedInWhatsApp
The National Stock Exchange of India building at Bandra Kurla Complex in Mumbai, a grey stone and green glass block with the NSE logo, seen from across an empty road.
The National Stock Exchange of India building at Bandra Kurla Complex in Mumbai, a grey stone and green glass block with the NSE logo, seen from across an empty road. Photo: 312user, CC BY-SA 4.0, via Wikimedia Commons.

Indian stock markets open for regular trading at 9:15 in the morning, and Zerodha's founder wrote in 2019 that several lakh people log in to its Kite platform at that same moment. Zerodha has been India's largest stock broker since January 2019, and its technology team had 30 people in April 2020 and 31 in July 2021. How so few engineers serve a daily stampede is worth understanding, because the answer is mostly caching, careful database work and a refusal to add moving parts.

Zerodha has never published a single document on how it handles the market open. What follows is assembled from its tech blog, posts by its founder, a 2026 explainer from its own newsletter and a 2021 podcast with its CTO. Where those sources are silent, this post says so.

A diagram of an order's path: from the Kite app through Cloudflare and AWS load balancers, over a point-to-point leased line into Zerodha's racks in a data centre, through a pre-filter, the order management system and the risk management system, and then over exchange leased lines to NSE, BSE or MCX.

The shape of the load

A stock broker's traffic does not look like a social network's. Almost nothing happens overnight, and then everything happens at once. In its post-mortem of an incident on 27 February 2019, Zerodha described the window from 9:14 to 9:20 as the period of exceptional login and order activity. Its CTO, Kailash Nadh, wrote in June 2020 that a tenfold burst of traffic within ten seconds is common on trading platforms.

The published numbers, each with its year:

YearWhat Zerodha said
2019Several lakh simultaneous logins at 9:15, over 30 lakh orders a day, more than 30 lakh market ticks streamed every second
April 2020Tech team of 30, about 1 million daily active users, a record of over 7 million trades in one day, hundreds of thousands of requests per second in peak market hours
July 2021Customers up from over 2 million to over 6 million in about a year, days of over 12 million trades, more than a million users connected at once
November 2021A record day of 14 million trades
November 2026About 20 million Kite customers

Zerodha has not published a requests-per-second figure for the opening minute itself, so none is given here.

The Bombay Stock Exchange tower on Dalal Street in Mumbai seen from below, with an LED ticker running around the lower building showing share prices in green and red.
The BSE building on Dalal Street, Mumbai, with its price ticker, in January 2013. Photo: BSEINDIA, CC BY-SA 3.0, via Wikimedia Commons.

It helps to split what a trader's app does into two kinds of work.

Reads. Show my orders, my positions, my holdings, my funds. Every user does this the moment they log in, and the app repeats it through the day. This is the bulk of the request count.

Writes. Place, modify or cancel an order. There are far fewer of these, but each one must be checked against the user's margin, recorded, and delivered to an exchange in real time.

The 2019 post-mortem put a number on the split: over 90% of the activity load from about half a million concurrent clients was handled by systems Zerodha had built itself, and the rest went through a licensed order management system. The architecture follows from that split. Make the reads nearly free, and protect the narrow write path.

The read path: a deliberately dumb cache

In the June 2020 post, Nadh described how Kite serves what the user sees. Orders, positions and portfolio data are all read from a hot Redis cache. A request does a constant-time key lookup and sends back the bytes it finds. There is no SQL query on that path and no JSON being built.

Three details make this work.

First, the cache is filled from the other side. A separate, asynchronous service writes into Redis. In the 2021 podcast Nadh put it this way: data is serialised once, when an event such as an order update happens, and kept in memory so that HTTP requests can be answered directly. The cost of building a response is paid once per change, not once per read. If a user refreshes their order book fifty times, the server does fifty lookups and zero computation.

Second, the cache is deliberately dumb. The application does not parse the cached value or understand its structure. It stores bytes and returns bytes. That keeps CPU use and memory allocation on the hot path close to nothing, which matters in Go, the garbage-collected language Zerodha uses for its high-throughput services.

Third, durability is switched off. Redis disk persistence is disabled, which the post says avoids roughly doubling RAM use, and several instances run for availability. The whole day's trading data for millions of users fits in a few hundred GB of RAM. Losing a cache node is acceptable because the cache is not the source of truth.

A diagram of Kite's read path: an asynchronous service serialises each order or position once when it changes and writes the bytes to Redis, the Kite API does a constant-time lookup and returns those bytes, and a second request carrying a matching ETag is answered with a 304 and no body.
Serialise once on write, look up on read, and skip the body when nothing changed

On top of that sits HTTP caching. Kite's API responses carry an ETag, and the current tag for each user and resource is stored in Redis. When the app asks again and its tag still matches, the server replies 304 Not Modified with no body. Invalidation is just deleting the tag. The 2020 post says this saves terabytes of bandwidth a month and speeds things up for mobile users on slow networks.

The result, from the July 2021 post, is a baseline round trip of about 40 ms on a good connection, and a team that treats a drift from that number as a reason to investigate.

Fewer connections, not more

The same 2020 post is blunt about networks: use them as little as possible. Two habits stand out.

Small pools. A database or Redis server can only do so much at once, so opening thousands of connections buys nothing. The post argues for small pools of reused connections, and names the failure this avoids: when latency rises, naive pools grow, the upstream gets even more concurrent work, and latency rises further.

Proxies absorb slow clients. A phone on a weak mobile connection can hold a server connection open for seconds. HAProxy and Nginx sit in front of the applications, soak up those slow connections, and talk to the services over a small set of keep-alive connections.

Live prices take a different route. Zerodha's first Go service, written in 2014, was a ticker that pushes quotes to clients over WebSockets. By April 2020 it was broadcasting about 16 million ticks a second to hundreds of thousands of users.

The write path: placing an order

The order path is where Zerodha cannot simply cache. Its June 2026 explainer walks through the hops:

  1. The request reaches Cloudflare, which screens out attack traffic.
  2. It passes through AWS load balancers.
  3. It crosses a dedicated point-to-point leased line into Zerodha's own racks in data centres in Mumbai and Chennai, with the internet as an automatic backup route.
  4. Inside the data centre, a custom pre-filter (a mini RMS) checks basics such as price circuit limits and whether the account is active. Then the order management system logs the order and gives it an ID, and the risk management system checks margin.
  5. The order leaves on exchange leased lines to NSE, BSE or MCX. There are two physical lines from two providers.

The explainer adds that each customer is mapped to one of four silos, two in Mumbai and two in Chennai, and that exchange lines are sold by messages per second: a line rated for 5,000 messages a second costs about ₹2.5 crore for a primary and backup pair.

This hybrid layout is not new. A Zerodha post from April 2020 already described physical racks in two data centres, where the exchange lines end, connected to AWS over leased lines.

A long, brightly lit aisle between two rows of white perforated-door server racks on a raised floor in a data centre.
Racks at a Pi Data Centers facility in India, shown as an illustration of colocation racks; not Zerodha's own. Photo: PiDatacenters, CC BY-SA 4.0, via Wikimedia Commons.

The order management system is the part Zerodha did not write. In 2019 it was a licensed product run by an outside vendor, and that is where the two public incidents of that year occurred. On 27 February 2019 the OMS had connectivity trouble at the open, several lakh orders queued up, and customers who saw stuck orders placed more, which made the backlog grow faster. On 29 August 2019 a single unusual order caused more than 30 minutes of OMS downtime. In November 2021 Nadh said an in-house replacement had been in the works for about two and a half years and was in internal beta. He also explained why it is slow going: there is no public specification for an order or risk system, and mistakes cost money. Zerodha's 2026 explainer still names a vendor product, OmneNest, as the OMS on the order path, and no public source says how far the replacement has gone.

PostgreSQL, used at night

The trading day is served from memory. The record of it lives in PostgreSQL, behind Console, Zerodha's reporting product. The April 2021 post gives the shape:

  • Hundreds of billions of rows, about 20 TB, across four sharded nodes, self-managed on EC2.
  • About 99% of writes happen at night, in end-of-day jobs that reconcile the exchanges' data dumps.
  • Tables are partitioned by month. Daily partitions made the nightly bulk load faster but slowed date-range reports, so monthly won.
  • Sharding uses postgres_fdw, an extension bundled with PostgreSQL. Old financial years live on smaller nodes and appear on the primary as foreign tables. The post says the split took under two hours because moving a partition is cheap.
A diagram of Console's reporting databases: a primary PostgreSQL node holds the current year in monthly partitions, older financial years sit on three smaller shard nodes reached through postgres_fdw foreign tables, and report queries go through the sql-jobber queue, which writes each result as its own table in a separate cache database that is dropped every night.
Monthly partitions, older years on shards, and a throwaway PostgreSQL as the report cache

The cache in front of it is unusual. Report results need sorting and filtering, which Redis does poorly, so the hot cache is another PostgreSQL instance. A job queue called sql-jobber runs each heavy query once and writes the result into its own table in the cache database. Later sorting and filtering hit that small table. The cache database has write-ahead logging and fsync turned off, collects tens of millions of tables a day, and is dropped and recreated every night.

The trade-offs they accepted

  • A cache that can vanish. With persistence off, a Redis restart means refilling from the systems of record. Zerodha chose speed and half the RAM over a durable cache.
  • Rewrites over patches. Kite began in Python in 2015 with about 1,000 concurrent users, was rewritten in Go in 2017, and had its web backend replaced again in June 2021 with about half the lines of code.
  • Self-hosting. PostgreSQL, Redis, Kafka and most internal tools are run in-house, which costs operational effort and saves licence fees.
  • A vendor on the critical path. The exchange-facing OMS was outside Zerodha's control for years, and its 2019 outages show the price.

The computer science underneath

Lazy versus eager caching. Most tutorials show a cache filled lazily, on a miss. Kite's is filled eagerly by a writer when data changes, so a read never triggers a database query. A lazily filled cache is at its weakest when many users arrive together and all miss at once, which is exactly what a market open looks like. The lesson on caching strategies compares the patterns, and inside Redis explains why a single-threaded event loop gives such steady lookup times and why fork-based snapshots can need up to twice the memory, which is the cost Zerodha avoids by turning persistence off.

Conditional requests. An ETag is a version label for a response. The client sends it back in If-None-Match, and the server answers 304 if nothing changed. The request still costs a round trip, but not the payload. See HTTP caching: freshness, ETags and 304.

Connection pooling. Throughput is set by how many requests the backend can work on at once, not by how many sockets are open. The lesson on database connection pooling covers pool sizing and what happens when a pool is allowed to grow under load.

Partitioning. Splitting a table by month lets the planner skip partitions a query cannot match and turns removing or moving old data into a metadata operation. That is exactly what made Zerodha's two-hour sharding possible. Table partitioning covers pruning and cheap deletes.

What an interviewer could ask from this

Why not query the database on every read and add replicas? Replicas add capacity linearly, while a 9:15 burst is tenfold in seconds. Serving precomputed bytes from memory makes each read a constant-time lookup with predictable latency.

What do you lose by turning off Redis persistence? A restarted node comes back empty and must be refilled from the source of truth. You gain memory headroom and avoid snapshot pauses. It is only safe when the cache is never the system of record.

How does an ETag reduce load if the request still reaches the server? The server compares a small tag and returns 304 with no body, so it saves bandwidth and client parsing. It does not save the round trip.

Why can a retry storm make an outage worse? In February 2019, users re-placed orders that looked stuck, so the queue grew faster than it drained. Retries multiply load exactly when capacity is lowest, which is why clients need back-off and servers need to shed load.

Why partition by month and not by day? Daily partitions sped up inserts but forced range queries to touch many partitions. Choose the partition size to match the common query, which here is a monthly report.

Takeaways

  • The opening rush is mostly reads, and Kite answers reads with a key lookup that returns bytes serialised earlier, when the data changed.
  • A cache can give up durability if something else is the source of truth. That bought Zerodha lower RAM use and steadier latency.
  • The order path is a short chain with redundant links, and its weakest part in 2019 was the one component Zerodha did not control.
  • PostgreSQL carries hundreds of billions of rows through partitioning, simple sharding and a disposable cache database.
  • A small team is possible when the design has few moving parts and each part is well understood.

Sources

  1. Zerodha Tech Blog: Hello, World! (Kailash Nadh, 6 April 2020)
  2. Zerodha Tech Blog: Scaling with common sense (Kailash Nadh, 14 June 2020)
  3. Zerodha Tech Blog: Scaling with common sense #2, Being future ready (Kailash Nadh, 28 July 2021)
  4. Zerodha Tech Blog: Working with PostgreSQL (Satya Sarangi, 22 April 2021)
  5. Zerodha Tech Blog: Infrastructure monitoring with Prometheus at Zerodha (Karan Sharma, 27 April 2020)
  6. Zerodha Tech Blog: Distributed, high-performance blob storage on SQLite (Sarat Chandra, 19 November 2026)
  7. Zerodha Z-Connect: Today's technical issues, postmortem (Nithin Kamath, 27 February 2019)
  8. Zerodha Z-Connect: On conspiracy theories about Zerodha (Nithin Kamath, 3 September 2019)
  9. In The Money by Zerodha: From your phone to the exchange (1 June 2026)
  10. Software at Scale 37: Building Zerodha with Kailash Nadh (16 November 2021)

Written by the Codevizag Academy team

An independent explainer built from the public sources listed above. Codevizag Academy is not affiliated with Zerodha. Found a mistake? Write to support@codevizag.com.

More case studies

Understood it? Now prove it.

The lessons behind this case study are free, and 20 problems a month are judged on real test cases at no cost.

Start solving free