How Do You Design an IoT Device & Solution with Zero Data Loss?

Every IoT deployment eventually faces the same question: what happens to your data when the network goes down? For a consumer smart home sensor, a few minutes of lost readings is inconvenient. For an EV fleet management system tracking battery state, fault events, and driver safety — data gaps in the historical record mean missed maintenance alerts, inaccurate SoH trends, and potential liability. Zero data loss is not a luxury; it is a design requirement. This article explains exactly how to achieve it across the full hardware-to-cloud stack.

Autoven Team
EV IoT Technology · autoven.tech

Introduction: Data Loss Is a Design Failure, Not a Network Problem

The instinct when IoT data goes missing is to blame the network. The cellular signal dropped. The vehicle went through a tunnel. The SIM card had a billing issue. But network interruptions are not edge cases — they are the operating condition that IoT device design must assume as the default. Any architecture that relies on continuous network availability to preserve data is not production-ready.

True zero data loss IoT design treats connectivity as unreliable by default and builds reliability on top of that unreliability — through local storage, acknowledged delivery protocols, graceful reconnection, and cloud-side duplicate handling. The network is allowed to fail. The data is never allowed to fail.

Part of the Autoven IoT Series

This article covers reliability architecture for IoT devices. For the MQTT protocol powering the transmission layer, read: How MQTT Is Highly Abstracted for IoT Communication →. For the full connectivity stack, read: IoT Connectivity Technologies for Electric Vehicles →

3–8×
typical network dropouts per vehicle per day for Indian EV fleets operating in dense urban areas
5 layers
of defence required for true zero data loss — device buffer · store-forward · MQTT QoS · redundant connectivity · cloud idempotency
0 bytes
data lost by AV IoT during network outages — local eMMC buffer stores all telemetry until cloud delivery is confirmed
Days
of telemetry that AV IoT's onboard buffer can store — far exceeding any realistic network outage duration

Why IoT Data Loss Happens: The Root Causes

Understanding where data loss originates is the prerequisite for designing systems that prevent it. In IoT deployments, data can be lost at multiple points in the pipeline — from the moment it is generated on the device to the moment it is written to the cloud database. Each loss point requires a different architectural countermeasure.

The most common mental model for IoT data loss is "the network dropped." This accounts for some loss — but it is rarely the whole story. In practice, data loss is a pipeline problem: a failure at any stage of the generate → buffer → transmit → acknowledge → store chain will produce gaps in the data record, regardless of network quality.

The Hidden Loss: Power Cycling Without Persistence

Many IoT devices buffer data in RAM before transmission. When the device powers off — at the end of a vehicle's operating shift, during an unexpected power event, or on a firmware reboot — everything in RAM is lost. If the device generates and buffers 30 minutes of data before a power cycle, and none of it was persisted to flash storage, 30 minutes of battery telemetry simply disappears. RAM is not a buffer. Non-volatile storage is a buffer. This is one of the most common and easily fixed sources of data loss in production IoT systems.

The Four IoT Data Loss Failure Modes

Every IoT data loss event can be traced to one or more of four failure modes. A zero data loss architecture must address all four — patching three out of four is not zero loss.

# Failure Mode What Happens Architectural Fix
1 Network disconnection Device loses cellular signal; data generated during outage has nowhere to go and is discarded Local non-volatile buffer + store-and-forward
2 Device power loss Unexpected power-off erases all in-RAM data that was not yet written to flash Write-through to flash on every record generation
3 Cloud-side failure Cloud ingestion service unavailable; messages arrive at broker but subscriber is offline; data not stored MQTT persistent sessions + cloud-side message queue
4 Buffer overflow Local buffer fills up during prolonged outage; new data cannot be written; oldest or newest data is lost Right-sized buffer + circular FIFO overflow strategy

The Zero Data Loss Architecture: Five Defence Layers

Zero data loss is achieved through defence in depth — five independent layers, each protecting against a different class of failure. No single layer can achieve zero loss on its own. Together, they create a system where data flows to the cloud eventually and completely, even if the path is interrupted at any point.

1
Local Non-Volatile Buffering
All telemetry written to eMMC flash storage immediately on generation — before any transmission attempt. Survives power cycles, reboots, and extended outages.
2
Store-and-Forward Transmission
Device reads from local buffer and forwards to cloud only after confirmed delivery (ACK). Records deleted from local store only after PUBACK received. Ensures nothing is transmitted-and-lost.
3
MQTT QoS 1 + Persistent Sessions
Protocol-level delivery guarantee. Broker queues undelivered messages for offline clients. Auto-retry on reconnection. Last Will & Testament for unexpected disconnects.
4
Redundant Connectivity
Primary 4G LTE with automatic fallback to 2G/3G or Wi-Fi at fixed locations. Reduces outage duration, limiting local buffer consumption.
5
Cloud-Side Idempotent Ingestion
Cloud pipeline handles duplicates gracefully via message UUID deduplication. Retry and reconnection logic may produce duplicates — idempotent ingestion ensures they never create duplicate records.

