Stock Exchange: The Opening Bell
Hard · system design problem
At the opening bell order flow doubles for a minute and four times the retail users stream quotes. Orders must be acknowledged within 45 ms at p99, and nothing can boot in time.
Algorithmic traders send 20,000 orders/s to order-gateway, which calls risk-engine synchronously before acknowledging; risk-engine writes accepted orders to DynamoDB. Retail users stream quotes over WebSockets (each gateway instance holds 200,000 connections) from quote-svc and a Redis quote cache. At T+12s the bell rings: orders ×2 and retail users ×4 for one minute. Service instances take 30 s to boot. An order is acknowledged once it is durably accepted for risk checking; risk may run a few seconds behind, never more than a minute.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.