Hot, Warm, and Cold: Designing Data Paths That Scale Without Breaking the Bank

Consider a manufacturing fleet of 8,000 vibration sensors sending 120 readings per second, every second. The Azure bill runs $22,000/month for IoT Hub and Stream Analytics processing. Ask one question: “How many of those readings trigger an alert within 30 seconds?” The answer is fewer than 3%. Ninety-seven percent of telemetry flows through a real-time pipeline that nobody needs in real time. Restructure the routing into three paths. The bill drops to $3,100. Alert latency improves by 40% because the hot path is no longer congested with cold data.

IoT telemetry is not monolithic. Different messages have different urgency profiles, and routing them all through the same pipeline is the single largest waste in IoT architectures. This post presents the hot/warm/cold data path model with concrete Azure service mappings, real routing configurations, Stream Analytics queries, and a cost model showing exactly how path design impacts your monthly bill. We include a routing audit checklist you can run today.

The Single-Pipeline Trap

The default instinct for IoT teams is to build one pipeline: devices send telemetry, it lands in IoT Hub, a stream processor evaluates it, and the results go to a dashboard and a database. This works beautifully for a proof of concept with 50 devices and three dashboards.

It breaks at scale for three reasons:

  1. Cost scales linearly with message volume through expensive processors. Azure Stream Analytics costs are driven by Streaming Units (SUs), which scale with input throughput. Running 100,000 messages per minute through a stream processor costs roughly 10x more than running 10,000 – but if 80% of those messages are destined for monthly compliance reports, you are paying real-time prices for batch-urgency data.
  2. The processor becomes a single point of congestion. When a hot-path alert and a cold-path archival message compete for the same Stream Analytics window, the alert loses. Consider a production system where a firmware update campaign floods the stream processor with status messages, causing safety-critical temperature alerts to arrive 90 seconds late.
  3. Storage tiers become impossible to manage. When all telemetry lands in a single store, you cannot apply lifecycle policies that match data access patterns. Monthly compliance data and real-time dashboard state end up on the same storage tier, and you pay hot-storage prices for data that is accessed once per quarter.

The fix is not a better stream processor. The fix is three processors with different latency targets, different cost profiles, and different storage backends.

The Three Paths

Hot Path – Act Within Seconds

The hot path exists for moments when delay costs money, damages equipment, or endangers safety. It is the most expensive path to operate and the most complex to build correctly, so you should be deliberate about what enters it.

A good rule of thumb: If no automated system or human operator will act on a data point within 60 seconds of receiving it, that data point does not belong in the hot path.

AttributeTarget
LatencySub-second to 30 seconds
Volume5–15% of total telemetry
Primary Azure servicesIoT Hub → Event Hubs → Stream Analytics → Action
StorageIn-memory windows, Cosmos DB (latest state), Azure Cache for Redis
OutputAlerts, automated commands, live dashboard updates

Concrete example: A temperature sensor in a food-processing cold chain reports 38°F. The critical threshold is 40°F. The hot path evaluates this reading in a Stream Analytics window, compares it to the threshold stored in a reference dataset, and generates an alert. If the temperature reaches 42°F, the hot path also triggers a command through IoT Hub to activate a backup refrigeration unit.

Here is the Stream Analytics query pattern:

-- Hot path: evaluate critical thresholds in real time
SELECT
  System.Timestamp AS ProcessingTime,
  deviceId,
  readings.temp AS temperature,
  r.threshold AS criticalThreshold,
  'CRITICAL' AS alertLevel
INTO
  AlertOutput
FROM
  TelemetryInput TIMESTAMP BY ts AS t
JOIN
  ThresholdReference AS r
ON
  t.deviceId = r.deviceId
WHERE
  t.readings.temp > r.threshold

The key insight: the hot path processes a filtered subset of the full telemetry stream. IoT Hub routing or a Stream Analytics WHERE clause filters out readings that are well within safe ranges, dramatically reducing the compute required. In the manufacturing example above, only 3% of vibration readings exceeded the alert threshold. By filtering at the ingestion layer, we reduced Stream Analytics SU requirements from 8 to 2 – an 75% cost reduction for the hot path alone.

Warm Path – Analyze Within Minutes

The warm path handles telemetry that needs near-real-time processing for trend analysis, anomaly detection, and digital twin state updates. This is the data that answers “is this equipment degrading?” rather than “is this equipment failing right now?”

AttributeTarget
Latency1 to 15 minutes
Volume20-40% of total telemetry
Primary Azure servicesIoT Hub -> Event Hubs -> Azure Functions / Stream Analytics
StorageAzure Data Explorer, Cosmos DB, SQL Database
OutputTrend dashboards, anomaly scores, digital twin updates

