IoT
OTA updates without the 3am rollback: a staged-rollout playbook for device fleets
A bad firmware release should reach one percent of your fleet, not all of it. Here is the rollout discipline we apply to every connected product we ship.
Every team that ships connected hardware eventually has the same night: a firmware update goes out to the whole fleet, something that passed in the lab fails in the field, and by morning thousands of devices are offline or worse, bricked. The fix is not better testing (you will never reproduce every field condition) it is a rollout process that assumes the release is broken until proven otherwise.
Principle one: no update is trusted until the fleet says so
Treat a firmware release the way a cloud team treats a deploy: canary first, watch the metrics, widen gradually. The unit of confidence is not the test suite, it is the health of the devices that already received the update.
The cohort ladder
We define cohorts before the first release ever ships. A typical ladder for a fleet of ten thousand devices looks like this:
- Internal: devices on engineers' desks and in the lab. Hours.
- Friendly: a few dozen devices at customers who agreed to early access. One to two days.
- 1%: randomly sampled across hardware revisions, regions and connectivity types. Two days.
- 10%: same sampling, wider. Two to three days.
- 50%, then 100%: only after the previous cohort shows no regression against the baseline.
Sampling matters more than percentage. A one-percent cohort that is entirely one hardware revision on one carrier tells you almost nothing. Stratify by the things that actually differ in the field.
What to watch, and what counts as failure
Decide the abort criteria before the rollout starts, and make them numbers, not feelings. The signals we always instrument:
- Check-in rate: devices that received the update but stopped reporting are the loudest alarm.
- Reboot loops and watchdog resets per device-hour.
- Update success rate, including download failures and signature rejections.
- Application-level health: for a sensor product, the ratio of valid readings; for a gateway, message throughput.
- Battery drain delta for anything battery-powered.
If any signal crosses its threshold, the rollout pauses automatically. A human decides whether to roll back; the system decides whether to stop widening.
Rollback has to be boring
A rollback that requires a truck roll is not a rollback. Every device needs a dual-bank (A/B) partition layout so the previous image is still on the flash, and a bootloader rule that reverts automatically if the new image fails to confirm itself within a few boots. We rehearse the rollback on the internal cohort for every release: if nobody has watched it work this month, assume it does not.
Signing, versioning and the audit trail
Images are signed at build time with a key that never touches a developer laptop. Devices reject anything unsigned or downgraded below a minimum version unless an explicit override is issued. Every rollout action (who approved, which cohort, what thresholds) is written to an immutable log. That log is what you hand to a customer, an auditor or your own future self.
The goal is not to never ship a bad build. It is to make a bad build a small, quickly reversed inconvenience instead of a company-wide incident.
Tooling
Platforms such as AWS IoT Jobs, Azure Device Update and Mender give you cohorts, scheduling and status reporting out of the box. What they do not give you is your abort criteria, your stratified sampling or your rehearsal discipline. Those are process decisions, and they are the part that keeps you asleep at 3am.