Markdown Editor

Stock Exchange Order Matching System Design Template

Exchange core: order book with price-time priority, matching walk-through, sequencer and replicated journal, deterministic engines, risk checks, market data, FIX references

System DesignFullFIX Latest, FIX session layers and SBE (reference only); docs/48 design standarddesignstockexchangeordermatching

How to use: Use it when designing or interviewing on an exchange or matching venue. Fill the market model (order types, priority, replace rules) and the peak message rate first, then write down the determinism rules. The main pitfall is letting the engine read clocks, random numbers or account state, which breaks replay and failover.

Preview

System Design: [Exchange or matching venue name]

Reference design for the core of an electronic exchange: order entry gateways, pre-trade risk checks, a sequencer that puts every input in one total order, single-threaded deterministic matching engines that keep a limit order book per instrument with price-time priority, and a market data feed. It names the FIX Trading Community specifications that such venues commonly expose (FIX Latest application messages, the FIX session layers and Simple Binary Encoding) as references only, sizes the system with worked numbers, and covers replication, recovery by replay and the failure behaviour of each component. It follows the structure of the System Design Document template, adds a 45-minute interview path, access-pattern and failure-mode tables and a cited "How real systems do it" box, and is pre-filled with a worked design to adapt. Replace every [bracketed] value and every row marked Example; values marked Example are assumptions, not benchmarks. Market rules and regulation differ by jurisdiction; this is a design format, not legal or regulatory advice, so check the current official texts and qualified counsel.

Document control

FieldValue
Document ID[SDD-MATCH-001]
System / feature[Continuous trading and order matching]
Version[0.1]
Status[Draft / In review / Approved / Implemented / Superseded]
Owner[@owner]
Author(s)[@author]
Reviewers[@reviewer-1], [@reviewer-2]
Last updatedYYYY-MM-DD
Classification[Confidential]
DifficultyAdvanced
Market model version[MM-2026-01]
Protocols exposed[FIX Latest over FIX session layer; binary order entry with SBE]
Related[Rulebook], [Clearing interface spec], [ADR: sequencer replication]

Approvals