Layer 1: Local Non-Volatile Buffering

The first and most critical defence against data loss is ensuring that every data point is persisted to non-volatile storage the moment it is generated — before any network transmission is attempted. This single architectural decision eliminates data loss from network outages and power cycles simultaneously.

The choice of storage medium matters:

  • eMMC flash (embedded MultiMediaCard) — High endurance, fast write speeds, suitable for high-frequency IoT telemetry. Industry standard for production IoT devices. Typical endurance: 3,000–100,000 write cycles per cell
  • SD card — Accessible and replaceable, but lower endurance than eMMC and susceptible to vibration disconnection in vehicle environments — not recommended for production EV IoT
  • NAND flash (SPI NOR/NAND) — Suitable for smaller buffers; lower endurance than eMMC; adequate for devices with lower data generation rates

For high-frequency EV telemetry (500–1,000 bytes/second across dozens of parameters), eMMC with a wear-levelled filesystem (FAT32 or ext4 with journaling) is the appropriate choice. Write endurance must be budgeted against the device's expected lifetime write volume to avoid premature flash wear-out.

Filesystem Choice Matters for Reliability

A journaled filesystem (ext4, F2FS) is essential for a device that may lose power mid-write. Without journaling, an interrupted write to the local buffer can corrupt the filesystem — turning a recoverable outage into permanent data loss. F2FS (Flash-Friendly File System) is specifically designed for NAND flash storage with write amplification minimisation and is the preferred choice for high-write IoT applications.

Layer 2: Store-and-Forward Transmission

Store-and-forward is the transmission pattern that connects the local buffer to the cloud. The device reads records from local storage, transmits them with delivery acknowledgement, and only deletes them from local storage after receiving a confirmed PUBACK from the broker.

Store-and-Forward Logic — Pseudocode
// On every telemetry generation event:
record = generate_telemetry() // BMS data, GPS, etc.
write_to_flash(record, status="PENDING") // persist BEFORE transmit

// On connectivity available:
pending = read_from_flash(status="PENDING")
for record in pending:
  result = mqtt_publish(record, qos=1) // QoS 1 = ACK required
  if result == PUBACK:
    mark_as_delivered(record) // ONLY delete after ACK
  else:
    retry_later(record) // stays PENDING, retry on next cycle

// Result: data survives any failure between generation and cloud ACK

The ACK-gated deletion pattern is the critical design decision. It means:

  • Data transmitted but not yet ACKed stays in the local buffer — safe to retransmit if the connection drops after publish but before PUBACK
  • Data is never in a state where it has left local storage but not yet reached the cloud
  • The worst case is a duplicate delivery (both the original and a retry reach the cloud) — handled by cloud idempotency at Layer 5

Layer 3: MQTT QoS and Persistent Sessions

MQTT's built-in reliability features form the third layer of defence — providing protocol-level guarantees that complement the application-level store-and-forward logic.

QoS 1: At-Least-Once Delivery

Publishing with QoS 1 means the MQTT client retransmits the message until it receives a PUBACK from the broker. If the connection drops between publish and PUBACK, the message is automatically retransmitted on reconnection. Combined with store-and-forward, this eliminates the network-layer gap between device transmission and broker receipt.

Persistent Sessions (cleanSession=false)

A persistent session instructs the broker to retain the client's subscription state and queue undelivered QoS 1 messages while the client is disconnected. When the device reconnects, all queued messages are delivered in order. This provides broker-side buffering that catches cases where the device published successfully but the cloud subscriber was temporarily unavailable.

Automatic Reconnection with Exponential Backoff

When connectivity is lost, the device should reconnect automatically — but not aggressively. Immediate reconnection attempts on a flaky network consume battery and cellular resources without improving reliability. Exponential backoff with jitter (starting at 1 second, doubling each attempt up to a maximum of 60–120 seconds, with ±25% randomisation to prevent reconnection storms across a fleet) is the standard production pattern.

Reconnection with Exponential Backoff
base_delay = 1 // seconds
max_delay = 120 // seconds
attempt = 0

