Fleet Management
Purpose
Design the fleet management infrastructure for an IoT device fleet, including device provisioning, OTA firmware update strategy, telemetry aggregation, and fleet-scale monitoring.
Inputs
- Expected fleet size (current and projected)
- Device hardware capabilities (storage, connectivity, compute)
- Update frequency requirements
- Monitoring and alerting requirements
- Regulatory requirements (safety-critical updates, rollback mandates)
Process
Step 1: Design Device Provisioning
Plan how devices go from factory to operational:
- Identity: Unique device ID (hardware serial, provisioned certificate)
- Authentication: Device certificates (X.509), pre-shared keys, or cloud-provisioned tokens
- Registration flow: First-boot sequence, cloud registration, owner assignment
- Zero-touch: Can a device self-provision without manual intervention?
- Factory integration: What happens on the manufacturing line?
Step 2: Design OTA Update System
Plan the firmware update lifecycle:
- Partition scheme: A/B (dual partition for atomic swap), single with rollback region
- Update delivery: Pull (device checks periodically) vs push (server initiates)
- Delta updates: Full firmware image vs binary diff (saves bandwidth)
- Integrity verification: Cryptographic signature verification before applying
- Rollback mechanism: Automatic rollback if new firmware fails health check
- Staged rollout: Canary (1%) → early (10%) → general (100%) with hold gates
Step 3: Design Telemetry Pipeline
Plan how device data reaches the cloud:
- Data types: Health metrics (battery, signal, temperature), application data, error reports
- Aggregation: On-device pre-aggregation to reduce bandwidth (send averages, not raw samples)
- Transport: MQTT topics, HTTP batch uploads, or store-and-forward
- Cloud ingestion: Message broker → stream processing → storage
- Retention: Hot (real-time queries), warm (weekly), cold (archive)
Step 4: Design Monitoring and Alerting
Plan fleet-scale observability:
- Health dashboards: Fleet-wide metrics (online %, firmware version distribution, battery levels)
- Anomaly detection: Devices reporting unusual values, sudden offline clusters
- Alert thresholds: Battery < 10%, signal < -90dBm, error rate > 1%, offline > 24h
- Group operations: Query and act on device groups (by firmware version, region, owner)
Step 5: Design Remote Management
Plan remote device operations:
- Configuration updates: Push configuration changes without firmware update
- Remote diagnostics: Request debug logs, trigger self-test, read sensor state
- Remote actions: Reboot, factory reset, enter recovery mode
- Access control: Who can perform which operations on which devices
Step 6: Plan Scaling Strategy
Design for fleet growth:
- Connection management: Connection limits per broker, load balancing
- Update infrastructure: CDN for firmware binaries, rate limiting downloads
- Database design: Time-series storage for telemetry, device registry scaling
- Cost modeling: Per-device cloud cost at 1K, 10K, 100K, 1M devices
Output Format
# Fleet Management Architecture
## Provisioning Flow
[Factory] → [Flash firmware + certificate] → [First boot] → [Cloud registration] → [Owner assignment] → [Operational]
| Step | Method | Duration | Manual? |
|------|--------|----------|---------|
| Identity | X.509 certificate | Factory | No |
| Registration | MQTT first-connect | <30s | No |
| Owner assignment | QR code scan | User-initiated | Yes |
## OTA Update Strategy
| Aspect | Approach |
|--------|----------|
| Partition scheme | A/B dual-partition |
| Delivery | Pull, 6-hour check interval |
| Format | Delta updates (bsdiff) |
| Verification | Ed25519 signature |
| Rollback | Automatic on 3 failed health checks |
| Staged rollout | 1% → 10% → 50% → 100% with 24h holds |
## Telemetry Pipeline
[Device] → [MQTT] → [Message Broker] → [Stream Processor] → [Time-Series DB] → [Dashboard]
| Data Type | Frequency | Aggregation | Retention |
|-----------|-----------|-------------|-----------|
| Health | 5 min | On-device avg | 90 days |
| Errors | Event-driven | None | 1 year |
| Application | 30 sec | 1-min rollups | 30 days |
## Monitoring Dashboard
| Metric | Threshold | Alert |
|--------|-----------|-------|
| Fleet online % | < 95% | Warning |
| Firmware current % | < 80% | Info |
| Battery critical | < 5% | Critical |
| Error rate | > 1% | Warning |
## Scaling Projections
| Fleet Size | Monthly Cost | Key Bottleneck |
|-----------|-------------|----------------|
| 1,000 | $X | None |
| 10,000 | $X | MQTT connections |
| 100,000 | $X | Telemetry storage |
Quality Checks
Evolution Notes
1---2name: fleet-management3description: Device provisioning, OTA update strategy, and fleet-scale monitoring4---56# Fleet Management78## Purpose910Design the fleet management infrastructure for an IoT device fleet, including device provisioning, OTA firmware update strategy, telemetry aggregation, and fleet-scale monitoring.1112## Inputs1314- Expected fleet size (current and projected)15- Device hardware capabilities (storage, connectivity, compute)16- Update frequency requirements17- Monitoring and alerting requirements18- Regulatory requirements (safety-critical updates, rollback mandates)1920## Process2122### Step 1: Design Device Provisioning2324Plan how devices go from factory to operational:25- **Identity:** Unique device ID (hardware serial, provisioned certificate)26- **Authentication:** Device certificates (X.509), pre-shared keys, or cloud-provisioned tokens27- **Registration flow:** First-boot sequence, cloud registration, owner assignment28- **Zero-touch:** Can a device self-provision without manual intervention?29- **Factory integration:** What happens on the manufacturing line?3031### Step 2: Design OTA Update System3233Plan the firmware update lifecycle:34- **Partition scheme:** A/B (dual partition for atomic swap), single with rollback region35- **Update delivery:** Pull (device checks periodically) vs push (server initiates)36- **Delta updates:** Full firmware image vs binary diff (saves bandwidth)37- **Integrity verification:** Cryptographic signature verification before applying38- **Rollback mechanism:** Automatic rollback if new firmware fails health check39- **Staged rollout:** Canary (1%) → early (10%) → general (100%) with hold gates4041### Step 3: Design Telemetry Pipeline4243Plan how device data reaches the cloud:44- **Data types:** Health metrics (battery, signal, temperature), application data, error reports45- **Aggregation:** On-device pre-aggregation to reduce bandwidth (send averages, not raw samples)46- **Transport:** MQTT topics, HTTP batch uploads, or store-and-forward47- **Cloud ingestion:** Message broker → stream processing → storage48- **Retention:** Hot (real-time queries), warm (weekly), cold (archive)4950### Step 4: Design Monitoring and Alerting5152Plan fleet-scale observability:53- **Health dashboards:** Fleet-wide metrics (online %, firmware version distribution, battery levels)54- **Anomaly detection:** Devices reporting unusual values, sudden offline clusters55- **Alert thresholds:** Battery < 10%, signal < -90dBm, error rate > 1%, offline > 24h56- **Group operations:** Query and act on device groups (by firmware version, region, owner)5758### Step 5: Design Remote Management5960Plan remote device operations:61- **Configuration updates:** Push configuration changes without firmware update62- **Remote diagnostics:** Request debug logs, trigger self-test, read sensor state63- **Remote actions:** Reboot, factory reset, enter recovery mode64- **Access control:** Who can perform which operations on which devices6566### Step 6: Plan Scaling Strategy6768Design for fleet growth:69- **Connection management:** Connection limits per broker, load balancing70- **Update infrastructure:** CDN for firmware binaries, rate limiting downloads71- **Database design:** Time-series storage for telemetry, device registry scaling72- **Cost modeling:** Per-device cloud cost at 1K, 10K, 100K, 1M devices7374## Output Format7576```markdown77# Fleet Management Architecture7879## Provisioning Flow80```81[Factory] → [Flash firmware + certificate] → [First boot] → [Cloud registration] → [Owner assignment] → [Operational]82```8384| Step | Method | Duration | Manual? |85|------|--------|----------|---------|86| Identity | X.509 certificate | Factory | No |87| Registration | MQTT first-connect | <30s | No |88| Owner assignment | QR code scan | User-initiated | Yes |8990## OTA Update Strategy91| Aspect | Approach |92|--------|----------|93| Partition scheme | A/B dual-partition |94| Delivery | Pull, 6-hour check interval |95| Format | Delta updates (bsdiff) |96| Verification | Ed25519 signature |97| Rollback | Automatic on 3 failed health checks |98| Staged rollout | 1% → 10% → 50% → 100% with 24h holds |99100## Telemetry Pipeline101```102[Device] → [MQTT] → [Message Broker] → [Stream Processor] → [Time-Series DB] → [Dashboard]103```104105| Data Type | Frequency | Aggregation | Retention |106|-----------|-----------|-------------|-----------|107| Health | 5 min | On-device avg | 90 days |108| Errors | Event-driven | None | 1 year |109| Application | 30 sec | 1-min rollups | 30 days |110111## Monitoring Dashboard112| Metric | Threshold | Alert |113|--------|-----------|-------|114| Fleet online % | < 95% | Warning |115| Firmware current % | < 80% | Info |116| Battery critical | < 5% | Critical |117| Error rate | > 1% | Warning |118119## Scaling Projections120| Fleet Size | Monthly Cost | Key Bottleneck |121|-----------|-------------|----------------|122| 1,000 | $X | None |123| 10,000 | $X | MQTT connections |124| 100,000 | $X | Telemetry storage |125```126127## Quality Checks128129- [ ] Provisioning flow is zero-touch (no manual steps per device)130- [ ] OTA updates are cryptographically signed and verified131- [ ] Rollback is automatic — a bad update doesn't brick the fleet132- [ ] Staged rollout has hold gates between stages133- [ ] Telemetry pipeline handles device-side aggregation to reduce bandwidth134- [ ] Monitoring has defined thresholds and alert escalation paths135- [ ] Cost model scales linearly (not exponentially) with fleet size136137## Evolution Notes138<!-- Observations appended after each use -->