Device management is like IT support for thousands of IoT devices—keeping them updated, secure, and working.
Key challenges device management solves:
Problem
Without Management
With Management
Firmware bug
Physically visit each device
Push OTA update remotely
Security patch
Devices stay vulnerable
Deploy fix to all devices instantly
Configuration change
Manual reconfiguration
Update config remotely
Device fails
No notification
Automatic alert + diagnostics
Two popular device management platforms:
Platform
Best For
Key Feature
Balena
Raspberry Pi fleets
Docker containers + OTA
Mender
Embedded Linux
Robust rollback on failure
Open-source vs. managed platforms:
Open Source (ThingsBoard, FIWARE)
Managed (AWS, Azure)
Free software license
Pay per device/message
You manage infrastructure
Cloud manages infrastructure
Full control and customization
Less flexibility
Requires DevOps expertise
Easier to start
When to self-host:
Budget-constrained projects
Privacy requirements (data can’t leave premises)
Custom features not available in managed platforms
Large scale where per-device pricing is expensive
Sensor Squad: Managing the Fleet
“When you have one IoT device, you update it by plugging in a USB cable,” said Max the Microcontroller. “When you have 10,000 devices spread across a city, you need a device management platform. It is like the difference between feeding one pet and running a zoo!”
Sammy the Sensor described the problem. “Imagine a firmware bug that makes sensors report wrong temperatures. Without device management, someone has to physically visit every single sensor to fix it. With a platform like Balena or Mender, you push the update from your laptop and every device downloads the fix automatically.”
Lila the LED compared the options. “Balena is great for Raspberry Pi fleets – it uses Docker containers, so updating your app is as simple as pushing a new container image. Mender specializes in robust over-the-air updates with automatic rollback if anything goes wrong.” Bella the Battery mentioned the open-source alternatives. “ThingsBoard and FIWARE are free to use and you host them yourself. They give you full control but require DevOps skills. For companies with strict privacy requirements where data cannot leave the building, self-hosted platforms are the only option. The choice between managed and self-hosted depends on your budget, skills, and compliance needs.”
35.3 Device Management Platforms
35.3.1 Balena
Description: Fleet management platform for edge device deployment and updates.
Description: Lightweight, open-source IoT platform written in Go.
Key Features:
Microservices architecture
Multi-protocol (MQTT, HTTP, CoAP, WebSocket)
Message routing
Security (authentication, authorization)
Docker deployment
Strengths:
Lightweight
Modern architecture
Good performance
Easy deployment
Limitations:
Smaller community
Fewer features than enterprise platforms
Typical Use Cases:
Custom IoT platforms
Research projects
Resource-constrained deployments
35.5 Platform Selection Criteria
IoT platform selection decision tree flowchart starting from project requirements. First decision point evaluates device count with three branches: less than 100 (small scale), 100-10K (medium scale), or greater than 10K (large scale). Small scale branch considers budget, leading to either open-source solutions like Home Assistant and ThingsBoard for low budget, or cloud free tiers (AWS/Azure) for medium budget. Medium scale branch evaluates technical expertise, directing beginners to Azure IoT Central or AWS IoT Core with tutorials, advanced users to custom infrastructure with EdgeX and Kubernetes. Large scale branch assesses hosting preference between cloud (leading to enterprise cloud platforms with SLAs) or on-premise (self-hosted with custom solutions and Mainflux). Enterprise cloud path includes compliance decision for GDPR/HIPAA requiring regional data centers. Six result nodes show cost and characteristics: open-source results in teal showing low cost with full control, enterprise results in orange showing high cost with compliance guarantees.
Figure 35.1: Platform selection decision flowchart guiding developers through critical choices based on project requirements. The decision tree considers scale (device count), budget constraints, technical expertise level, internet connectivity patterns, integration needs with existing systems, and compliance requirements. For small deployments under 100 devices, open-source options like Home Assistant or Node-RED offer cost-effective solutions. Medium-scale projects (100-10K devices) benefit from managed cloud platforms with different expertise levels determining whether to use beginner-friendly options like Azure IoT Central or advanced custom infrastructure. Large deployments over 10K devices require careful evaluation of cloud versus on-premise hosting, with additional considerations for regulatory compliance (GDPR, HIPAA) potentially mandating regional cloud deployments or self-hosted solutions. The flowchart emphasizes that no single platform fits all use cases—the optimal choice depends on your specific technical and business requirements.
35.5.1 Scale Requirements
Small (< 100 devices):
Self-hosted (Home Assistant, ThingsBoard)
Minimal cloud (AWS IoT Core free tier)
Node-RED for integration
Medium (100-10,000 devices):
Cloud platforms (AWS IoT, Azure IoT)
Device management essential
Consider costs carefully
Large (> 10,000 devices):
Enterprise cloud platforms
Custom infrastructure may be cheaper
Multi-region deployment
35.5.2 Budget Considerations
Free/Low-Cost:
Open source (Home Assistant, ThingsBoard, Mainflux)
Worked Example: Choosing a Platform for 5,000 Environmental Sensors
Scenario: GreenCity deploys 5,000 air quality sensors across a metropolitan area. Each sensor sends PM2.5, NO2, temperature, and humidity readings every 5 minutes (288 messages/device/day). The city requires GDPR-compliant data storage in EU data centers. Budget: $3,000/month operational.
Step 1: Calculate message volume
Messages per month: 5,000 devices x 288 msg/day x 30 days = 43.2 million messages/month
Average payload: 150 bytes (4 readings + metadata)
Monthly data transfer: 43.2M x 150 bytes = 6.5 GB/month
Step 2: Compare 3-year total cost of ownership
Cost Component
AWS IoT Core
Azure IoT Hub (S1)
Self-Hosted ThingsBoard
Message costs
$43.20/mo ($1/M msg)
$25/mo (S1 unit: 400K msg/day) x 11 units = $275/mo
$0
Device registry
$0.08/device/mo = $400
Included in S1
$0
Compute
Lambda: ~$15/mo
Functions: ~$12/mo
2x c5.xlarge: $250/mo
Database
DynamoDB: ~$120/mo
Cosmos DB: ~$150/mo
TimescaleDB on same servers: $0
Data storage (1 yr retention)
S3: ~$8/mo
Blob: ~$8/mo
Included in compute
Monitoring
CloudWatch: ~$30/mo
Monitor: ~$25/mo
Grafana (free): ~$0
DevOps engineer time
0.1 FTE ($800/mo)
0.1 FTE ($800/mo)
0.3 FTE ($2,400/mo)
Monthly total
$1,416/mo
$1,270/mo
$2,650/mo
3-year total
$50,976
$45,720
$95,400
Step 3: Factor in hidden costs
Hidden Factor
AWS/Azure
Self-Hosted
Security patching
Managed by provider
Team responsibility (4+ hrs/month)
Scaling during events (wildfire → 10x traffic)
Auto-scales, pay per use
Manual scaling, potential data loss
GDPR compliance
EU regions available (Frankfurt, Dublin)
Full control, but audit burden on team
Disaster recovery
Built-in multi-AZ
Must configure (adds $100-200/mo)
Vendor lock-in risk
High (proprietary APIs)
None (open protocols)
Step 4: Decision at different scales
Device Count
Recommended Platform
Reasoning
< 500
ThingsBoard CE (free)
Server cost ($50/mo) < cloud fees; 0.1 FTE DevOps sufficient
500 - 10,000
Azure IoT Hub
Best price/message ratio; EU data centers; managed scaling
10,000 - 50,000
Self-hosted or hybrid
Cloud costs exceed $10K/mo; dedicated DevOps team justified
> 50,000
Custom platform
Per-message pricing is prohibitive; invest in engineering
Result for GreenCity (5,000 sensors): Azure IoT Hub at $1,270/month is within budget and provides GDPR-compliant EU hosting, automatic scaling during pollution events, and requires only 0.1 FTE DevOps. The $50K savings over 3 years vs. self-hosted justifies the vendor lock-in risk, which is mitigated by using standard MQTT and storing raw data in their own PostgreSQL database alongside Azure.
35.8 Best Practices
Four-phase IoT platform development workflow diagram showing progression from development through testing, staging, and production. Development phase (navy with teal border) branches into three parallel activities: local MQTT broker self-hosted testing, Node-RED visual prototyping, and device fleet simulation for architecture validation. These converge into Testing phase (navy with teal border) with three parallel activities: integration testing of component interactions, load testing at 100x expected scale, and security vulnerability audits. Testing converges to Staging phase (orange) with three activities: cloud platform deployment, beta fleet of 10-100 real devices, and performance monitoring with optimization. Staging flows to Production phase (teal) with three ongoing activities: gradual rollout to minimize risk, fleet management and device monitoring, and OTA updates for continuous improvement. Dotted feedback arrow from OTA updates back to Development phase shows iterative improvement cycle based on production insights.
Figure 35.2: IoT platform development workflow showing the four-phase progression from development to production. The development phase emphasizes local testing with self-hosted MQTT brokers, rapid prototyping using visual tools like Node-RED, and simulation of device fleets to validate architecture before hardware investment. Testing phase includes integration testing across components, load testing with simulated devices at 100x expected scale to identify bottlenecks, and comprehensive security audits for vulnerabilities. Staging phase deploys to the selected cloud platform with a small beta fleet of 10-100 real devices, monitoring performance and optimizing based on real-world data. Production phase implements gradual rollout to minimize risk, establishes fleet management processes, and enables over-the-air (OTA) updates with continuous monitoring. The workflow is iterative—production insights feed back into development for continuous improvement. This staged approach reduces risk, catches issues early when they’re cheaper to fix, validates scaling assumptions, and ensures robust deployment of IoT systems.
35.8.1 Multi-Cloud Strategy
Avoid complete vendor lock-in: - Use standard protocols (MQTT, HTTP) - Abstract platform-specific features - Maintain data portability - Design for migration
35.8.2 Security First
Use encrypted communication (TLS/DTLS)
Implement device authentication
Regular security updates
Principle of least privilege
Monitor for anomalies
35.8.3 Start Small, Scale Gradually
Prototype with small deployments
Validate architecture under load
Monitor costs closely
Optimize before scaling
35.8.4 Monitor and Optimize
Instrument applications
Track key metrics (latency, errors, costs)
Set up alerting
Regularly review and optimize
35.8.5 Documentation
Document architecture decisions
Maintain deployment procedures
Create runbooks for common issues
Version control configurations
35.9 Knowledge Check
Quiz: Platform Selection and Best Practices
35.10 Platform Abstraction Framework
Platform abstraction layers enable portable IoT applications that can work across multiple cloud platforms (AWS IoT, Azure IoT, Google Cloud, ThingsBoard, or custom MQTT brokers) without code changes. The key concepts include:
CloudPlatform Configuration: Define connection parameters for different platforms including endpoints, authentication credentials, and protocol settings.
Message Routing: Abstract message publishing and subscription with platform-specific topic mapping, QoS level support, and delivery guarantees.
Device Management: Unified device lifecycle management including provisioning, state tracking, firmware updates, and decommissioning across platforms.
Platform Selection: Evaluate and select optimal platforms based on requirements (device count, message throughput, latency, cost constraints) using multi-criteria scoring.
These abstractions allow developers to: - Write platform-agnostic firmware that works across clouds - Migrate between platforms without firmware changes - Test locally with custom MQTT brokers before cloud deployment - Implement multi-cloud strategies for redundancy and cost optimization
For production implementation, use platform-specific SDKs (AWS IoT SDK, Azure IoT SDK, Google Cloud IoT Core client libraries) wrapped in abstraction layers following the patterns described above.
Matching Quiz: Device Management Platforms
Ordering Quiz: Platform Selection Decision Process
Common Pitfalls
1. Publishing All Sensor Data at Maximum Rate Without Filtering
Sending raw sensor readings at maximum frequency consumes unnecessary bandwidth and storage, and can cause broker backpressure that drops messages from other devices. Apply edge-side dead-band filtering and send only meaningful updates; reserve full-rate data for local debug sessions.
2. Using a Single MQTT Topic for All Device Data
Publishing all sensor types to one flat topic prevents selective subscriptions, makes stream processing complex, and inhibits per-sensor access control. Use a structured topic hierarchy (e.g. iot/{deviceId}/{sensorType}) that enables selective consumption and per-topic ACL policies.
3. Not Designing for Device Shadow Conflicts
When multiple clients update the device shadow simultaneously without conflict resolution, the device receives contradictory desired-state updates and enters an oscillating state. Implement optimistic locking with version numbers on shadow updates and define a clear precedence order for conflicting state sources.
Label the Diagram
Code Challenge
35.11 Summary
Device management platforms (Balena, Mender) solve critical operational challenges including OTA firmware updates, remote access, fleet provisioning, and monitoring for deployed device populations
Open-source frameworks (ThingsBoard, FIWARE, Mainflux) provide self-hosted alternatives with full control and cost savings for organizations with technical expertise
Scale requirements drive platform selection: small deployments (<100) favor open-source, medium (100-10K) benefit from managed cloud, large (>10K) may justify custom infrastructure
Budget considerations range from free open-source with self-hosted infrastructure to enterprise cloud contracts exceeding $10K/month for large-scale deployments
Multi-cloud strategies using standard protocols (MQTT, HTTP) and abstraction layers prevent vendor lock-in and enable platform migration
Security-first practices including TLS encryption, device authentication, least privilege access, and regular updates are essential regardless of platform choice
Development workflows should progress from local prototyping through testing, staging with beta devices, to gradual production rollout with continuous monitoring
The power comes from declarative management - you specify desired state, platform handles reconciliation automatically.
35.13 Concept Relationships
Understanding device management connects to the broader IoT ecosystem:
Cloud IoT Platforms provide foundation - AWS IoT Core and Azure IoT Hub offer device registry, MQTT broker, and rules engine; device management platforms (Mender, Balena) add OTA and fleet management on top
Edge Computing Platforms integrate with management - AWS Greengrass and Azure IoT Edge enable local processing while syncing configuration and updates through cloud management services
Software Platforms Overview shows the stack - device management sits between cloud platforms (infrastructure) and applications (business logic)
CI/CD for IoT completes the pipeline - automated testing, firmware signing, and staged rollouts rely on device management platforms for deployment
ThingsBoard - Open-source IoT platform with device management and visualization
In 60 Seconds
This chapter covers device mgmt & platforms, explaining the core concepts, practical design decisions, and common pitfalls that IoT practitioners need to build effective, reliable connected systems.
35.15 What’s Next
If you want to…
Read this
Learn about data visualisation for connected devices