while not connected:
  attempt_connection()
  if failed:
    delay = min(base_delay × 2^attempt, max_delay)
    jitter = random(-delay×0.25, +delay×0.25)
    sleep(delay + jitter)
    attempt += 1

// While disconnected: data continues writing to local flash buffer

Layer 4: Redundant Connectivity

No connectivity strategy eliminates outages entirely — but redundant connectivity reduces their duration and frequency, which directly reduces the volume of data queued in the local buffer and the latency of cloud delivery.

For EV IoT deployments, practical redundancy options include:

  • 4G LTE primary + 2G/3G fallback on the same SIM — Automatic fallback to lower-speed network when 4G is unavailable. Reduces data latency significantly for peri-urban coverage gaps. Lower bandwidth on 2G/3G is acceptable for compressed telemetry payloads
  • Dual-SIM with different operators — Two SIMs from operators with different tower infrastructure; the device switches to the active SIM automatically. Most effective in areas where one operator has gaps but another has coverage
  • Wi-Fi at fixed locations — Fleet vehicles return to depots, charging stations, or service centres where Wi-Fi is available. The IoT device automatically switches to Wi-Fi at these locations, offloading buffered data at high speed and low cost
India Connectivity Strategy

For Indian EV fleets, the recommended connectivity architecture is: primary 4G LTE with multi-operator SIM (Jio + Airtel coverage combined) for route coverage, plus Wi-Fi offload at the home charging depot. This combination achieves near-continuous connectivity for most urban and peri-urban routes while using overnight Wi-Fi to drain any buffered data from daytime coverage gaps. For tier-2 city deployments, adding 2G/3G fallback ensures minimum telemetry continuity even in coverage-limited areas.

Layer 5: Cloud-Side Idempotent Ingestion

Layers 1–4 guarantee that every data point is eventually delivered to the cloud. But they do so by allowing retransmission — the same message may arrive at the broker more than once, particularly after reconnections where the device is unsure whether its last publish was acknowledged. Layer 5 ensures that duplicate deliveries never produce duplicate database records.

Idempotent ingestion is achieved through two complementary mechanisms:

  • Message UUID deduplication — Every message generated by the device carries a unique identifier (UUID v4 or a device-ID + timestamp hash). The cloud ingestion pipeline maintains a short-window deduplication table; any message with a UUID already seen in the last N minutes is discarded before writing to the database
  • Upsert on device-ID + timestamp — Database writes use INSERT OR REPLACE (upsert) semantics keyed on (device_id, timestamp) — ensuring that a duplicate message with the same device and timestamp simply overwrites the existing record rather than creating a second one
Message UUID Structure — Zero Loss Telemetry Record
{
  "uuid" : "a3f9c2e1-4b7d-4f2a-9c1e-2d3f4a5b6c7d", ← unique per message
  "device_id" : "MH01AB1234",
  "timestamp" : "2026-03-01T14:32:45.123+05:30",
  "soc" : 67.2,
  "temp_max" : 41.8,
  "voltage" : 58.4,
  "current" : -12.3
}

Cloud UPSERT key: (device_id, timestamp) — duplicates overwrite, never duplicate

Sizing the Local Buffer: How Much Storage Is Enough?

The local buffer must be large enough to store all data generated during the longest realistic outage, with a safety margin. Under-sizing the buffer is the most common reason zero data loss architectures fail in production — everything works in testing, then a 6-hour network outage fills the buffer and data loss resumes.

Buffer Size Calculation
Data rate (bytes/sec) : R
Max outage duration (sec): T
Safety margin factor : M (typically 2×–3×)

Required buffer size = R × T × M

Example — AV IoT EV telemetry:
R = 600 bytes/sec (50 parameters at 12 bytes each)
T = 86,400 sec (24-hour worst-case outage)
M = 3× safety margin

Required buffer = 600 × 86,400 × 3 ≈ 155 MB → 256 MB eMMC minimum

AV IoT ships with 512 MB – 4 GB eMMC → 3–30 days of buffer at full telemetry rate

Buffer Overflow Strategy

When the buffer fills (in a worst-case extended outage), the device must choose what to drop. Three strategies exist:

  • FIFO (drop oldest) — Overwrite the oldest undelivered records. Recommended for EV IoT — the most recent battery state is more valuable than historical data from hours ago
  • Drop newest — Refuse to write new data when buffer is full. Preserves historical continuity but loses the most recent data — typically the wrong trade-off for safety-critical systems
  • Priority-based — Drop low-priority data (GPS pings, routine voltage logs) while preserving high-priority data (fault events, thermal alerts). Most complex but most appropriate for safety-critical applications

India-Specific Design Considerations

