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.
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 →
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.
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.
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.
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.
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.
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
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
"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.
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.
- Write to flash first, transmit second — Non-volatile storage is the first line of defence; RAM buffers are not reliable across power events
- 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
- Use MQTT QoS 1 with persistent sessions — Protocol-level delivery guarantees and broker-side queuing are non-negotiable for production IoT data reliability
- 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
- 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
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 →