Concrete example: A building management system tracks hourly energy consumption across 200 HVAC units. The warm path aggregates readings into 5-minute windows, enriches them with building metadata (floor, zone, occupancy schedule), and writes the results to Azure Data Explorer for trend analysis. A facility manager opens a dashboard at 2 PM and sees energy usage for the last 8 hours, broken down by zone.

Here is an Azure Function pattern for warm-path enrichment:

[FunctionName("EnrichTelemetry")]
public static async Task Run(
    [EventHubTrigger("telemetry-warm", Connection = "EventHubConnectionString")]
    IEnumerable<EventData> messages,
    [CosmosDB("devices", "telemetry", Connection = "CosmosDbConnectionString")]
    IAsyncCollector<Document> enrichedTelemetry,
    ILogger log)
{
    foreach (var message in messages)
    {
        var telemetry = JsonSerializer.Deserialize<TelemetryReading>(message.Body.ToString());
        var deviceMetadata = await _deviceCache.GetDeviceAsync(telemetry.DeviceId);

        var enriched = new EnrichedTelemetry
        {
            DeviceId = telemetry.DeviceId,
            BuildingId = deviceMetadata.BuildingId,
            Zone = deviceMetadata.Zone,
            Temperature = telemetry.Readings.Temp,
            OccupancyAdjusted = telemetry.Readings.Temp / deviceMetadata.OccupancyFactor,
            Timestamp = telemetry.Timestamp
        };

        await enrichedTelemetry.AddAsync(enriched);
    }
}

The warm path is where most IoT value is created. Raw sensor readings are transformed into contextualized, actionable insights. The enrichment step – joining telemetry with device metadata, operational state, and business context – is what turns a number into a decision.

Cold Path – Archive and Analyze in Batches

The cold path handles telemetry destined for long-term storage, regulatory compliance, batch analytics, and ML training. This data is never accessed in real time.

AttributeTarget
LatencyHours to days
Volume50–80% of total telemetry
Primary Azure servicesIoT Hub -> Blob Storage / Data Lake Storage
StorageADLS Gen2 (cool/archive tier), Parquet/Delta Lake
OutputMonthly reports, ML training datasets, compliance audits

Concrete example: A pharmaceutical cold-chain solution must maintain temperature records for every shipment for five years to satisfy FDA 21 CFR Part 11. The cold path writes raw telemetry to Data Lake Storage in Parquet format, organized by date partition (/year=2025/month=03/day=15/). A nightly Databricks job validates data completeness, applies calibration corrections, and writes cleaned data to a gold-layer table. A compliance auditor queries the gold table through Synapse serverless SQL.

Here is the IoT Hub routing configuration that sends a copy of all telemetry to Blob Storage for cold-path archival:

{
  "endpoint": {
    "serviceBusQueues": [
      {
        "name": "hot-path-queue",
        "connectionString": "${ServiceBusHotConnectionString}"
      }
    ],
    "eventHubs": [
      {
        "name": "warm-path-events",
        "connectionString": "${EventHubWarmConnectionString}"
      }
    ],
    "storageContainers": [
      {
        "name": "telemetry-archive",
        "connectionString": "${StorageAccountConnectionString}",
        "batchFrequency": 120,
        "maxChunkSize": 5000000,
        "encoding": "avro"
      }
    ]
  },
  "routes": [
    {
      "name": "critical-to-hot",
      "source": "DeviceMessages",
      "condition": "eventType = 'telemetry' AND readings.temp > criticalThreshold",
      "endpointNames": ["hot-path-queue"],
      "isEnabled": true
    },
    {
      "name": "standard-to-warm",
      "source": "DeviceMessages",
      "condition": "eventType = 'telemetry'",
      "endpointNames": ["warm-path-events"],
      "isEnabled": true
    },
    {
      "name": "all-to-cold",
      "source": "DeviceMessages",
      "condition": "true",
      "endpointNames": ["telemetry-archive"],
      "isEnabled": true
    }
  ],
  "fallbackRoute": {
    "name": "$fallback",
    "endpointNames": ["telemetry-archive"]
  }
}

This configuration achieves three things simultaneously:

  • Critical readings flow to the hot path (Service Bus queue → immediate processing).
  • All telemetry flows to the warm path (Event Hubs → enrichment → ADX).
  • Every message is archived to cold storage (Blob capture in Avro format) regardless of routing.

The batchFrequency of 120 seconds and maxChunkSize of 5MB balance write frequency against storage cost. The Avro encoding preserves schema information for downstream batch processing.

The Cost Model: Three Paths vs. One Pipeline

Let us work through a concrete cost comparison. A fleet of 50,000 devices, each sending one message per minute (28.8 million messages per day, ~864 million per month):

Single-Pipeline Approach (Everything Through Stream Analytics)

ComponentCost DriverMonthly Cost
IoT Hub (S1, 50K devices)Messages + device count$8,640
Stream Analytics (8 SU)28.8M msg/day through 8 SU$12,960
Cosmos DB (hot storage)864M messages at $0.25/GB$4,320
Total $25,920

