Categorize Cloud IoT Platforms: Distinguish AWS IoT Core, Azure IoT Hub, and Google Cloud alternatives by their architectural strengths
Select Appropriate Platforms: Choose cloud platforms based on scalability, integration, and cost requirements
Implement Device Connectivity: Configure MQTT connections with X.509 certificates on AWS IoT Core
Deploy Enterprise Solutions: Set up Azure IoT Hub with Digital Twins and IoT Central for Microsoft environments
Navigate Platform Migrations: Plan Google Cloud IoT Core migration paths to ClearBlade or partner solutions
Evaluate Niche Platforms: Assess IBM Watson IoT, Oracle IoT, and Alibaba Cloud for specific regional or industry needs
Calculate Platform Costs: Estimate total cost of ownership across messaging, storage, compute, and data transfer
32.2 Prerequisites
Before diving into this chapter, you should be familiar with:
IoT Reference Models: Understanding the layered IoT architecture (devices, connectivity, edge, cloud) provides context for where cloud platforms fit in the overall system design
MQTT Protocol: MQTT is the dominant messaging protocol for IoT platforms, so understanding publish/subscribe patterns, QoS levels, and broker architecture is essential for working with AWS IoT Core, Azure IoT Hub, and other platforms
Think of cloud IoT platforms like app stores + operating systems for smart devices.
Just like your phone needs iOS or Android to run apps, your IoT devices need platforms to connect, communicate, and be managed. You could build everything from scratch, but platforms give you pre-built tools—like buying a house with plumbing already installed instead of digging your own well.
Why use a cloud platform instead of building from scratch?
Building From Scratch
Using a Platform
Months to build auth system
Click “enable” for device authentication
You maintain servers
Cloud handles scaling to millions of devices
Custom security (risky)
Battle-tested, compliant security
Your code, your bugs
Pre-tested, community-supported tools
The Big Two cloud platforms (and alternatives):
Platform
Best For
Integrates Well With
AWS IoT Core
Maximum scalability
Amazon services (Lambda, S3, ML)
Azure IoT Hub
Enterprise Microsoft shops
Office 365, Teams, Power BI
ClearBlade
AI/ML-heavy applications
Google Cloud (BigQuery, Vertex AI)
Note: Google Cloud IoT Core was discontinued in August 2023. ClearBlade is Google’s recommended migration path.
Real-world analogy: Building an IoT system without a platform is like opening a restaurant and also farming your own vegetables, building your own stove, and manufacturing your own plates. Platforms let you focus on your unique “recipe” (application) while they handle the infrastructure.
Sensor Squad: The Cloud Connection
“Once your IoT device collects data, where does it go?” asked Max the Microcontroller. “To the cloud! Cloud platforms like AWS IoT Core and Azure IoT Hub are giant, always-on computers that receive data from millions of devices, store it, analyze it, and let you build dashboards and alerts.”
Sammy the Sensor asked how it works. “I send my temperature reading via MQTT to the cloud platform. It authenticates me with a certificate to make sure I am a real sensor and not a hacker. Then it routes my data to a database, triggers an alert if the temperature is too high, and updates a real-time dashboard that the building manager watches on their phone.”
Lila the LED compared the big platforms. “AWS IoT Core is the most popular – it scales to billions of messages and integrates with all Amazon services. Azure IoT Hub is great if your company already uses Microsoft tools like Office 365 and Power BI. Google shut down their IoT Core service, so ClearBlade is the recommended alternative for Google Cloud users.” Bella the Battery raised a practical concern. “Cloud platforms charge per message and per device. For a few hundred sensors, it is very affordable. For millions of devices sending data every second, the costs add up fast. Always estimate your cloud bill before committing to a platform!”
Key Concepts
Microcontroller Unit (MCU): Integrated circuit combining CPU, RAM, flash, and peripherals optimised for embedded control applications.
Microprocessor Unit (MPU): High-performance processor requiring external RAM, storage, and peripherals, used in Linux-based IoT devices like Raspberry Pi.
Schematic: Electrical diagram showing component connections using standardised symbols, used to guide PCB layout.
PCB (Printed Circuit Board): Fiberglass substrate with etched copper traces connecting electronic components into a permanent assembly.
ESD Protection: Diodes and resistors protecting sensitive IC pins from electrostatic discharge during handling and in-field use.
Decoupling Capacitor: Small capacitor placed close to IC power pins to suppress high-frequency noise on the supply rail.
Design Rule Check (DRC): Automated PCB verification ensuring trace widths, clearances, and drill sizes meet the fabrication process constraints.
32.3 Introduction
IoT systems consist of distributed components spanning devices, gateways, cloud services, and applications. Cloud IoT platforms provide the infrastructure and tools to connect, manage, process, and analyze data from these distributed components. Unlike traditional software development where applications run on predictable hardware, IoT platforms must handle heterogeneous devices, unreliable networks, massive scale, and real-time processing requirements.
Definition
Cloud IoT Platforms are integrated collections of cloud services, APIs, and tools that provide infrastructure for connecting devices, processing data, managing fleets, and building applications. Platforms abstract complexity, enable rapid development, and provide enterprise-grade reliability, security, and scalability.
32.3.1 Why Cloud Platforms Matter
Accelerated Development: Platforms provide pre-built services (authentication, device management, data storage) that would take months to build from scratch.
Scalability: Cloud platforms handle infrastructure scaling automatically, from tens to millions of devices.
Three-column comparison diagram showing IoT software stack architectures for AWS, Azure, and open-source platforms. Each column displays four layers from top to bottom. AWS column: Application layer with Lambda, S3, and Analytics (orange); Platform layer with IoT Core and Device Management; Edge layer with Greengrass Runtime; Device layer with AWS IoT SDK and MQTT. Azure column: Application layer with Functions and Digital Twins (orange); Platform layer with IoT Hub and IoT Central; Edge layer with IoT Edge Containers; Device layer with Azure IoT SDK and AMQP. Open Source column: Application layer with Custom Apps and Node-RED (teal); Platform layer with ThingsBoard and FIWARE; Edge layer with EdgeX Foundry; Device layer with standard MQTT and CoAP protocols. Arrows flow downward within each stack showing layer dependencies.
Figure 32.1: IoT software stack comparison showing the four-layer architecture across AWS (enterprise cloud), Azure (Microsoft ecosystem), and open-source platforms. Each stack provides application services at the top, platform services for device management and connectivity, edge computing runtime for local processing, and device-level SDKs or protocols at the bottom. AWS emphasizes Lambda and analytics integration, Azure focuses on Digital Twins and enterprise tools, while open-source platforms offer flexibility through standard protocols and self-hosted options.
Alternative View: Platform Selection Decision Tree
Figure 32.2: This decision tree guides architects from their main constraint (scale, enterprise integration, analytics, control, or simplicity) to appropriate platform choices with cost implications highlighted.
32.5 AWS IoT Core
Description: Amazon’s managed cloud platform for connecting IoT devices to AWS services.
Integration with Microsoft ecosystem (Office 365, Power BI, Dynamics)
IoT Central for rapid prototyping
Strong enterprise support
Hybrid cloud capabilities
Limitations:
Azure ecosystem dependency
Pricing complexity
Some services still maturing
Typical Use Cases:
Enterprise and industrial IoT
Smart buildings
Predictive maintenance
Healthcare IoT
32.7 Google Cloud IoT
Description: Google’s IoT platform with strengths in data analytics and machine learning.
32.7.1 Core Services
Cloud IoT Core (deprecated as of August 2023): Note: Google has deprecated Cloud IoT Core. Users must migrate to partners or self-managed solutions.
Alternatives:
Self-managed MQTT brokers on Google Cloud
Partner solutions (Leverege, Litmus, etc.)
Google Cloud Pub/Sub for messaging
BigQuery for analytics
Vertex AI for machine learning
32.7.2 Migration Pattern
from google.cloud import pubsub_v1import json# Publish to Pub/Sub instead of IoT Coreproject_id ="my-project"topic_name ="iot-telemetry"publisher = pubsub_v1.PublisherClient()topic_path = publisher.topic_path(project_id, topic_name)data = json.dumps({"temperature": 22.5, "humidity": 65})future = publisher.publish(topic_path, data.encode("utf-8"))print(f"Published message ID: {future.result()}")
32.7.3 Strengths and Limitations
Strengths:
Best-in-class data analytics (BigQuery)
Strong ML capabilities (Vertex AI)
Global infrastructure
Kubernetes integration (GKE)
Limitations:
Deprecated IoT Core (requires migration)
Requires more self-management
Smaller IoT-specific ecosystem
Typical Use Cases:
Data-intensive IoT applications
ML-driven insights
Connected vehicles
Smart cities (analytics focus)
32.8 Other Cloud Platforms
IBM Watson IoT:
Enterprise focus
Strong integration with IBM AI
Blockchain integration
Deprecated in favor of Maximo Application Suite
Oracle IoT:
ERP/supply chain integration
Asset monitoring
Fleet management
Enterprise focus
Alibaba Cloud IoT:
Strong in Asia-Pacific
Manufacturing and logistics
Link Platform for device management
Edge computing support
Worked Example: Migrating 10,000 Smart Home Sensors from Wi-Fi to Cloud MQTT
Scenario: A smart home startup has 10,000 deployed temperature/humidity sensors currently using custom Wi-Fi firmware that polls a REST API every 60 seconds. The server infrastructure is struggling with connection overhead, and users report frequent device disconnections. The engineering team decides to migrate to AWS IoT Core with MQTT.
Given:
Current: HTTP POST every 60 seconds, TCP connection reestablished each time
Each sensor payload: 45 bytes JSON (temperature, humidity, battery, timestamp)
Network: Home Wi-Fi, average latency 25ms, 2% packet loss
Current server: 4× EC2 instances handling HTTP polling
Target: AWS IoT Core with persistent MQTT connections
Migration Steps:
Calculate current energy consumption per device:
Wi-Fi active time per cycle (HTTP):
- Connection setup: 3-way handshake + TLS = 8 round-trips = 200ms
- HTTP POST request/response: 50ms
- Connection teardown: 50ms
Total: 300ms @ 180mA = 54 mAs per cycle
Daily energy: (54 mAs × 1440 cycles) + (10 µA × 86,400s sleep)
= 77,760 mAs + 864 mAs = 78,624 mAs = 21.8 mAh/day
Battery life (2000 mAh): 2000/21.8 = 92 days
Calculate MQTT energy consumption:
Initial connection (once):
- MQTT CONNECT + TLS: 250ms @ 180mA = 45 mAs (amortized)
Per publish (persistent connection):
- MQTT PUBLISH: 5ms @ 180mA = 0.9 mAs
Daily energy: 45 mAs (connect) + (0.9 mAs × 1440) + (10 µA × 86,400s)
= 45 + 1,296 + 864 = 2,205 mAs = 0.61 mAh/day
Battery life (2000 mAh): 2000/0.61 = 3,279 days ≈ 9 years!
Cost analysis:
Current infrastructure:
- EC2 instances: 4 × $50/month = $200/month
- Load balancer: $25/month
- Data transfer: 10K devices × 45 bytes × 1440/day = 648 MB/day
Total: ~$250/month
AWS IoT Core pricing (us-east-1):
- Connectivity: $0.08 per million minutes connected
- Messaging: $1.00 per million messages
Per month:
- Connectivity: 10K × 43,200 min = 432M min × $0.08 = $34.56
- Messages: 10K × 43,200 = 432M msg × $1.00 = $432
- Data transfer (negligible): ~$1
Total: ~$468/month
Phased rollout strategy:
Week 1-2: Beta test with 100 devices (1%)
- Firmware OTA to beta group via existing HTTP update mechanism
- Monitor: connection stability, message delivery rate, battery impact
- Validate: AWS IoT Rules Engine integration with downstream Lambda
Week 3-4: Expand to 1,000 devices (10%)
- If beta successful, expand gradually
- Run dual-stack: devices report via MQTT, fallback to HTTP if issues
Week 5-8: Full rollout (100%)
- Roll out in batches of 2,500 per week
- Decommission HTTP endpoints 2 weeks after last device migrates
Unexpected challenges discovered:
Issue 1: NAT gateway timeout
- Problem: Some routers close idle MQTT connections after 5 minutes
- Solution: MQTT keepalive set to 120 seconds (2 minutes)
- Trade-off: Battery impact minimal (5 byte ping packet = 0.5 mAs)
Issue 2: Certificate provisioning
- Problem: Pre-burning certs in factory is inflexible
- Solution: Fleet provisioning with claim certificates
- Devices register themselves on first boot, receive unique cert
Issue 3: Shadow state cost
- Problem: Device shadows incur additional message costs
- Solution: Only use shadows for user-facing attributes (setpoint)
- Telemetry goes direct to rules engine → Timestream database
Result: Migration succeeded with 36× battery life improvement (92 days → 9 years theoretical, 4-5 years real-world with Wi-Fi keepalive overhead). Server infrastructure simplified from 4 EC2 instances + custom code to fully managed AWS IoT Core. Cost increased 87% ($250 → $468/month), but customer satisfaction improved dramatically due to instant device status updates and elimination of polling disconnections. The battery life improvement allowed the company to switch from yearly battery replacement model to “install and forget” 5-year lifespan, reducing support costs by $15 per device over lifetime ($150K total savings for 10K devices).
Putting Numbers to It
The energy savings from persistent MQTT vs HTTP polling stem from connection overhead. HTTP requires a full TCP handshake (3 packets) plus TLS negotiation (6-8 packets) for each request:
\[
E_{\text{HTTP}} = 180\text{ mA} \times 0.3\text{ s} = 54\text{ mAs} = 0.015\text{ mAh per message}
\]
MQTT with persistent connection sends a 5-byte packet without handshake overhead:
\[
E_{\text{MQTT}} = 180\text{ mA} \times 0.005\text{ s} = 0.9\text{ mAs} = 0.00025\text{ mAh per message}
\]
At 1440 messages per day, HTTP consumes \(1440 \times 0.015 = 21.6\) mAh/day while MQTT uses \(1440 \times 0.00025 = 0.36\) mAh/day – a 60× reduction. This explains the 92-day → 9-year improvement (ignoring keepalive overhead).
Key Takeaway: Cloud IoT platforms shine when you need massive scale with persistent connections. The upfront cost increase pays for itself through reduced operational overhead and dramatically improved customer experience. MQTT’s lightweight protocol reduces device energy consumption by 97% compared to HTTP polling, transforming battery life from “annoying” to “acceptable.”
32.8.1 Interactive Calculator: HTTP vs MQTT Energy Comparison
Show code
viewof http_connection_time = Inputs.range([50,500], {value:300,step:10,label:"HTTP connection time per cycle (ms)"})viewof mqtt_publish_time = Inputs.range([1,20], {value:5,step:0.5,label:"MQTT publish time (ms)"})viewof wifi_current = Inputs.range([50,250], {value:180,step:10,label:"Wi-Fi active current (mA)"})viewof sleep_current = Inputs.range([1,50], {value:10,step:1,label:"Sleep current (µA)"})viewof publish_interval = Inputs.range([10,300], {value:60,step:10,label:"Publish interval (seconds)"})viewof battery_capacity = Inputs.range([500,5000], {value:2000,step:100,label:"Battery capacity (mAh)"})
Existing investment: 80% of infra on AWS (Lambda, S3, DynamoDB) ✓
Analytics: IoT Analytics + SageMaker for ML ✓
Device management: Need OTA firmware updates (AWS IoT Jobs) ✓
Decision: AWS IoT Core - Best fit with 5/5 factors aligned. Azure would require rewriting Lambda functions to Azure Functions, migrating DynamoDB to Cosmos DB, and retraining team on new toolchain (estimated 6-month delay + $200K migration cost).
Common Mistake: Ignoring MQTT QoS Trade-offs for Battery-Powered Devices
The Mistake: Developers use MQTT QoS 1 (at least once delivery) for all messages by default, assuming “reliable delivery” is always best practice. For a fleet of 50,000 battery-powered temperature sensors, this causes 3× faster battery drain than necessary.
Why It’s Wrong:
MQTT Quality of Service levels have dramatically different energy costs:
For a temperature sensor transmitting every 60 seconds:
QoS 0: 0.9 mAs/msg × 1440 msgs/day = 1,296 mAs = 0.36 mAh/day
→ Battery life (2000 mAh): 5,556 days = 15.2 years
QoS 1: 1.8 mAs/msg × 1440 msgs/day = 2,592 mAs = 0.72 mAh/day
→ Battery life (2000 mAh): 2,778 days = 7.6 years
QoS 2: 3.6 mAs/msg × 1440 msgs/day = 5,184 mAs = 1.44 mAh/day
→ Battery life (2000 mAh): 1,389 days = 3.8 years
Using QoS 1 instead of QoS 0 cuts battery life in HALF. QoS 2 reduces it to 25%.
When to Use Each QoS Level:
QoS Level
Appropriate Use Cases
Inappropriate Use Cases
QoS 0
Environmental monitoring (temperature, humidity, air quality), periodic telemetry where occasional loss is acceptable, high-frequency data where individual sample loss is tolerable
# Temperature telemetry - QoS 0 (loss is acceptable, next reading in 60s)client.publish("sensors/temp", payload, qos=0)# Low battery alert - QoS 1 (must be delivered, but duplicate is okay)if battery_pct <15: client.publish("alerts/battery", payload, qos=1)# Firmware update command - QoS 2 (must be delivered exactly once)if firmware_update_available: client.publish("commands/ota", payload, qos=2)
Cost-Benefit Analysis:
For a 50,000-device fleet transmitting every 60 seconds:
Metric
QoS 0
QoS 1
Savings
Battery life
7.6 years
3.8 years
2× longer
Maintenance cost
$5 per battery replacement × 50K devices ÷ 7.6 years = $33K/year
$66K/year
$33K/year saved
Message reliability
99.9% delivered (AWS IoT Core over Wi-Fi)
99.99% delivered
0.09% improvement
Latency
10ms avg
30ms avg
3× faster
Key Insight: For non-critical telemetry, the 0.09% reliability improvement from QoS 1 does NOT justify cutting battery life in half. Use QoS 0 by default, and only upgrade to QoS 1 for messages where loss would cause user-visible problems (alerts, commands, state changes). Reserve QoS 2 for truly critical operations like firmware updates and billing data.
Validation: After switching 80% of telemetry from QoS 1 to QoS 0, the same manufacturing company measured: - Average battery life: 3.2 years → 6.1 years (91% improvement) - Message loss rate: 0.05% (5 out of 10,000 messages) - interpolated by backend - Operational savings: $180K over 5 years (reduced battery replacement visits) - No customer complaints about data gaps (backend interpolation handled the 0.05% loss)
32.8.3 Interactive Calculator: MQTT QoS Battery Life Comparison
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
32.10 Summary
AWS IoT Core provides comprehensive managed infrastructure with deep integration into Amazon’s ecosystem (Lambda, S3, DynamoDB), making it ideal for enterprise-scale deployments requiring maximum scalability
Azure IoT Hub offers strong enterprise integration with Microsoft services (Office 365, Power BI, Dynamics) and provides Azure IoT Central for rapid no-code/low-code prototyping
Google Cloud IoT Core has been deprecated (August 2023), requiring migration to partner solutions like ClearBlade or self-managed MQTT brokers, though GCP’s analytics (BigQuery) and ML (Vertex AI) remain strong
Cloud platform selection depends on existing infrastructure investments, scale requirements, integration needs, and strategic priorities around vendor lock-in
All major platforms support standard MQTT protocol, enabling portable device firmware that can work across clouds with configuration changes
Vendor lock-in primarily occurs at the cloud services layer (functions, databases, rules engines), not at the device communication layer
Cloud updates desired state (e.g., set update interval to 60 seconds)
Device receives state change notification, updates configuration
Device reports new state back to platform (confirmation of change)
The power of cloud platforms comes from handling undifferentiated heavy lifting - connection management, authentication, message routing, and storage - letting developers focus on business logic.
32.12 Concept Relationships
Understanding cloud IoT platforms connects to several foundational IoT concepts:
IoT Reference Models shows where platforms fit - cloud platforms operate at the connectivity and platform layers, managing device-to-cloud communication and providing services for analytics and applications
MQTT Protocol is the dominant transport - all major platforms use MQTT for device messaging, so understanding QoS levels, publish/subscribe, and broker behavior is essential
Application Frameworks complement cloud platforms - Node-RED and Home Assistant provide visual programming for prototyping, while cloud platforms provide production-scale infrastructure
Edge Computing Platforms extend cloud to devices - AWS Greengrass and Azure IoT Edge run cloud services locally while syncing with cloud platforms
Device Management addresses fleet operations - OTA updates, configuration management, and device lifecycle span both cloud platforms and dedicated tools
Cloud platforms enable rapid development through managed services but introduce vendor lock-in - design abstractions carefully to maintain portability.
Device Security - Certificate management, secure boot, and firmware signing
In 60 Seconds
Connecting IoT prototypes to cloud platforms involves configuring MQTT or HTTP endpoints, handling authentication, and designing data schemas that support the analytics and alerting features planned for the production system.
32.14 What’s Next
If you want to…
Read this
Learn about data visualisation for connected devices