McDonald’s Achieves Sub-Second Analytics at Scale with TDengine

Joel Brass

May 14, 2025 /

Overview

Faced with the challenge of managing and analyzing billions of server monitoring records each day, McDonald’s turned to TDengine to transform its time-series data infrastructure. The result: a high-performance, real-time analytics system capable of delivering sub-second insights, even on datasets containing tens of millions of records per table.

Customer Background

The system being monitored consisted of more than 800 servers that generate 3.5 billion data records per day, with some machines generating as many as 10 million data points daily. Storing and monitoring this dataset is critical to maintaining system reliability, ensuring optimal performance, and proactively identifying anomalies.

Business queries at McDonald’s rely heavily on percentile-based latency metrics, particularly determining the P90, P95, P99, and P99.99 of certain data. These metrics help the engineering and operations teams understand worst-case response times and deliver consistently smooth user experiences.

Query flow at McDonald’s

The Challenge

McDonald’s needed to:

  • Store and manage billions of time-series records per day
  • Query latency metrics across tens of millions of records, on-demand and in real time
  • Maintain query response times under 1 second, even for complex analytics involving multiple percentile calculations

Traditional approaches could not keep pace. Initial tests showed that computing multiple percentile values over a single table of 10 million rows took over 2.5 seconds, creating a bottleneck for operational visibility.

The TDengine Solution

TDengine worked closely with McDonald’s engineering team to redesign and optimize the execution of percentile-based queries. Key innovations included:

  1. Multi-Percentile Optimization:
    McDonald’s percentile queries targeted a single data column over a fixed time range. TDengine introduced merged histogram bucketing, which enabled multiple percentile values to be calculated in a single pass, eliminating redundant computations and significantly improving performance.
  2. Intelligent Use of Summary Statistics:
    TDengine’s query planner was enhanced to leverage statistical moving averages (SMA) during the first scan of percentile queries. This reduced the need to load raw data in early computation stages, cutting total execution time without sacrificing accuracy.

Results

  • Query time reduced from 2.5 seconds to 0.8 seconds, even with simultaneous COUNT, AVG, and multiple PERCENTILE functions
  • Single-table queries over 10 million records consistently returned results in under one second
  • Enabled real-time monitoring and faster issue resolution across all monitored servers
  • Delivered greater operational agility by accelerating the feedback loop between performance data and decision-making

Why TDengine

  • Built for scale: Optimized for high-ingestion workloads and per-device isolation
  • Designed for performance: Engineered for millisecond-latency queries, even under heavy data volumes
  • Deep technical support: TDengine’s team provided hands-on engineering collaboration and custom query optimization

Conclusion

By partnering with TDengine, McDonald’s successfully transformed its server monitoring pipeline into a real-time analytics platform. The sub-second performance achieved through collaborative optimization work has allowed the company to unlock new levels of visibility, responsiveness, and confidence in its operations.

  • Joel Brass
    Joel Brass

    Joel Brass is a Solutions Architect at TDengine, bringing extensive experience in real-time data processing, time-series analytics, and full-stack development. With a 20 year background in software engineering and a deep focus on scalable applications and solutions, Joel has worked on a range of projects spanning joke databases, IoT, self-driving vehicles, and work management platforms. Prior to joining TDengine, Joel worked in Advisory Services for Enterprise customers of Atlassian and the Systems Engineering team at Waymo. He is currently based in the San Francisco Bay Area.