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-management3department: "sentinel"4description: "Device provisioning, OTA update strategy, and fleet-scale monitoring"5version: 16triggers:7 - "OTA"8 - "fleet"9 - "provisioning"10 - "update"11 - "telemetry"12 - "device management"13 - "certificate"14 - "rollout"15 - "firmware update"16---1718# Fleet Management1920## Purpose2122Design the fleet management infrastructure for an IoT device fleet, including device provisioning, OTA firmware update strategy, telemetry aggregation, and fleet-scale monitoring.2324## Inputs2526- Expected fleet size (current and projected)27- Device hardware capabilities (storage, connectivity, compute)28- Update frequency requirements29- Monitoring and alerting requirements30- Regulatory requirements (safety-critical updates, rollback mandates)3132## Process3334### Step 1: Design Device Provisioning3536Plan how devices go from factory to operational:37- **Identity:** Unique device ID (hardware serial, provisioned certificate)38- **Authentication:** Device certificates (X.509), pre-shared keys, or cloud-provisioned tokens39- **Registration flow:** First-boot sequence, cloud registration, owner assignment40- **Zero-touch:** Can a device self-provision without manual intervention?41- **Factory integration:** What happens on the manufacturing line?4243### Step 2: Design OTA Update System4445Plan the firmware update lifecycle:46- **Partition scheme:** A/B (dual partition for atomic swap), single with rollback region47- **Update delivery:** Pull (device checks periodically) vs push (server initiates)48- **Delta updates:** Full firmware image vs binary diff (saves bandwidth)49- **Integrity verification:** Cryptographic signature verification before applying50- **Rollback mechanism:** Automatic rollback if new firmware fails health check51- **Staged rollout:** Canary (1%) → early (10%) → general (100%) with hold gates5253### Step 3: Design Telemetry Pipeline5455Plan how device data reaches the cloud:56- **Data types:** Health metrics (battery, signal, temperature), application data, error reports57- **Aggregation:** On-device pre-aggregation to reduce bandwidth (send averages, not raw samples)58- **Transport:** MQTT topics, HTTP batch uploads, or store-and-forward59- **Cloud ingestion:** Message broker → stream processing → storage60- **Retention:** Hot (real-time queries), warm (weekly), cold (archive)6162### Step 4: Design Monitoring and Alerting6364Plan fleet-scale observability:65- **Health dashboards:** Fleet-wide metrics (online %, firmware version distribution, battery levels)66- **Anomaly detection:** Devices reporting unusual values, sudden offline clusters67- **Alert thresholds:** Battery < 10%, signal < -90dBm, error rate > 1%, offline > 24h68- **Group operations:** Query and act on device groups (by firmware version, region, owner)6970### Step 5: Design Remote Management7172Plan remote device operations:73- **Configuration updates:** Push configuration changes without firmware update74- **Remote diagnostics:** Request debug logs, trigger self-test, read sensor state75- **Remote actions:** Reboot, factory reset, enter recovery mode76- **Access control:** Who can perform which operations on which devices7778### Step 6: Plan Scaling Strategy7980Design for fleet growth:81- **Connection management:** Connection limits per broker, load balancing82- **Update infrastructure:** CDN for firmware binaries, rate limiting downloads83- **Database design:** Time-series storage for telemetry, device registry scaling84- **Cost modeling:** Per-device cloud cost at 1K, 10K, 100K, 1M devices8586## Output Format8788```markdown89# Fleet Management Architecture9091## Provisioning Flow92```93[Factory] → [Flash firmware + certificate] → [First boot] → [Cloud registration] → [Owner assignment] → [Operational]94```9596| Step | Method | Duration | Manual? |97|------|--------|----------|---------|98| Identity | X.509 certificate | Factory | No |99| Registration | MQTT first-connect | <30s | No |100| Owner assignment | QR code scan | User-initiated | Yes |101102## OTA Update Strategy103| Aspect | Approach |104|--------|----------|105| Partition scheme | A/B dual-partition |106| Delivery | Pull, 6-hour check interval |107| Format | Delta updates (bsdiff) |108| Verification | Ed25519 signature |109| Rollback | Automatic on 3 failed health checks |110| Staged rollout | 1% → 10% → 50% → 100% with 24h holds |111112## Telemetry Pipeline113```114[Device] → [MQTT] → [Message Broker] → [Stream Processor] → [Time-Series DB] → [Dashboard]115```116117| Data Type | Frequency | Aggregation | Retention |118|-----------|-----------|-------------|-----------|119| Health | 5 min | On-device avg | 90 days |120| Errors | Event-driven | None | 1 year |121| Application | 30 sec | 1-min rollups | 30 days |122123## Monitoring Dashboard124| Metric | Threshold | Alert |125|--------|-----------|-------|126| Fleet online % | < 95% | Warning |127| Firmware current % | < 80% | Info |128| Battery critical | < 5% | Critical |129| Error rate | > 1% | Warning |130131## Scaling Projections132| Fleet Size | Monthly Cost | Key Bottleneck |133|-----------|-------------|----------------|134| 1,000 | $X | None |135| 10,000 | $X | MQTT connections |136| 100,000 | $X | Telemetry storage |137```138139## Quality Checks140141- [ ] Provisioning flow is zero-touch (no manual steps per device)142- [ ] OTA updates are cryptographically signed and verified143- [ ] Rollback is automatic — a bad update doesn't brick the fleet144- [ ] Staged rollout has hold gates between stages145- [ ] Telemetry pipeline handles device-side aggregation to reduce bandwidth146- [ ] Monitoring has defined thresholds and alert escalation paths147- [ ] Cost model scales linearly (not exponentially) with fleet size148149## Evolution Notes150<!-- Observations appended after each use -->