UDP vs TCP Market Data Feeds: Performance, Reliability and Trade-Offs
UDP vs TCP Market Data Feeds: Performance, Reliability and Trade-Offs

Short answer. Neither transport is universally better. UDP can reduce transport-induced latency and avoids TCP retransmission stalls, but pushes gap detection and recovery into your application. TCP provides reliable, ordered delivery without extra code, but a single lost segment can stall everything behind it. The right choice depends on how your system handles a missing message, and how it behaves when the market is at its busiest.
Most conversations about UDP vs TCP market data start with speed and end too early. UDP can be faster, so use UDP. That is a reasonable first instinct and a poor architecture decision. The transport you pick decides who is responsible for ordering, who notices a gap, and what your application sees at the exact moment message rates peak.
This guide compares the two for real-time trading data, covers where each one fails, and ends with a decision matrix you can use against your own requirements.
Why Transport Protocols Matter in Market Data Delivery
A market data feed is a high-rate stream of small, time-sensitive messages. Quotes, trades and book updates arrive in bursts, and each one is only useful if the consumer can place it correctly in sequence. The transport layer shapes four things that matter directly to that job:
- Latency and its variation. The average delay matters less than how far individual messages stray from it. Our piece on why average latency hides the real problem makes the wider argument. For a related look at how infrastructure choices affect delivery delay, see The Cloud Is Getting Faster. Does That Make It Ready for Latency-Sensitive Market Data?
- Message ordering. Whether messages reach your application in the order they were sent.
- Throughput under load. How much the transport can carry before queues build.
- Recovery. What happens after a loss, and who pays the cost of repairing it.
These four properties pull against each other. Improving one usually means accepting a worse position on another, which is why the choice is a trade-off and not a ranking.
How UDP Market Data Streaming Works
UDP sends independent datagrams with no connection state, no acknowledgements and no retransmission. The sender transmits, and the network either delivers the packet or it does not. There is no handshake to complete and no window to manage, so the protocol adds very little overhead and no built-in delay when something goes wrong.
That simplicity is why UDP is a common choice for exchange-style real-time channels. It also explains the cost. UDP does not guarantee delivery, does not guarantee order, and does not tell you when something is missing. Datagrams can be dropped by a congested switch, a full NIC ring, or an overflowing socket buffer on your own host, and nothing in the protocol will report it.
In practice, a UDP feed relies on the application layer to do the work the transport does not:
- Sequence numbers on every message or packet, so the consumer can detect gaps and out-of-order arrival.
- Gap detection logic that decides how long to wait before declaring a message lost.
- A recovery path, such as a retransmission request, a snapshot, or a separate TCP channel that supplies the missing data.
- Arbitration, in setups where the same feed arrives over two redundant paths and the consumer takes whichever copy arrives first.
None of this is difficult in isolation. The engineering effort is in getting it right under pressure, when gaps are most likely and the recovery path is competing for the same resources as the live stream.
How TCP Market Data Streaming Works
TCP provides a reliable, ordered byte stream. It establishes a connection, numbers every byte, acknowledges receipt, and retransmits anything that goes missing. Flow control and congestion control keep the sender from overwhelming the receiver or the network. While the connection stays up, the data the application reads is complete and in order, with no sequencing code required for basic correctness. If the connection fails, the application still needs a way to resume from a known point.
The trade-off is head-of-line blocking. TCP delivers bytes in order, so if one segment is lost, everything behind it waits in the receive buffer until the missing segment is retransmitted and acknowledged. During that wait your application sees nothing, even though later data may already have reached your machine. When the delay ends, a backlog of stale messages arrives all at once.
Two other behaviours are worth knowing. TCP is a byte stream with no message boundaries, so your decoder must frame messages itself. And congestion control can reduce the sending rate after loss, which is sensible for the network and unhelpful for a consumer that needs the next quote now.
For many consumers these costs are acceptable. A system that needs a complete, ordered record and can tolerate occasional pauses often prefers TCP precisely because it removes an entire class of recovery logic.
UDP vs TCP: Technical Performance Comparison
| Property | UDP | TCP |
|---|---|---|
| Delivery guarantee | None. Loss is silent. | Reliable, ordered byte-stream delivery with retransmission while the connection remains operational. Application-level recovery may still be required after connection failure. |
| Ordering | Not guaranteed. Application must sequence. | Strictly ordered byte stream. |
| Latency variation | Often lower and steadier when the network is healthy, since there is no retransmission delay. Actual results depend on network and host. | Steady until loss occurs, then retransmission and head-of-line blocking can add delay spikes. |
| Bandwidth overhead | Small fixed header, no acknowledgement traffic. | Larger headers plus acknowledgement traffic and retransmitted data. |
| Recovery | Application-defined: retransmit request, snapshot, or secondary channel. | Built into the protocol. |
| Message framing | Datagram boundaries are preserved. | No boundaries. Decoder must frame messages. |
| Implementation complexity | Higher. You own gap handling and recovery. | Lower for correctness, higher for tuning under loss. |
| Typical failure mode | Missing messages that go unnoticed without sequence checks. | Stalls followed by bursts of delayed data. |
The pattern across the table is consistent. UDP moves risk from the network into your code. TCP moves risk from your code into the network. Neither removes it.
What Happens During High-Volume Trading Events?
Transport choice only gets properly tested at market open and during macroeconomic releases, when message rates can climb sharply with no warning. The two protocols fail differently in that window.
UDP under burst load. The most common failure is local. A burst arrives faster than the application drains the socket buffer, the buffer overflows, and the kernel discards datagrams. The network was fine and the feed was fine, but you still have a gap. Larger buffers, dedicated CPU cores and efficient decoding reduce the risk, but the loss path is always present. Recovery requests also add load at the worst possible time, since every consumer that detected a gap asks for repairs at once.
TCP under burst load. TCP will not drop messages from the stream, but it will queue them. If the receiver falls behind, the receive window shrinks and the sender slows down. If a packet is lost during the burst, head-of-line blocking holds back the data behind it. The result is not missing data but late data, which in a fast market can be just as damaging as missing data for a latency-sensitive strategy.
This is the point where average figures stop being informative. A feed can look excellent over a full session and still produce a damaging tail during the first minutes of the day. Measuring the percentile curve under replayed burst traffic is the only reliable way to see which failure mode your stack is exposed to. Our guide on how to audit a market data feed before production walks through how to set that testing up.
Choosing the Right Transport for Your Infrastructure
Start with the question that matters most: what does your system do when a message is missing, and what does it do when a message is late? The answers usually point to a transport faster than any benchmark will.
Use this matrix as a starting point. Score each requirement for your own system, then see where the weight falls.
| If your priority is… | Lean towards | Reason |
|---|---|---|
| Lowest and most consistent delivery delay | UDP | Avoids retransmission and head-of-line blocking in the live path, though results should be measured on your own network. |
| A complete, ordered record with minimal custom code | TCP | Gap-free delivery is handled by the protocol. |
| Tolerance for brief gaps, repaired out of band | UDP | Gaps can be recovered without stalling live data. |
| No tolerance for gaps, moderate tolerance for pauses | TCP | Late data is acceptable, missing data is not. |
| Small engineering team, limited recovery tooling | TCP | Less application logic to build, test and maintain. |
| Dedicated infrastructure team with tuned hosts | UDP | Team can own buffers, pinning, sequencing and recovery. |
| Delivery across a long or lossy network path | TCP | Loss is more likely, and built-in recovery earns its cost. |
| Co-located or low-loss network path | UDP | Loss is rare, so the protocol overhead buys little. |
Many production systems use both. A common design takes the live stream over UDP for speed and relies on TCP for recovery, snapshots or initial state. Others run TCP as the primary path and accept the occasional stall in return for simpler operations. Mixed designs are normal, and the right mix is usually the one your team can operate confidently at three in the morning.
Before you commit, test both against your own conditions. Network path, host tuning and message rate all change the result, so a comparison run on someone else’s infrastructure tells you very little about yours.
How NxCore Fits into a Binary Streaming Architecture
NxCore delivers market data as a raw binary stream over UDP and TCP, so you can choose the transport that matches your infrastructure and your tolerance for gaps or delay. It is not a WebSocket or REST service. The binary format keeps messages compact and fast to decode, which matters most when your feed handler is working through a burst.
Because the transport is your decision, the practical next step is to measure. Connect over the transport you expect to use, replay or observe a busy period, and look at gap counts, queue depth and tail latency, not just the average. That tells you whether your hosts, your network and your decoding path hold up before anything reaches production.
Try it in your own environment. Evaluate NxCore’s real-time UDP and TCP data delivery in your own infrastructure.
Frequently Asked Questions
Is UDP always faster than TCP for market data?
No. UDP can reduce transport-induced latency because it has no retransmission or head-of-line blocking, but the difference depends on your network and hosts and should be measured. UDP can also lose data silently, and the work of detecting and repairing gaps lands in your application. In a lossy environment, the end-to-end result can be worse than TCP.
Why do exchanges use UDP multicast for real-time feeds?
Multicast lets one sender reach many consumers with a single transmission, and UDP avoids per-connection overhead and retransmission delay. Exchanges commonly pair a live UDP channel with a separate recovery mechanism, which is the same split many consumers adopt internally.
What is head-of-line blocking in TCP market data?
TCP delivers bytes in order, so one lost segment holds back all later data until it is retransmitted. Your application sees a pause, then a burst of older messages, even though newer data had already arrived at the host.
How do I detect packet loss on a UDP feed?
Use sequence numbers. Track the expected next sequence, flag any jump or repeat, and decide how long to wait for out-of-order arrivals before declaring a gap. Also monitor socket buffer drops and NIC receive counters, since loss often happens on your own host.
Can I use both UDP and TCP together?
Yes, and many systems do. A typical pattern is a UDP live stream for speed with TCP used for snapshots and gap recovery. The design should be tested under burst conditions, since recovery traffic competes with the live feed at the worst time.