Three-Path Approach

PathComponentCost DriverMonthly Cost
Hot (5%)Stream Analytics (2 SU)1.44M msg/day through 2 SU$1,620
Hot (5%)Cosmos DB (latest state)43.2M messages (deduplicated)$216
Warm (30%)Azure Functions + ADX86.4M msg, L1 cluster$2,880
Cold (65%)ADLS Gen2 (cool tier)576M messages, Parquet, cool$288
AllIoT Hub (S1, 50K devices)Same base cost$8,640
Total  $13,644

Savings: $12,276/month (47% reduction) – and this is conservative. The single-pipeline approach stores all 864M messages in Cosmos DB hot storage. The three-path approach stores only the latest state per device in Cosmos DB (43.2M unique device states) and archives the rest to cool-tier ADLS at 1/15th the cost.

The savings increase with fleet size because stream processing costs scale linearly with volume, while cold-path storage costs scale sub-linearly (Parquet compression reduces data volume by 5–10x compared to JSON).

Common Routing Mistakes

Mistake 1: The Hot Path Black Hole

A team routed all telemetry through Stream Analytics and wrote results to a single Cosmos DB container. When they added a new alert rule, they had to modify the Stream Analytics query, which required redeploying the entire job. The redeployment window caused a 5-minute gap in alerting.

Fix: Separate hot-path alerting into its own Stream Analytics job with its own input (a dedicated Event Hub endpoint routed from IoT Hub). New alert rules are added to the hot-path job without affecting warm or cold processing.

Mistake 2: Device Twins as a Time-Series Store

A team stored every temperature reading in device twin desired properties. Device twins are designed for configuration state, not high-frequency telemetry. The twin document grew to megabytes, and twin queries timed out after 30 seconds.

Fix: Device twins store configuration (telemetry interval, alert thresholds, firmware version). Telemetry flows to a time-series store (Azure Data Explorer, Cosmos DB with time-partitioned container). The dashboard reads latest state from the time-series store, not the twin.

Mistake 3: No Raw Data Archive

A team processed all telemetry through a Stream Analytics job that filtered out “invalid” readings (values outside expected ranges). Six months later, a customer complained that their equipment was malfunctioning, and the team needed to review the raw telemetry to investigate. The data was gone – Stream Analytics had discarded it, and nothing had archived the original messages.

Fix: Always write raw telemetry to a data lake before any processing. The cold-path archive is your source of truth. Processed data can be regenerated; raw data cannot.

The Routing Audit Checklist

Run this audit before your next budget cycle. Open your IoT Hub configuration and answer these questions:

  1. What percentage of ingested messages enters the hot path? Count the messages routed to your real-time stream processor. If more than 15% of total telemetry enters the hot path, you are over-processing. Filter at the ingestion layer.
  2. Are you storing telemetry in device twins? Query your IoT Hub for twin document sizes. Any twin larger than 10KB is a code smell. Move telemetry to a time-series store.
  3. Does raw telemetry land in a data lake before processing? Check your IoT Hub routing endpoints. If there is no storage container endpoint capturing all messages, you are one pipeline bug away from losing your production data.
  4. What storage tier is your cold-path data on? Check your Blob Storage or ADLS lifecycle policies. Data older than 30 days should move to cool tier. Data older than 90 days should move to archive tier. A single lifecycle policy can reduce cold-path storage costs by 60–80%.
  5. Are you batching messages at the device level? Check your average message size. If messages are under 100 bytes, your devices are likely sending one reading per message. Batching 60 seconds of readings into a single message can reduce message count by 60x, directly reducing IoT Hub costs.

Key Takeaways

  • Not all telemetry has the same urgency. A good rule: if no one acts on a data point within 60 seconds, it does not belong in the hot path.
  • Three paths, three cost profiles. The hot path optimizes for latency. The warm path optimizes for enrichment. The cold path optimizes for storage cost. A single pipeline optimizes for nothing.
  • IoT Hub routing is your first layer of separation. Use routing conditions to direct messages to different endpoints before any code runs. The configuration shown in this post routes hot, warm, and cold data simultaneously with zero custom code.
  • Always archive raw telemetry before processing. The cold-path archive is your insurance policy against pipeline bugs, schema changes, and customer investigations.
  • The cost savings are real and substantial. In our analysis, a 50,000-device fleet saved $12,276/month (47%) by restructuring from a single pipeline to three paths. The savings increase with fleet size.

Further reading: For practical guidance on ingestion pipelines, storage tiers, and cost optimization, download Mastering IoT Solutions on Azure with the Well-Architected Framework.

Kyle Burns is a Practice Lead, Technical Principal at Mesh Systems. 

  • Solutions
  • Industries
  • Company
  • Resources