How to design Robinhood
The first sections are free. The deep dives, level expectations and quiz are part of Pro.
On this page
The problem
A stock trading app of this kind is a broker: it shows live prices and carries orders to an outside exchange, which fills them. Two flows shape the design and run in opposite directions. Prices move from one exchange feed out to crowds of phones, so the question is how to fan each tick out to the people watching that stock without making each server read the whole market. Orders move from a tap to the exchange, and the same order must reach it at most once even when the call times out and the user taps again; the exchange, not the app, holds the real state of an order, and the design is built around learning that state.
Clarifying questions
| Ask | Why it matters | A typical answer |
|---|---|---|
Do we send orders to one exchange or route among several? | Routing among venues adds a smart order router and best-execution rules. With one exchange the hard part is agreeing with it, not choosing it. | As posed, 1 outside exchange fills all orders and its feed carries the prices. The app is a broker, not the exchange. |
How fresh do prices need to be, and how many people watch at once? | Near real time means a push channel per connected user; a price a minute old could be served from a cache on a timer. The crowd size decides how many servers hold those connections. | Near real time: a user watching a stock should see each move within moments. There are 28.6 million funded customers, popular stocks are watched by large crowds at the same time, and prices tick many times a second. |
Which order types, and can a user cancel? | Market and limit orders are enough to force the interesting problem: a limit order can sit open for hours, so its status arrives long after the call that placed it. Cancel adds a race against a fill. | Market and limit orders on stocks, and cancel of an order that has not filled. Options, ETFs and crypto are out of scope. |
What does the exchange give us back: a reply to each call, a stream of fills, or both? | If the exchange reports fills on a separate stream, the app can treat that stream as the record and the synchronous reply as a hint. If there is no stream, the app has to poll for status. | Both: a synchronous place and cancel API, and a trade feed that reports fills with the order id the app sent. |
When is the peak? | Orders bunch at the market open, so the design is sized for that peak window, not the average minute. | Orders peak at the market open. Trading outside market hours is out of scope. |
Do we show the order book or just the last price? | A live order book multiplies the update rate per symbol by the depth shown, and changes the data model from one number per stock to a sorted structure per stock. | No. Show the last price for each stock; the live order book is out of scope. |
Non-functional requirements
| Requirement | What it forces |
|---|---|
Prices reach watching users in near real time | A connection the server can write to the moment a tick arrives, so a push stream per connected user rather than a timer on the phone. Each price server should receive just the symbols its users watch, or the fleet spends most of its time dropping ticks nobody connected to it needs. |
An order is placed at the exchange at most once, whatever the retries | The order has to exist in our store, filed under a key chosen on the phone, before the exchange is called, so a second tap finds it instead of creating a twin. The exchange call carries an id our service chose on each attempt, and because duplicate handling differs by venue, the design queries the order's status by that id before any retry rather than relying on the exchange to drop a repeat. |
The app’s view of an order never disagrees with the exchange for long | The exchange is the record. Our status column is a copy, updated as fills arrive on its feed and matched to orders by id, and a job queries the exchange about orders left pending past a threshold, so a lost reply is corrected on the job's next pass while the exchange is reachable, rather than at the end of the day. |
Estimates
| Quantity | Working | Result | What it sizes |
|---|---|---|---|
Users connected at the market open | Assume a tenth of the 28.6 million funded customers have the app open at the opening bell (an assumption to say out loud): 28.6 million × 10% ≈ 2.86 million live connections | About 2.86 million open price streams | The price server fleet: how many connections it has to hold at the same time. |
Price servers for those connections | Assume one server holds about 100,000 mostly idle streams (a planning figure, not a measurement): 2.86 million ÷ 100,000 ≈ 29 servers | About 29 servers; plan for 30 to 40 so one dying does not overload the rest | The fleet size, and the number of subscribers one symbol's channel has when the fleet is subscribed by symbol. |
Ticks into a server that reads the whole feed | Assume 5,000 listed stocks (the prompt's thousands) each ticking 10 times a second on average: 5,000 × 10 = 50,000 ticks a second into each price server, whatever its users watch; across 29 servers that is about 1.45 million tick deliveries a second from a single feed | 50,000 ticks a second per server, about 1.45 million a second across the fleet | The waste in the first design, where each server consumes the whole market: a server whose users watch a few hundred stocks throws nearly all of it away. |
Fan-out for one popular stock | Assume 1 million of the 2.86 million connected users watch the same stock (about 35%), and it ticks 10 times a second: 10 million messages a second to phones. With channels per symbol, the pub/sub layer sends each tick once to each of about 29 subscribed servers, around 290 messages a second; the 10 million per-connection writes land on the price servers | 10 million phone writes a second, against about 290 pub/sub deliveries a second | Where the load of a hot symbol lands: on the servers' connection writes, which grow with the servers you add, not on the channel. |
Polling instead of push | 2.86 million connected users asking once a second = 2.86 million requests a second, most returning a price that has not changed; asking once in 5 seconds cuts it to about 572,000 a second and shows prices up to 5 seconds late | 2.86 million requests a second at a one-second poll | The cost of the polling alternative against one open stream per user: the request rate is paid whether or not the price moved. |
Reconnect burst after a price server fails | One server's 100,000 streams drop together; if clients come back within a | About 33,000 reconnects a second for a few seconds | The latest-price cache and the connect path, which must take a burst rather than a steady rate. |
A reported brokerage peak, for headroom | Robinhood's engineering blog reported 100k requests a second at peak in December 2019 and 750k in June 2020, which it calls a 7x rise over six months | 750k requests a second at peak, 7x in six months | How much headroom the whole brokerage side needs: a market-open peak across its requests can multiply within months, which is the case for sharding the orders store by user instead of running one database. |
Orders a day from reported volume | The August 2026 operating data reports equity average daily volume of $16.0 billion. Assuming an average order near $1,000 (an assumption): about 16 million equity orders a trading day. If a quarter of those 16 million land in the first half hour, that is 4 million orders in 1,800 seconds, about 2,200 a second at the open | Roughly 16 million orders a day and about 2,200 a second at the open, under these assumptions | The write rate on the orders table and the call rate into the exchange at the open. |
Core entities
| Entity | What it holds |
|---|---|
User | An account that can watch stocks and own orders. Sign-up and identity are out of scope, so it stays a stub. |
Symbol | One stock and its most recent price, as last seen on the exchange feed. |
Order | One request to buy or sell, written before the exchange hears of it and corrected afterwards from the trade feed. |
Trade | One fill reported by the exchange feed, kept as the record from which order status and positions are derived. |
Position | What a user holds in one stock: the running total of their fills. |
The API
| Endpoint | Notes |
|---|---|
| The first response carries the latest price so the screen has a number before the stream delivers a tick. The stream is one server-sent events connection per client carrying the user's watchlist, not one connection per stock, because browsers cap open connections per domain when not on |
| Carries an |
| Marks the order cancel_requested and asks the exchange. The response means the cancel was sent, not that it won: a fill may already have happened, and the trade feed settles which. |
| Reads our copy, which lags the exchange by the trade feed's delay. Pending rows older than the stuck-order threshold are shown as pending, not as failed, until the job has asked the exchange. |
The high-level design
Step 1 of 4
Two paths: orders out, prices in
Start with the two jobs. An order service takes POST /orders, writes the order to the orders database as pending under the phone's idempotency key, then calls the exchange's place API and records what it answered. Price servers hold a server-sent events stream per connected phone and, in this first cut, read the exchange price feed directly and write each tick to the phones watching that stock. The two paths share nothing but the exchange, so a flood of price updates at the open does not slow order placement, and the order side can be sharded by user later without touching prices.
What breaks first
The deep dives
Live price updates. A popular stock moves and a crowd of users has it on screen. Walk a single tick from the exchange feed to each of their phones, say which box fails first when that crowd grows tenfold, and what those users see when the server holding their stream fails.
Orders that agree with the exchange. A user taps buy, the exchange call times out with no answer, and the user taps buy again. Walk both taps through the order service, say what is stored at each step, which side is the record of an order's status, and how the app still learns that status when the exchange's reply is lost.
Concepts this guide uses
Sources
- GlobeNewswire via The Manila Times: Robinhood Markets, Inc. reports August 2026 operating data
- MDN: Using server-sent events
- Stripe API reference: Idempotent requests
- Redis documentation: Pub/sub
- OnixS FIX 5.0 dictionary: OrderStatusRequest (MsgType H)
- Robinhood newsroom: How we scaled Robinhood's brokerage system for greater reliability
- TechCrunch: Robinhood offers $15 discount, blames outage on record trades
- Robinhood support: Using market data