Loading content...
Real-time systems are everywhere—from the smartphone in your pocket to the aircraft overhead, from the trading floor to the factory floor. Understanding how real-time principles apply across diverse domains builds the intuition necessary to design new real-time systems effectively.
This page examines real-world use cases across multiple industries, exploring their specific requirements, architectural patterns, and the engineering tradeoffs that make them work. Each domain offers unique lessons that transfer to other real-time applications.
Why study use cases?
Theoretical knowledge alone is insufficient for real-time system design. Each domain has discovered, often through painful experience, the specific patterns and anti-patterns that work for their constraints. Studying these use cases provides:
By the end of this page, you will understand how real-time principles apply in gaming, financial trading, industrial control, real-time communication, autonomous vehicles, and other domains. You'll recognize common patterns that appear across industries and understand the specific constraints that shape each domain's architecture.
Online gaming represents one of the most demanding soft real-time domains, combining strict latency requirements with massive scale and the need for fairness across geographically distributed players.
Latency requirements by game genre:
| Genre | Target Latency | Tolerance | Real-Time Type |
|---|---|---|---|
| Fighting games (1v1) | < 50ms round-trip | Very low | Firm RT |
| First-person shooters | < 50-80ms | Low | Firm RT |
| Battle royale | < 80-100ms | Moderate | Soft RT |
| MOBA (League, Dota) | < 80-100ms | Moderate | Soft RT |
| MMORPGs | < 150-200ms | Higher | Soft RT |
| Turn-based games | < 1-2 seconds | High | Soft RT |
Architectural patterns in gaming:
1. Authoritative Server Model: The server maintains the authoritative game state. Clients send inputs to the server, which validates, applies, and broadcasts results. This prevents cheating but adds network latency to every action.
2. Client-Side Prediction: Clients predict the outcome of their own actions immediately, then reconcile with the authoritative server response. This hides latency for local actions but requires correction when predictions are wrong ("rubberbanding").
3. Lag Compensation: Servers "rewind time" to evaluate actions in the context of what the player saw when they acted. If a player clicked on a target 80ms ago (their view at that time), the server validates the hit against the game state 80ms in the past.
4. Tick Rate and Update Frequency: Game servers typically run at fixed tick rates (e.g., 64Hz for CS2, 128Hz for competitive). Higher tick rates provide more temporal resolution but require more CPU and bandwidth.
5. Network Interpolation: Clients smooth movement between received state updates using interpolation, typically showing the world 50-100ms in the past to always have data to interpolate between.
In competitive gaming, latency differences between players create unfairness. Players with lower latency have real advantages. Solutions include matchmaking by latency, distributed server placement, and gameplay mechanics that are less latency-sensitive. Esports competitions require LAN to guarantee equal latency for all competitors.
High-frequency trading (HFT) and electronic market making represent the extreme end of firm real-time requirements, where microseconds translate directly to profit or loss.
The speed imperative:
In liquid markets, the first participant to react to new information captures the profit opportunity. Being 10 microseconds slower than a competitor means consistently losing money. This creates a relentless optimization pressure that pushes systems to fundamental physical and computational limits.
Latency breakdown in trading systems:
| Component | Typical Latency | Optimization Approach |
|---|---|---|
| Market data receipt | 1-5 μs | Kernel bypass networking, FPGA parsing |
| Strategy computation | 0.5-10 μs | Cache-optimized code, branch prediction |
| Order generation | 0.5-2 μs | Pre-formatted templates, minimal allocation |
| Network transmission | 1-3 μs | Kernel bypass, direct NIC access |
| Exchange matching | Variable | Co-location, shortest fiber routes |
| End-to-end tick-to-trade | 5-20 μs | All of the above optimized together |
Architectural patterns in trading:
1. Co-location: Trading firms pay exchanges for server space in the same data center as the exchange's matching engine, minimizing network latency. The "last mile" from co-lo cage to exchange is carefully measured.
2. Kernel Bypass: Standard network stacks add tens of microseconds of latency. Trading systems use technologies like DPDK (Data Plane Development Kit) or custom network drivers to send packets directly from userspace to the NIC, bypassing the kernel entirely.
3. FPGA Acceleration: Field-Programmable Gate Arrays process market data and generate orders in hardware, achieving sub-microsecond latencies that software cannot match. Common uses include packet parsing, risk checks, and simple strategy execution.
4. Lock-Free Data Structures: Mutex contention adds unpredictable latency. Trading systems use lock-free queues (LMAX Disruptor pattern), atomic operations, and single-writer architectures to eliminate lock contention.
5. Memory Pooling:
All memory is pre-allocated. No malloc() calls in the hot path. Object pools and ring buffers provide allocation-free data management with predictable timing.
While HFT gets attention for its extreme requirements, most trading systems operate at millisecond scales and use more conventional architectures. Understand your actual requirements before over-engineering. The cost difference between a 10μs system and a 10ms system is enormous.
Industrial control systems represent the classic domain of hard real-time computing, where missing deadlines can cause equipment damage, production loss, or worker injury.
Control loop fundamentals:
Industrial control systems continuously execute a control loop:
The cycle frequency depends on the dynamics of the process being controlled:
| Application | Control Loop Period | Consequence of Miss | Real-Time Type |
|---|---|---|---|
| Motion control (CNC, robot) | 0.5-2 ms | Position error, collision | Hard RT |
| High-speed packaging | 1-5 ms | Product damage, jam | Hard RT |
| Injection molding | 5-20 ms | Defective parts | Hard RT |
| Temperature control (furnace) | 100-500 ms | Temperature deviation | Firm RT |
| HVAC systems | 1-10 seconds | Comfort deviation | Soft RT |
| Water treatment | 10-60 seconds | Process deviation | Soft RT |
Industrial control architecture:
1. Programmable Logic Controllers (PLCs): PLCs are specialized hard real-time computers designed for industrial environments. They feature:
2. Distributed Control Systems (DCS): Large industrial processes use distributed architectures:
3. Real-Time Industrial Networks: Industrial Ethernet variants provide deterministic networking:
Critical industrial processes have separate Safety Instrumented Systems (SIS) that operate independently from control systems. SIS detect dangerous conditions and take the process to a safe state, even if the main control system fails. These systems require IEC 61511/61508 certification and are truly hard real-time.
Real-time communication (RTC) systems—video conferencing, VoIP, live streaming—face the challenge of delivering continuous media over best-effort networks while maintaining human-perceptible quality.
The fundamental constraint:
Unlike file downloads where you can wait for missing data, live media must be played at a fixed rate. If a video frame or audio sample doesn't arrive in time, you either display degraded content or nothing at all. The network and the human auditory/visual system create competing timing constraints.
Latency budgets for real-time communication:
| Application | Target Latency | Maximum Acceptable | ITU Reference |
|---|---|---|---|
| VoIP conversation | < 150ms one-way | < 400ms | ITU-T G.114 |
| Video conferencing | < 150ms glass-to-glass | < 400ms | Similar to VoIP |
| Live streaming (broadcast) | < 5 seconds | < 30 seconds | Industry practice |
| Ultra-low-latency streaming | < 500ms | < 2 seconds | Emerging standards |
| Interactive streaming (gaming) | < 100-200ms | < 500ms | Industry practice |
Architectural patterns in RTC:
1. UDP Transport: TCP's reliable, ordered delivery adds latency through retransmission and head-of-line blocking. RTC systems use UDP for media transport, accepting some packet loss in exchange for lower latency. For VoIP, a lost packet is better than a late packet.
2. Jitter Buffers: Network jitter is smoothed by buffers that delay playback. Adaptive jitter buffers adjust their size based on observed network conditions—deeper buffers when jitter is high, shallow buffers when the network is stable.
3. Forward Error Correction (FEC): Instead of retransmitting lost packets (too slow), RTC systems send redundant data that allows receiver-side reconstruction of lost packets. Tradeoff: bandwidth overhead for improved resilience.
4. Selective Forwarding Units (SFU): For multi-party video calls, SFU servers receive streams from each participant and selectively forward to others. Unlike mixing (CPU-intensive), SFUs simply route, enabling massive scale.
5. Congestion Control: RTC-specific congestion control algorithms (WebRTC's GCC, NADA) adapt bitrate in real-time based on network feedback, balancing quality against latency and loss.
WebRTC is an open-source, browser-based real-time communication stack. Studying its architecture—ICE for NAT traversal, DTLS for security, SRTP for media—provides practical education in RTC system design. Many commercial systems build on WebRTC foundations.
Autonomous vehicles embody the full spectrum of real-time requirements—from hard real-time low-level control to soft real-time route planning—within a single complex system.
The autonomous vehicle sensing-acting loop:
Sensors → Perception → Planning → Control → Actuators
↑ |
└──────────── Physical world ←─────────────────┘
Each stage has different timing requirements:
| Subsystem | Typical Rate | Deadline | Criticality |
|---|---|---|---|
| Sensor data acquisition | 10-60 Hz | Per-frame deadline | Hard RT |
| Perception (object detection) | 10-30 Hz | 100-150ms per frame | Hard RT |
| Prediction (trajectory) | 10-20 Hz | 50-100ms | Hard RT |
| Motion planning | 10-20 Hz | 50-100ms | Hard RT |
| Vehicle control (steering, braking) | 100-1000 Hz | 1-10ms | Hard RT |
| Localization (where am I?) | 10-100 Hz | 10-100ms | Hard RT |
| Route planning (high-level) | On-demand | Seconds acceptable | Soft RT |
| Map updates | Periodic | Minutes acceptable | Soft RT |
Architectural patterns in autonomous vehicles:
1. Sensor Fusion: Combining data from cameras, LiDAR, radar, and ultrasonic sensors to build a robust world model. Each sensor has different strengths (radar works in fog, cameras provide color) and timing characteristics.
2. Hardware Acceleration: Deep learning-based perception runs on GPUs or specialized AI accelerators (NVIDIA Drive, Tesla FSD chip). Inference must complete within strict time budgets for each frame.
3. Safety Envelopes: A separate, simpler safety system monitors the complex autonomy system. If the AI's planned action would violate safety constraints (collision course, excessive speed), the safety system overrides. This safety system has stricter hard real-time requirements than the autonomy stack.
4. Redundancy: Critical systems are replicated:
5. V2X Communication: Vehicle-to-everything (V2X) communication provides advance warning of situations beyond sensor range. Latency requirements vary: safety-critical V2X (collision warning) needs sub-100ms; informational V2X (traffic conditions) tolerates seconds.
Autonomous vehicles must handle infinite edge cases at real-time speeds. A pedestrian in an unexpected costume, a traffic sign with graffiti, unusual road construction—all must be processed within the same timing constraints. The combination of complex perception with hard real-time requirements makes AV one of the hardest real-time system design challenges.
The Internet of Things (IoT) and edge computing create real-time requirements at scale—millions of devices that must collect, process, and act on data with timing constraints.
The edge computing motivation:
Cloud computing adds round-trip latency (tens to hundreds of milliseconds). For applications requiring faster response, computation must move to the "edge"—closer to where data is generated and actions are taken.
IoT/Edge timing patterns:
| Application | Local Deadline | Cloud Deadline | Architecture |
|---|---|---|---|
| Smart grid demand response | 100ms local | Seconds for aggregation | Edge + Cloud |
| Predictive maintenance | Seconds locally | Hours for fleet analytics | Edge + Cloud |
| Security camera analytics | < 100ms for alerts | Hours for forensics | Edge-primary |
| Autonomous drone swarm | < 50ms coordination | N/A (disconnected) | Edge-only |
| Agricultural irrigation | Minutes | Hours for planning | Cloud-heavy |
| Retail inventory tracking | Seconds for checkout | Hours for analytics | Edge + Cloud |
Architectural patterns in IoT/Edge:
1. Computation Hierarchy:
2. Event-Driven Architecture: Devices publish events when conditions change rather than polling. Publish-subscribe systems (MQTT, AMQP) efficiently route events to interested consumers.
3. Time Synchronization: Distributed real-time systems require synchronized clocks. Protocols like PTP (Precision Time Protocol) achieve sub-microsecond synchronization for industrial applications.
4. Intermittent Connectivity: Edge devices must function when disconnected from the cloud. Store-and-forward architectures buffer data during connectivity gaps, with local decision-making for time-critical actions.
5. Resource Constraints: Edge devices often have limited CPU, memory, and power. ML models are quantized and pruned for edge deployment; algorithms are chosen for efficiency, not just accuracy.
5G networks with Multi-access Edge Computing (MEC) promise sub-10ms latency from device to edge cloud. This enables new use cases (cloud gaming, remote surgery, AR/VR) that were previously impossible. But achieving these latencies requires careful end-to-end design, not just faster wireless.
Aerospace and defense systems represent the most rigorous hard real-time environments, with certification requirements that demand formal proof of timing behavior.
Certification-driven development:
Aviation software must comply with DO-178C (Software Considerations in Airborne Systems and Equipment Certification), which establishes five Design Assurance Levels (DAL):
| Level | Failure Condition | Example Systems | Verification Rigor |
|---|---|---|---|
| DAL A | Catastrophic (crash) | Flight controls, engine control | Formal methods, 100% coverage |
| DAL B | Hazardous (injuries) | Autopilot, fire detection | Structural coverage, testing |
| DAL C | Major (workload increase) | Communications, navigation | High-level testing |
| DAL D | Minor (inconvenience) | Cabin lighting control | Basic testing |
| DAL E | No effect on safety | In-flight entertainment | Minimal requirements |
Architectural patterns in aerospace:
1. ARINC 653 Partitioning: The ARINC 653 standard defines spatial and temporal partitioning for avionics:
2. Triple Modular Redundancy (TMR): Three independent computers execute the same computation. A voter compares results and uses majority voting to mask single failures. All three must complete before the voting deadline.
3. Dissimilar Redundancy: Going beyond TMR, critical systems use different implementations:
4. Watchdog Monitors: Hardware watchdog timers must be fed by software at a regular interval. If the software misses a deadline (fails to feed the watchdog), the watchdog triggers a recovery action (reset, failover).
5. Byzantine Fault Tolerance: For ultra-critical systems, algorithms tolerate not just failures but malicious/arbitrary behavior from faulty components. Requires 3f+1 replicas to tolerate f arbitrary faults.
Space systems face radiation-induced bit-flips (Single Event Upsets) that can corrupt memory and CPU state. Error-correcting memory, radiation-hardened processors, and error-detection codes are essential. And there's no maintenance technician you can send if something breaks.
Despite their diversity, real-time systems across all domains share common patterns and lessons. Recognizing these patterns accelerates learning and transfers experience between domains.
Technology transfer across domains:
| Pattern Origin | Adopted By | Transferred Technique |
|---|---|---|
| Aerospace | Automotive | Functional safety standards (ISO 26262 from DO-178) |
| Financial trading | Gaming | Lock-free data structures, kernel bypass |
| Industrial control | IoT | Deterministic networking (TSN from PROFINET) |
| Telecommunications | Web | CDNs and edge caching |
| Gaming | VR/AR | Client-side prediction, motion-to-photon optimization |
| Robotics | Autonomous vehicles | Sensor fusion, SLAM algorithms |
When facing a new real-time challenge, ask: 'Who else has solved something similar?' The solution to your gaming latency problem might come from financial trading. Your IoT architecture might borrow from industrial control. Real-time system engineering is remarkably transferable.
We've explored real-time systems across diverse industries, seeing how common principles manifest in domain-specific architectures. Let's consolidate the key insights:
Module complete:
This concludes Module 1: What Is Real-Time? You now have a comprehensive foundation for understanding real-time systems—from formal definitions and timing requirements to the critical soft/hard distinction and real-world applications across industries.
The subsequent modules in this chapter will build on this foundation, exploring specific technologies and patterns for implementing real-time systems: WebSockets, Server-Sent Events, long polling, push notifications, and real-time architecture patterns at scale.
Congratulations! You've completed the foundational module on real-time systems. You understand what 'real-time' means formally, how latency expectations vary across domains, the critical distinction between soft and hard real-time, and how these principles apply across industries from gaming to aerospace. This knowledge prepares you for the detailed technical content in the remaining modules of this chapter.