The zero data loss architecture described above applies universally — but Indian EV deployments present specific conditions that stress each layer in characteristic ways. A zero data loss IoT device designed for Indian operating conditions must be tested against Indian failure scenarios, not European lab conditions.

Frequent Tower Handovers in Dense Urban Traffic

Indian city driving involves dense tower-to-tower handover sequences in congested traffic — each handover can cause a 2–10 second connectivity interruption. At 600 bytes/second telemetry, a 10-second handover gap generates 6 kB of data that must be buffered and retransmitted. Multiply by 50–100 handovers per shift and the daily retransmission volume is significant. The store-and-forward pipeline must handle high-frequency small-gap reconnections efficiently without overwhelming the broker with a surge of backlogged messages on each reconnection.

End-of-Shift Power-Off Without Clean Shutdown

Many Indian 3-wheeler drivers cut ignition without allowing a graceful device shutdown sequence. The IoT device must commit all in-progress writes to flash before power is lost. A supercapacitor or small UPS capacitor bank (providing 2–5 seconds of hold-up power) on the device's power rail gives the firmware enough time to complete any pending flash writes before the supply collapses — eliminating power-loss data loss at the final moment of each shift.

Depot Wi-Fi Offload

Fleet vehicles returning to charging depots at night provide a natural opportunity for high-speed Wi-Fi offload of any buffered data from the day's operation. Configuring the IoT device to automatically detect and connect to known depot Wi-Fi SSIDs — and prioritise uploading buffered data at maximum rate — ensures that even a vehicle with poor cellular coverage all day arrives at the depot and fully synchronises before the next morning's shift.

AV IoT by Autoven: Zero Data Loss for Indian EV Fleets

Autoven's AV IoT device implements the complete five-layer zero data loss architecture — hardware through cloud — purpose-built for Indian EV fleet operating conditions.

AV IoT Zero Data Loss Features

  • eMMC flash storage (512 MB – 4 GB) — writes all telemetry to non-volatile storage on generation, before any transmission attempt
  • Store-and-forward pipeline with ACK-gated deletion — records leave local storage only after confirmed MQTT PUBACK from broker
  • MQTT QoS 1 with persistent sessions — protocol-level retransmission and broker-side queuing for all battery telemetry and fault events
  • Exponential backoff with jitter on reconnection — prevents reconnection storms; continues buffering to flash during all retry intervals
  • Last Will & Testament on every connection — automatic fleet dashboard alert on unexpected disconnect
  • 4G LTE primary with 2G/3G fallback — reduces outage duration for vehicles in variable-coverage areas
  • Depot Wi-Fi auto-connect — automatic high-speed offload of buffered data at known fleet charging locations
  • Cloud-side idempotent ingestion on the Autoven Platform — UUID deduplication ensures retransmissions never create duplicate records in fleet analytics

Zero Data Loss, Out of the Box

AV IoT brings the full five-layer zero data loss architecture to your EV fleet — so your battery analytics, SoH trends, and fault history are always complete, regardless of network conditions. Talk to our team to see how it integrates with your platform.

Talk to Our Engineers →

Conclusion: Zero Loss Requires All Five Layers

Zero data loss in IoT is achievable — but only as a system property, not a feature of any single component. The network will fail. Power will cut unexpectedly. Cloud services will have maintenance windows. The question is whether the system is designed to treat these events as normal operating conditions or as exceptional failures.

A robust zero data loss IoT architecture treats every layer of the data pipeline as a potential failure point and builds countermeasures at each one. The five-layer defence — local buffering, store-and-forward, MQTT reliability, redundant connectivity, and cloud idempotency — creates a system where no single failure can cause data loss and multiple simultaneous failures can only delay delivery, never eliminate it.

  1. Write to flash first, transmit second — Non-volatile storage is the first line of defence; RAM buffers are not reliable across power events
  2. Delete only after ACK — The store-and-forward pipeline must be ACK-gated; anything less creates a window where data can be simultaneously absent from local storage and not yet in the cloud
  3. Use MQTT QoS 1 with persistent sessions — Protocol-level delivery guarantees and broker-side queuing are non-negotiable for production IoT data reliability
  4. Right-size the buffer with a 3× safety margin — Under-sizing is the most common reason zero data loss designs fail in production; use real worst-case outage data, not optimistic estimates
  5. Handle duplicates at the cloud, not by preventing retransmission — Idempotent ingestion is cheaper and more reliable than trying to eliminate duplicates at the device or protocol layer
Related Reading