RoleNameDecisionDate
Head of trading technology[@name][Approved / Changes requested]YYYY-MM-DD
Market operations[@name][Decision]YYYY-MM-DD
Risk management[@name][Decision]YYYY-MM-DD
Compliance[@name][Decision]YYYY-MM-DD
SRE / operations[@name][Decision]YYYY-MM-DD
Security[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft for design review
0.2YYYY-MM-DD[@name]Example: Moved risk checks before the sequencer to keep the engine free of account state
0.3YYYY-MM-DD[@name]Example: Added snapshots every 5 minutes to cap replay time at 60 s
1.0YYYY-MM-DD[@name]Example: Approved

Contents

1. Overview

1.1 Problem statement

[Example: The venue's current matching platform runs on a shared relational database with row locks per order book. At the market open, order acknowledgements reach 40 ms at p99, two members reported executions in a different order from their submissions, and recovering from a node failure took 25 minutes of manual reconciliation. The venue plans to list 10 000 instruments and must handle a peak of 1 million order messages per second.]

1.2 Proposed solution

[Example: Members connect to order entry gateways that authenticate, decode and run pre-trade risk checks. Accepted messages go to a sequencer that stamps each with a 64-bit sequence number and a timestamp, writes it to a replicated journal and only then releases it to the matching engines. Each engine owns a partition of instruments, runs on one thread, keeps the order books in memory and is fully deterministic, so a primary and a hot standby that read the same sequence produce the same executions. Engine output feeds execution reports to members, a multicast market data feed and the clearing interface. Recovery is snapshot plus replay of the journal.]

1.3 Decisions requested from reviewers

IDQuestionRecommended optionSection
Q-01Example: Where are pre-trade risk checks?In the gateway tier, before the sequencer7.4
Q-02Example: How is the journal made durable?Quorum of 3 sequencer nodes in the primary site, asynchronous copy to the DR site7.3
Q-03Example: How do engines fail over?Hot standby engines replaying the same sequence; output compared by hash7.3
Q-04Example: What does a replace do to priority?Keeps priority only for a quantity decrease at the same price7.1
[Q-nn][Question][Option][Section]

1.4 45-minute interview path

Use this order when the document serves an interview or a short design review. The written sections below are the long form of each step.

MinutesCoverOutput on the whiteboard
0 to 5Scope: limit and market orders, cancel and replace, executions, market data; below-the-line items (2.3)Order types and the priority rule
5 to 10Estimates: peak messages per second, hot instrument rate, book size, journal size (section 3)"Book fits in memory, one thread per partition" consequence
10 to 15Interface: new order, cancel, execution report, market data message (section 4)Four messages
15 to 25High-level design: gateway, risk, sequencer, engine, market data (section 6)One diagram
25 to 40One deep dive: the order book and matching (default, 7.1 and 7.2), or determinism and recovery (7.3), or market data (7.5)Options, choice, reason
40 to 45Failures (engine crash, sequencer failover, feed gap), the 10x row in section 10Two failure rows

Start the default deep dive by drawing a small book: two sides, price levels sorted best first, a first-in first-out queue of orders at each level. Walk one aggressive order through it (7.2) and then ask what would happen if two threads matched the same book at once. That leads to the single-writer engine and the sequencer.

2. Requirements

2.1 Core functional requirements

IDRequirementPriority
FR-01Example: Accept limit and market orders, buy or sell, with time in force Day, IOC (immediate or cancel) and FOK (fill or kill)Must
FR-02Example: Cancel and replace resting ordersMust
FR-03Example: Match continuously by price-time priority; trade at the resting order's priceMust
FR-04Example: Send an execution report for every accept, reject, fill, partial fill and cancelMust
FR-05Example: Publish order-by-order market data and periodic book snapshotsMust
FR-06Example: Pre-trade risk: credit limit per member, maximum order size, price collar around a reference priceMust
FR-07Example: Halt and resume trading per instrument; mass cancel per member on request or on disconnectMust
FR-08Example: Self-trade prevention by member-supplied group IDShould
FR-09Example: Post-only orders that are rejected if they would trade on arrivalShould
[FR-nn][Requirement][Must / Should / Could]

2.2 Non-functional requirements

IDQualityTargetMeasured as
NFR-01LatencyExample: order in to acknowledgement out, p50 20 µs, p99 100 µs at the gateway network portsHardware timestamps on capture taps
NFR-02ThroughputExample: 1 million order messages/s sustained for 60 sReplay of a recorded open at 2x speed
NFR-03FairnessExample: Matching order equals sequencer order for 100% of messagesReplay comparison
NFR-04DeterminismExample: Primary and standby output hashes equal at every checkpointContinuous hash comparison
NFR-05DurabilityExample: No acknowledged order or execution lost on any single node failureChaos test
NFR-06RecoveryExample: Engine failover under 1 s; cold restart under 5 minQuarterly failover drill
NFR-07Time accuracyExample: Event timestamps traceable to UTC within the tolerance set by the applicable rulesClock monitoring
[NFR-nn][Quality][Target][Measurement]

2.3 Below the line (out of scope)

Name these explicitly so reviewers and interviewers do not pull the design toward them.

  • [Example: opening and closing call auctions (a later release; same engine, different matching phase)]
  • [Example: clearing, settlement and margin (the clearing house receives a trade feed)]
  • [Example: options, multi-leg and implied orders]
  • [Example: member onboarding, billing and surveillance analytics (consume the journal offline)]
  • [Item deferred, with the release that will take it]

3. Capacity estimation

3.1 Assumptions

InputSymbolValueSource
InstrumentsIIExample: 10 000Listing plan
Trading day (continuous session)TTExample: 6.5 h = 23 400 sRulebook
Average order messages per secondmmExample: 50 000Comparable venues, member forecasts
Peak order messages per secondmpm_{p}Example: 1 000 000 (20x average)Recorded opens
Share of peak in the busiest instrumenthhExample: 5%Concentration analysis
Trades per dayttExample: 25 millionForecast
Inbound message size, binarybinb_{in}Example: 64 BSBE schema draft
Market data message sizebmdb_{md}Example: 40 BFeed schema draft
Resting orders at peakOOExample: 5 millionMember forecasts
Memory per resting order incl. indexesooExample: 128 BPrototype measurement
Messages one engine core handles with journalingccExample: 500 000/sPrototype benchmark
Replay speed from journalvvExample: 5 million messages/sPrototype benchmark

3.2 Message rates

Mday=m×T=50 000×23 400=1.17×109 messages/dayM_{day} = m \times T = 50\,000 \times 23\,400 = 1.17 \times 10^{9} \ \text{messages/day}

Trades: 25×106/23 400≈1 06825 \times 10^{6} / 23\,400 \approx 1\,068 per second on average, about 2% of messages. Most traffic is new orders and cancels that never trade, so the engine is optimised for insert and cancel, not only for matching.

Busiest instrument at peak: h×mp=0.05×106=50 000h \times m_{p} = 0.05 \times 10^{6} = 50\,000 messages/s, so one thread has 106/50 000=20 μs10^{6} / 50\,000 = 20 \ \mu s per message for that instrument. One core per instrument partition is enough as long as matching takes a few microseconds; no instrument needs to be split across threads.

3.3 Engines

E=mpc×0.5=106500 000×0.5=4 engines minimumE = \frac{m_{p}}{c \times 0.5} = \frac{10^{6}}{500\,000 \times 0.5} = 4 \ \text{engines minimum}

The 0.5 factor keeps engines at or below 50% busy at peak so queues stay short. The design uses 8 partitions so the hottest instruments can be spread and a partition can move without overloading another.

3.4 Memory, journal and market data

Order books: O×o=5×106×128 B=0.64 GBO \times o = 5 \times 10^{6} \times 128 \ \text{B} = 0.64 \ \text{GB} across all partitions, so every book lives in memory with room to spare.

Journal: 1.17×109×64 B≈74.9 GB/day1.17 \times 10^{9} \times 64 \ \text{B} \approx 74.9 \ \text{GB/day}, about 225 GB/day with three copies, and about 18.9 TB per year of 252 trading days for one copy. Retention follows the venue's record-keeping rules.

Market data: 1.17×109×40 B≈46.8 GB/day1.17 \times 10^{9} \times 40 \ \text{B} \approx 46.8 \ \text{GB/day}. At peak, 106×40 B=40 MB/s=320 Mbit/s10^{6} \times 40 \ \text{B} = 40 \ \text{MB/s} = 320 \ \text{Mbit/s} per feed, 640 Mbit/s for the A and B copies. Multicast makes this independent of the number of subscribers.

3.5 Recovery time

A full-day replay takes 1.17×109/(5×106)=2341.17 \times 10^{9} / (5 \times 10^{6}) = 234 s. With a snapshot every 5 minutes, the worst case is 5 minutes of peak traffic, 300×106/(5×106)=60300 \times 10^{6} / (5 \times 10^{6}) = 60 s of replay, which meets the cold restart target. Hot standbys do not replay at all; they are already current.

A 64-bit sequence number at 10610^{6} messages per second lasts about 585 000 years unsigned (about 292 000 years as a signed 64-bit integer), so it never wraps.

3.6 Summary

QuantityEstimateDesign consequence
Peak messages1 million/sBinary protocol, kernel-bypass networking, no database on the hot path
Busiest instrument50 000 messages/sOne thread per partition is enough; never split one book
Engines4 minimum, 8 partitions chosenPartition by instrument, with headroom for hot names
Book memory~0.64 GBAll books in memory, snapshots to disk
Journal~75 GB/day per copySequential append on local NVMe, replicated
Market data320 Mbit/s peak per feedMulticast A/B feeds plus retransmission service
Replay60 s worst case with 5-minute snapshotsCold restart inside 5 minutes

4. API design

4.1 Interfaces

InterfaceProtocolPurpose
Order entry (FIX)FIX Latest application messages over the FIX session layer, TLS (FIXS) where requiredMembers with standard FIX engines
Order entry (binary)SBE-encoded messages over a FIXP-style sessionLatency-sensitive members
Drop copyFIX execution reportsMember risk and back-office systems
Market dataMulticast UDP, A and B feeds, plus TCP retransmission and snapshot channelsPublic order-by-order data
Clearing feedTrade messages in sequenceClearing house
AdminAuthenticated internal APIHalts, instrument setup, member limits

FIX message types named for orientation (check the FIX Latest definitions before implementing):

PurposeFIX messageMsgType (tag 35)
New orderNewOrderSingleD
CancelOrderCancelRequestF
Cancel and replaceOrderCancelReplaceRequestG
Acknowledgement, fill, reject, cancel confirmExecutionReport8

4.2 Internal message after the gateway

Gateways convert both protocols to one internal fixed-size message. Prices are integers in ticks; floating point is never used for prices or quantities.

{"seq": 418220931, "ts_ns": 1793433600123456789, "type": "new", "member": "MBR-0042", "client_order_id": "c-77120", "instrument": 1207, "side": "buy", "ord_type": "limit", "tif": "day", "price_ticks": 1003, "qty": 400, "stp_group": "G-3"}

4.3 Rejects and idempotency

CaseWhere rejectedResponse
Malformed or unauthenticated messageGatewaySession-level reject
Credit limit, size or price collar breachGateway risk checkExecutionReport with reject reason
Duplicate client_order_id in the sessionGatewayReject as duplicate; original state unchanged
Instrument haltedEngineExecutionReport reject; market data shows halt
Cancel of an unknown or filled orderEngineCancel reject

The member's client_order_id is unique per session and day, which makes resends after a reconnect safe.

5. Data model

5.1 Entities

The journal of sequenced inputs is the source of truth; books, executions and market data are all derived from it by the deterministic engine.

5.2 Storage choices

DataStoreKeyMain queriesWhy
Order booksEngine memoryInstrument, side, price level, FIFO queueBest price, walk levels, cancel by order IDMicrosecond access; single writer
Order lookupEngine memory hash maporder_idCancel and replace in O(1)Avoid scanning a level
JournalAppend-only files on local NVMe, replicated to 2 peersseqReplay from a sequence numberSequential writes, total order
SnapshotsFiles per partition, copied to object storagePartition, seqRestore books, then replayCaps replay time (3.5)
Executions and orders for membersDownstream database fed from engine outputmember_id, dateDrop copy, end-of-day reportsNever on the hot path

5.3 Access patterns

Access patternFrequencyKey or index that serves itPartition key rationale
Match an incoming orderUp to 1 million/s at peakBest opposite price level, then FIFO queuePartition by instrument: one book is touched by one thread only
Cancel or replaceMost of the trafficorder_id hash map to the order nodeSame instrument partition; O(1) unlink from the level
Publish book changeEvery book changeSequenced output eventOutput keeps engine order per partition
Replay after failureRareJournal from snapshot seqPartition journals can replay in parallel
Member asks for order statusOccasionalDownstream database by member_id and client_order_idKeeps queries off the engine

6. High-level design

ComponentResponsibilityScales by
Order entry gatewaysSessions, decode, throttle, duplicate checkMembers per gateway
Pre-trade riskCredit, size and price collar checks per memberWith gateways (member state is local to its gateway)
SequencerTotal order, timestamps, journal, replicationVertical; one leader with quorum replicas
Matching engineBooks, matching, deterministic outputInstrument partitions
Output sequencerMerge partition outputs with their sequence numbersVertical
Market data publisherEncode and multicast, snapshots, retransmissionFeed channels

7. Detailed design

The deep dives in this section, each with options, choice and reason:

Deep diveOptions consideredChoiceReasonSection
Order book structureSorted tree of levels, array indexed by tick, skip listArray of levels around the reference price with a tree fallback, FIFO list per level, order ID mapO(1) for best price, insert and cancel in the common range7.1
ConcurrencyLocks per book, actor per instrument, single thread per partitionSingle thread per partition fed by the sequencerNo locks, deterministic, cache friendly7.2, 7.3
Durability and failoverDatabase commit, local journal only, replicated journal with standbysQuorum-replicated journal, hot standby enginesNo acknowledged input lost; sub-second failover7.3
Risk checksIn the engine, in the gateway, separate serviceIn the gateway, before the sequencerKeeps the engine free of account state7.4
Market dataTCP per subscriber, multicast with recoveryMulticast A/B with sequence numbers, snapshots, retransmissionFair, scalable, recoverable7.5

7.1 Order book and market model

  • Priority: best price first; at the same price, earliest sequence number first (price-time priority).
  • Trade price: the price of the resting (passive) order.
  • Replace: a quantity decrease at the same price keeps priority; a price change or a quantity increase takes a new priority sequence.
  • Structure per instrument and side: price levels in an array indexed by price_ticks - base, sized to cover the price collar, with a sorted tree for the rare level outside it; each level holds a doubly linked FIFO list and its total quantity; a hash map from order_id to the list node gives O(1) cancel.
  • Best price is cached and updated on insert, fill and cancel.

7.2 Matching walk-through

Example: sell side of instrument 1207 before the order arrives (tick size 0.01, prices shown in currency units):

OrderSidePriceQuantityPriority seq
S-1Sell10.021001001
S-2Sell10.022001005
S-3Sell10.033001002

Incoming B-9: buy limit 400 at 10.03, Day.

StepResting orderFill quantityFill priceB-9 remaining
1S-1 (best price, earliest)10010.02300
2S-2 (same price, later)20010.02100
3S-3 (next level)10010.030

B-9 is fully filled: 400 shares, notional 4 009.00, average price 10.0225. S-3 rests with 200 at 10.03 and keeps its original priority. S-3 has an earlier sequence than S-2 but trades later, because price beats time. The engine emits three executions, each with a fill report to both sides, and order-by-order market data for each change.

7.3 Determinism, sequencing and recovery

The engine is a state machine: next state and output depend only on the current state and the next sequenced input. To keep that true:

RuleWhy
No wall-clock reads; use the sequencer timestamp in the messageReplicas would otherwise see different times
No randomness; any tie-break uses sequence numbersSame input, same output
No floating point for prices or quantitiesRounding can differ between builds and hardware
No iteration over hash maps where order affects outputIteration order can differ between runs
No I/O inside matching; output goes to a ring bufferKeeps timing out of the logic
Engine version and configuration are part of the snapshotReplay with the wrong build gives wrong results

Sequencer: one leader and two followers in the primary site. The leader assigns the sequence number, appends to its journal and forwards to the followers; a message is released to the engines once a majority (2 of 3) has it on disk. A copy streams asynchronously to the DR site; the DR recovery point is the replication lag, stated in the business continuity plan. Leader election uses a consensus protocol (see system-design/design-distributed-lock-coordination).

Engines: each partition has a primary and a hot standby reading the same sequence. Both hash their output every 10 000 messages; a mismatch halts the partition for investigation rather than risking a wrong trade. Failover promotes the standby, which is already current; members see a short pause, not lost orders.

Cold restart: load the latest snapshot of the partition, replay the journal from its sequence number (3.5), compare the output hash with the recorded one and resume.

7.4 Pre-trade risk and market controls

ControlWhereExample setting
Credit limit per memberGateway, member state local to the gatewayOpen buy notional at or below the limit set by the clearing member
Maximum order sizeGateway100 000 shares or 5 million notional
Price collarGateway, reference price pushed from the engineReject limit prices more than 10% from the last trade
Message throttleGateway2 000 messages/s per session
Instrument halt and volatility interruptionEngine, triggered by price moves or operationsHalt when the price moves 10% within 5 minutes
Mass cancel on disconnectGateway sends a sequenced mass cancelOptional per session
Kill switch per memberOperations console, sequencedCancels all orders and blocks new ones

Each member is pinned to one gateway pair, so credit state has a single writer. Fills flow back to the gateway and release or consume credit.

7.5 Market data

  • Every output event carries the partition sequence number; the feed carries a channel sequence number so subscribers detect gaps.
  • Two identical multicast feeds (A and B) travel on separate networks; subscribers take the first copy of each sequence number.
  • A subscriber that detects a gap requests the missing range from the TCP retransmission service, or, after a long outage, joins the snapshot channel and then applies incremental messages after the snapshot's sequence number.
  • Public data never contains member identities.

7.6 How real systems do it

How real systems do it (paraphrased, not copied). Martin Fowler's article "The LMAX Architecture" (12 July 2011) describes the retail trading platform built by LMAX. All business logic runs on a single Java thread with every object in memory and no database; the article reports around 6 million orders per second from that one thread on one commodity server. Input events pass through a ring buffer (the Disruptor) where separate consumers unmarshal, write the journal and replicate the events before the business logic sees them, and output goes through further ring buffers. Because state is rebuilt by replaying the durable input events (event sourcing) from a nightly snapshot, a full restart took under a minute, and replicas fed the same input in the same order can take over quickly. The same three ideas drive 7.3: a single writer per partition, a journal of inputs before processing, and determinism so replicas agree. Read the original in 12.3; this box keeps only the general idea.

8. Scalability and performance

ConcernApproachLimit before redesign
Message ratePartitions by instrument, one core eachExample: about 250 000 messages/s per partition at 50% busy
Hot instrumentMove it to its own partitionOne instrument's rate above one core's capacity
SequencerBatching of journal writes and replicationExample: a few million messages/s on one leader; then sequence per partition group
GatewaysMembers spread across gateway pairsNetwork ports per server
Market dataChannels per instrument groupSubscriber line capacity, not the venue

Latency budget, order in to acknowledgement out (target p99 100 µs):

StepBudget
Network in and gateway decode10 µs
Pre-trade risk check10 µs
Sequencer, journal append, quorum replication30 µs
Matching5 µs
Output, execution report encode, network out25 µs
Headroom (jitter, bursts)20 µs

Keep the hot path free of memory allocation, system calls and locks; pin threads to cores; use kernel-bypass networking. Measure with hardware timestamps at the network edge, not with application clocks.

9. Reliability, security and operations

9.1 Failure modes

ComponentFailureDetectionBlast radiusMitigationRTO
Matching engine primaryCrashHeartbeat from the sequencerInstruments of one partition pausePromote hot standbyExample: under 1 s
Engine replicasOutput hash mismatchHash comparison every 10 000 messagesOne partitionHalt partition, investigate, restart from snapshot and replayExample: 15 min
Sequencer leaderCrashConsensus heartbeatWhole venue pausesElect follower; unacknowledged inputs are resent by gatewaysExample: under 2 s
GatewayCrashSession dropMembers on that gatewayMembers reconnect to the pair; optional mass cancel; credit state restored from the sequenced fill streamExample: 30 s
Market data feed APacket lossGap detectionSubscribers on feed AFeed B arbitration; retransmission serviceExample: none visible
Primary siteLossSite monitoringWhole venueControlled failover to DR after operations decision; recovery point equals replication lagExample: 2 h
Clock sourceDrift beyond toleranceClock monitoringTimestamp accuracyAlarm, switch source, record the incident for regulatorsExample: 5 min
[Component][Failure][Signal][Scope][Mitigation][Time]

9.2 Security and integrity

ThreatControl
Unauthorised order entryPer-session credentials, IP allow lists, TLS where offered, certificate-based admin access
Insider changing the book or sequenceNo write path except sequenced inputs; journal hash chain; four-eyes for admin commands
Information leakage between membersExecution reports only to the owning session; public data anonymous
Unfair access to market dataSame multicast for all; member-specific latency tiers disclosed in the rulebook
Runaway algorithmThrottles, kill switch, price collars (7.4)
[Threat][Control]

9.3 Observability and regulatory records

SignalMetric or logAlert threshold
Latencyp99 order to acknowledgement from network tapsAbove 100 µs for 1 min
Engine busyShare of time processing per partitionAbove 50%
ReplicationFollower lag in messagesAbove 1 000
Market dataGaps detected by an internal subscriberAny
ClockOffset from the reference sourceAbove the venue's tolerance

Trading venues are usually subject to rules on clock synchronisation, record keeping and market controls. In the EU, for example, Commission Delegated Regulation (EU) 2017/574 sets clock-synchronisation requirements under MiFID II; the UK and US have their own regimes. Confirm the rules that apply to the venue and their current text with compliance before setting NFR-07 and retention. This template does not state the legal requirements.

9.4 Cost estimate

ItemUnit costQuantityMonthly cost
Matching servers (primary and standby)[$/server-month]Example: 16[$]
Sequencer nodes[$/server-month]Example: 3 primary site, 1 DR[$]
Gateways[$/server-month][Pairs][$]
Low-latency network and clock sources[$/month][Units][$]
Journal storage[$/TB-month]Example: 18.9 TB per year per copy[$]
Total[$]

10. Trade-offs and alternatives

DecisionOptionsChosenWhyWhat we give up
ConcurrencyLocks per book; single thread per partitionSingle thread per partitionDeterministic, no lock contentionOne hot instrument cannot use two cores
DurabilityDatabase commit; replicated journalQuorum-replicated journal before matchingMicroseconds instead of millisecondsCustom replication code to maintain
FailoverCold restart; hot standbyHot standby plus snapshotsSub-second failoverDouble the engine hardware
Risk placementIn engine; in gatewayIn gatewayEngine stays small and fastCredit state per gateway; members pinned
Market dataTCP fan-out; multicastMulticast A/B with recoverySame data at the same time for allSubscribers must handle gaps
What changes at 10x / 0.1x10x (10 million messages/s): about 40 engines by the 3.3 formula, a sequencer per partition group with cross-group ordering only where a rule needs it (for example a mass cancel), and FPGA or kernel-bypass gateways. 0.1x (100 000 messages/s): one engine partition with a standby and a single sequencer node with a synchronous follower is enoughReview at each doubling of peak messagesThe single sequencer, not the engines, limits first[Note]
[Decision][Options][Chosen][Why][Cost]

11. Delivery plan and risks

11.1 Milestones

MilestoneScopeExit criterionTarget date
M1Engine and book with replay harnessRecorded day replays with identical output twiceYYYY-MM-DD
M2Sequencer with quorum journal, hot standbyFailover drill under 1 s with no lost acknowledged inputYYYY-MM-DD
M3Gateways, risk checks, market data, member test environmentMember certification tests passYYYY-MM-DD
M4Parallel run against the current platformExecutions identical for 20 trading daysYYYY-MM-DD
M5Go-live by instrument groupNo severity 1 incident for 30 daysYYYY-MM-DD

11.2 Rollout and rollback

[Example: Instruments move to the new platform in groups over a weekend with no open orders carried across (Day orders only during migration). Rollback moves the group back before the next session; the old platform stays warm until M5 plus 60 days.]

11.3 Risks

IDRiskLikelihoodImpactMitigationOwner
R-01Example: Hidden non-determinism found in productionMediumHighContinuous hash comparison, replay of every day in test[@name]
R-02Example: Members fail certification in timeMediumHighEarly test environment, protocol simulators[@name]
R-03Example: Regulatory requirement missedLowHighCompliance review of NFR-07 and record keeping before M3[@name]
[R-nn][Risk][L / M / H][L / M / H][Mitigation][@name]

12. Appendices

12.1 Open questions

IDQuestionOwnerDue
OQ-01Example: Do we offer iceberg (reserve) orders in release 1?[@name]YYYY-MM-DD
OQ-02Example: Which clock tolerance and retention apply in each jurisdiction we serve?[@name]YYYY-MM-DD
[OQ-nn][Question][@name]YYYY-MM-DD

12.2 Glossary

TermMeaning
Order bookAll resting buy and sell orders for one instrument, grouped by price level
Price-time priorityBetter price first; at equal price, earlier arrival first
Aggressive orderAn order that trades on arrival against resting orders
SequencerComponent that gives every input one position in a total order
Hot standbyA replica that processes the same inputs and can take over at once
IOC / FOKImmediate or cancel: fill what you can now, cancel the rest. Fill or kill: fill all now or nothing
TickMinimum price increment
[Term][Meaning]

12.3 References

ReferenceUse
FIX Trading Community, "FIX Protocol" (FIX Latest with extension packs)Application messages in 4.1; check definitions in the FIX tools
FIX Trading Community, "Technical Standards" (session layer, FIXP, FIXS, SBE, SOFH)Protocols in 4.1
FIX Trading Community, "Simple Binary Encoding" (version 1.0 final; version 2.0 at release candidate stage as of October 2026); also published as ISO/IEC 25390:2025, ISO catalogueBinary encoding of order entry
Fowler, "The LMAX Architecture", 12 July 20117.6
Commission Delegated Regulation (EU) 2017/574 (clock synchronisation under MiFID II), EUR-LexExample of a regulatory requirement in 9.3
Payment Ledger System Design (system-design/design-payment-ledger)Downstream money movement
Message Queue System Design (system-design/design-message-queue)Log replication concepts
Distributed Lock and Coordination System Design (system-design/design-distributed-lock-coordination)Leader election for the sequencer
Unique ID Generator System Design (system-design/design-unique-id-generator)Order and execution IDs
Back-of-Envelope Estimation and Capacity Model (system-design/back-of-envelope-estimation)Method for section 3

Standard and licence note

Based on common industry practice for electronic matching venues. FIX specifications are published by the FIX Trading Community; they are named here for reference only, message type codes are quoted for orientation and no specification text was copied. Official text: FIX Trading Community, access under its terms at https://www.fixtrading.org/standards/. ISO/IEC 25390:2025 (SBE) is a paid standard and is named only; official text: ISO, purchase or licensed access at https://www.iso.org/standard/90107.html. The LMAX article is paraphrased in 7.6 only. Regulatory items are examples, dated October 2026; this is not legal or regulatory advice, so check the current official text and a qualified professional. All capacity numbers are illustrative examples. Original text written for this collection. Template licence: MIT.

Related templates