Engineering · 8 min read
Streaming live forex prices to thousands of traders with Redis
Quotes change many times a second across dozens of instruments. We walk through the architecture we use to fan prices out to web and mobile clients without melting the backend.
Rohan Desai · 3 February 2026
The shape of the problem
A trader portal typically shows bid and ask prices for 30 to 100 symbols, and during active sessions major pairs can tick many times per second. Multiply that by thousands of connected clients and naive approaches, such as having each client poll an API or having every WebSocket server subscribe directly to the price feed, fall over quickly.
The goal is to ingest the feed once, normalise it, and fan it out efficiently, while also keeping a snapshot of the latest price so new connections and server-side components like margin checks can read it instantly.
Ingest once, publish once
We run a small ingest service that holds the single connection to the liquidity provider or trading server bridge. It parses each tick, applies the configured markup for each group, and writes to Redis in two ways: it stores the latest quote in a hash keyed by symbol, and it publishes the tick to a channel for that symbol.
Keeping the ingest service separate means the upstream connection is isolated from client load. If WebSocket servers restart or scale, the feed is unaffected.
- HSET quote:EURUSD bid 1.08412 ask 1.08419 ts 1767000000123 for the snapshot
- PUBLISH ticks:EURUSD with a compact payload for live subscribers
- Separate channels per markup group if different client tiers see different spreads
Fan-out through WebSocket gateways
Stateless WebSocket gateway nodes subscribe to Redis channels only for symbols that at least one of their connected clients is watching. When a client connects, the gateway reads the current snapshot from the hash and sends it immediately, then streams subsequent ticks. This avoids the blank-screen moment while waiting for the next tick.
Because each gateway subscribes once per symbol regardless of how many clients want it, Redis sees a small, stable number of subscriptions, and the per-client work happens in the gateway's memory.
Throttling and conflation
Humans cannot read 20 updates a second, and mobile networks do not appreciate them. We conflate ticks in the gateway: for each client and symbol, we keep only the most recent price and flush on a short interval, typically 100 to 250 milliseconds. Clients always see the latest price but bandwidth drops dramatically.
Server-side consumers that need every tick, such as stop-out monitoring, subscribe directly and are not conflated. Separating these two paths lets you tune user experience and risk controls independently.
Operational notes
Redis Pub/Sub is fire-and-forget: a subscriber that disconnects misses messages. That is acceptable for display prices because the snapshot hash fills the gap on reconnect. For anything that must not be lost, such as order events, use Redis Streams or Kafka with consumer groups instead.
Monitor end-to-end latency by stamping each tick at ingest and measuring at the gateway, and alert if the snapshot timestamp for a liquid symbol goes stale during market hours. A stale price is often the first sign of an upstream disconnect.