(Sample post — edit or replace anytime)

Reliability isn’t a feature you bolt on at the end of a project—it’s a set of invariants that hold across every boundary in your system, from an interrupt handler on a Cortex-M microcontroller to an ingestion worker in the cloud.

1. Assume Every Boundary Can Stall or Fail

Whether it’s an I2C sensor hanging on a bus or an MQTT broker dropping a connection, every I/O operation needs an explicit timeout and a deterministic recovery path.

/* Always bound hardware waits and report structured errors */
status_t sensor_read_with_timeout(uint8_t *buf, size_t len, uint32_t timeout_ms) {
    uint32_t start = hal_millis();
    while (!i2c_is_ready()) {
        if ((hal_millis() - start) >= timeout_ms) {
            i2c_bus_recover();
            return STATUS_ERR_TIMEOUT;
        }
    }
    return i2c_read(buf, len);
}

2. Protect the Fleet from Synchronized Retries

If 50,000 IoT devices lose connectivity and all reconnect at the exact same second, they will DDoS your own backend. Always combine:

  • Exponential backoff with a sensible upper cap
  • Full jitter seeded per device (e.g., from a hardware RNG or device ID hash)
  • Server-side rate limiting and clear retry hints

3. Make OTA Updates Atomic and Reversible

An over-the-air update should never brick a device if power is lost halfway through:

  1. Download and verify the cryptographic signature into an inactive flash slot (A/B partitioning).
  2. Mark the new slot as pending and reboot.
  3. Require the new firmware to pass a self-health check (including cloud connectivity) before confirming the slot; otherwise, let the bootloader automatically roll back to the previous known-good image.