For the MQTT protocol that powers the transmission layer in this architecture: How MQTT Is Highly Abstracted for IoT Communication →. For the full connectivity technology landscape: IoT Connectivity Technologies for Electric Vehicles →

Frequently Asked Questions

Data loss in IoT devices occurs at four main points: (1) Network disconnection — if a device loses connectivity and has no local buffer, data generated during the outage is discarded; (2) Device power loss — if data in RAM has not been persisted to non-volatile storage, a power cycle erases it; (3) Cloud-side failures — if the ingestion service is unavailable when data arrives and no queuing exists, messages are dropped; (4) Buffer overflow — if the local buffer fills during a prolonged outage and no overflow strategy exists, data is lost. Zero data loss requires architectural countermeasures at all four points.
Store-and-forward is an IoT architecture pattern where the device writes all generated data to local non-volatile storage before attempting to transmit it to the cloud. When connectivity is available, data is forwarded from the local store to the cloud and deleted only after confirmed delivery. When connectivity is unavailable, data accumulates in the local store. This ensures no data is ever generated and immediately lost — it either reaches the cloud or waits in durable local storage until it can. Store-and-forward is the foundational design pattern for zero data loss IoT.
MQTT persistent sessions (cleanSession=false) instruct the broker to retain the client's subscription list and queue any undelivered QoS 1 messages while the client is disconnected. When the client reconnects, the broker delivers all queued messages in order. This provides cloud-side buffering that complements the device-side local buffer: messages published before a disconnect but not yet acknowledged are retried automatically without any application-layer retry logic needed.
Idempotent ingestion means the cloud data pipeline produces the same result whether it processes a message once or multiple times. In IoT systems where messages may be retransmitted due to QoS 1 retry or reconnection replays, the cloud must handle duplicates without creating duplicate database records. Common techniques include UUID-based deduplication and upsert operations keyed on device ID and timestamp — ensuring retransmissions overwrite rather than duplicate existing records.
Required storage = data rate (bytes/sec) × maximum outage duration (sec) × safety margin (2×–3×). For an EV IoT device generating 600 bytes/second with a 24-hour worst-case outage and 3× safety margin: 600 × 86,400 × 3 ≈ 155 MB minimum. Most production EV IoT devices use 256 MB to 4 GB of eMMC flash — providing multiple days of buffer at typical telemetry rates. Autoven's AV IoT ships with 512 MB – 4 GB eMMC, providing 3–30 days of buffer capacity.
Message acknowledgement ensures data is only deleted from the device's local buffer after confirmed delivery to the cloud. The device publishes with QoS 1, the broker acknowledges receipt (PUBACK), and only then does the device mark that record as delivered and eligible for deletion from local storage. Without ACK-gated deletion, data can be deleted from local storage before the cloud confirms receipt — and a network failure between those two events creates permanent data loss. ACK-gated deletion is the critical link between local buffering and protocol-level delivery guarantees.
Redundant connectivity uses multiple network interfaces — primary 4G LTE plus fallback 2G/3G, or primary cellular plus Wi-Fi at fixed locations — to reduce outage duration and frequency. When the primary interface fails, the device automatically switches to the backup. For Indian EV IoT, a 2G/3G fallback ensures minimum telemetry continuity in coverage-limited areas, reducing local buffer consumption and keeping data latency lower during partial coverage events.
A circular buffer overwrites the oldest undelivered data when storage is full — ensuring the device always has space for the newest data. This is preferable to stopping data collection when the buffer fills. For EV IoT, the most recent battery state is typically more valuable than data from hours ago, making FIFO overflow the standard choice. Alternative strategies include drop-newest (preserves history, loses recent state) and priority-based (drops low-priority data first — most complex but optimal for safety-critical systems).
AV IoT implements a five-layer zero data loss architecture: (1) All telemetry written to onboard eMMC flash before transmission; (2) Store-and-forward with ACK-gated deletion — records leave local storage only after MQTT PUBACK; (3) MQTT QoS 1 with persistent sessions for protocol-level retransmission and broker queuing; (4) 4G LTE primary with 2G/3G fallback and depot Wi-Fi auto-connect; (5) Cloud-side idempotent ingestion on the Autoven Platform with UUID deduplication. The result: zero data loss regardless of network quality or outage duration.
Data loss means data was generated but never reached the cloud — it is permanently gone. Data latency means data reached the cloud later than real-time — buffered during a connectivity gap and delivered on reconnection. For most EV fleet analytics, data latency is acceptable; data loss is not. A zero data loss architecture deliberately trades some real-time latency for complete data integrity — every data point eventually arrives. Real-time alerts need low latency; SoH tracking, analytics, and audit trails need zero loss.