Note (2025): Google Cloud IoT Core was discontinued in August 2023. Google recommends ClearBlade as the migration path for IoT device management. Google Cloud services like Pub/Sub, BigQuery, and Vertex AI remain available for data processing and analytics.
275.4 AWS IoT Core vs Azure IoT Hub
WarningTradeoff: AWS IoT Core vs Azure IoT Hub
Option A (AWS IoT Core): Largest IoT ecosystem with 200+ integrated services. Pricing at $1.00 per million messages plus $0.08 per million connection-minutes. Best-in-class rule engine with SQL-like filtering. Free tier: 250,000 messages/month for 12 months.
Option B (Azure IoT Hub): Tightest integration with Microsoft ecosystem (Active Directory, Power BI, Dynamics 365). Tier-based pricing starting at $10/month (S1: 400,000 messages/day). Built-in device twin synchronization. Superior hybrid cloud support with Azure Stack.
Decision Factors:
Choose AWS when: Your team has AWS experience, you need maximum service breadth (200+ services), cost optimization at scale is critical, or you require advanced rule engine capabilities.
Choose Azure when: Your organization uses Microsoft 365, Active Directory, or Dynamics 365, you need hybrid on-premises deployment, or predictable tier-based pricing is preferred for budgeting.
Cost comparison at scale: 100,000 devices sending 10 messages/day = 30M messages/month. AWS: ~$462/month. Azure S2: ~$400/month. At this scale, Azure is 13% cheaper with predictable costs.
Show code
{const container =document.getElementById('kc-platforms-1');if (container &&typeof InlineKnowledgeCheck !=='undefined') { container.innerHTML=''; container.appendChild(InlineKnowledgeCheck.create({question:"A company is selecting between AWS IoT Core and Azure IoT Hub for 50,000 connected vehicles. Their existing infrastructure uses Microsoft Active Directory for identity management, Power BI for dashboards, and Dynamics 365 for fleet operations. Message volume is 30 million messages per month. Which platform should they choose?",options: [ {text:"AWS IoT Core - it has 200+ integrated services",correct:false,feedback:"While AWS has the largest ecosystem, the company's existing Microsoft investments mean Azure would provide better integration with less effort."}, {text:"Azure IoT Hub - tighter integration with existing Microsoft ecosystem",correct:true,feedback:"Correct! Azure integrates natively with Active Directory, Power BI, and Dynamics 365. This reduces integration work by weeks."}, {text:"Google Cloud IoT - best ML/AI integration",correct:false,feedback:"Google Cloud IoT Core was discontinued in August 2023."}, {text:"Self-hosted EMQX - avoid vendor lock-in",correct:false,feedback:"At 30M messages/month, managed services are still cost-effective and preserve the Microsoft integrations."} ],explanation:"Platform selection should consider total cost of ownership including integration effort. Azure's native integration with Microsoft services provides single sign-on via Azure AD, direct Power BI dashboards, and Dynamics 365 fleet management connectors.",difficulty:"medium",topic:"cloud-platform-selection" })); }}
275.5 Managed Services vs Self-Hosted
WarningTradeoff: Managed IoT Services vs Self-Hosted Open Source
Option A (Managed Services): AWS IoT Core, Azure IoT Hub, or HiveMQ Cloud. Zero infrastructure management, automatic scaling, 99.9% SLA, pay-per-use pricing.
Option B (Self-Hosted): EMQX, Mosquitto, or VerneMQ on your own infrastructure. Full control, no per-message fees, data sovereignty guaranteed. Requires DevOps expertise and 24/7 operations.
Decision Factors:
Choose Managed Services when: Team lacks Kubernetes/infrastructure expertise, time-to-market is critical, device count is under 100,000, or you need global distribution without building multi-region infrastructure.
Choose Self-Hosted when: Message volume exceeds 100M/month where managed pricing becomes prohibitive, regulatory requirements mandate data residency on specific infrastructure, or custom protocol extensions are needed.
Break-even calculation: At 50M messages/month, AWS IoT Core costs ~$50. Self-hosted EMQX on 3x m5.large ($210/month) handles 500M messages/month. Self-hosted becomes cheaper above 200M messages/month, but add DevOps engineer time.
Figure 275.1: Message broker selection flowchart for IoT use cases.
275.8 MQTT Broker Comparison
Broker
Connections
Throughput
Clustering
License
Mosquitto
100K
50K msg/s
Bridge only
EPL/EDL
EMQX
1M+
1M+ msg/s
Native
Apache 2.0
HiveMQ
10M+
1M+ msg/s
Native
Commercial
VerneMQ
1M+
500K msg/s
Native
Apache 2.0
275.9 QoS Trade-offs
QoS Level
Delivery
Broker CPU
Latency
Use Case
QoS 0
At most once
Low
Lowest
Telemetry, non-critical
QoS 1
At least once
Medium
Medium
Commands, events
QoS 2
Exactly once
High
Highest
Financial, safety-critical
Rule of thumb: 90% of IoT traffic should use QoS 0 or QoS 1. QoS 2 overhead is significant.
275.10 Capacity Planning Example
Scenario: Smart city with 500,000 parking sensors
Requirements:devices: 500,000message_rate: 2 msg/device/hour (state changes)message_size: 128 bytes (JSON payload)peak_multiplier: 5x (morning/evening rush)Calculations:avg_throughput: 500,000 x 2 / 3600 = 278 msg/secpeak_throughput: 278 x 5 = 1,390 msg/secbandwidth: 1,390 x 128 = 178 KB/sec = 1.4 Mbps # Session memory (persistent sessions)session_memory: 500,000 x 2 KB = 1 GBRecommendation:technology: EMQX cluster (3 nodes)node_spec: 8 vCPU, 16 GB RAM, SSDestimated_cost: ~$500/month (cloud VMs)Alternative:technology: AWS IoT Corepricing: $1.00 per million messages + $0.08 per million minutesestimated_cost: ~$1,728/month
Show code
{const container =document.getElementById('kc-platforms-2');if (container &&typeof InlineKnowledgeCheck !=='undefined') { container.innerHTML=''; container.appendChild(InlineKnowledgeCheck.create({question:"A smart city deploys 500,000 parking sensors that report state changes approximately 2 times per hour. The team needs to store 90 days of historical data for analytics and replay past events for debugging. Peak message rate during rush hour is 5x average. Which message broker architecture is most appropriate?",options: [ {text:"Single Mosquitto instance - simple and lightweight",correct:false,feedback:"Mosquitto is excellent for small deployments (<10K devices) but lacks native clustering and cannot handle 500K devices."}, {text:"EMQX cluster (3 nodes) for device connectivity + Kafka for analytics pipeline",correct:true,feedback:"Correct! EMQX cluster handles 500K persistent MQTT connections. Kafka stores 90 days of events with replay capability. This separates device protocol (MQTT) from analytics storage (Kafka)."}, {text:"AWS IoT Core only - managed service handles all requirements",correct:false,feedback:"AWS IoT Core is excellent for connectivity but doesn't provide 90-day message replay natively. You'd need to add Kinesis or Kafka anyway."}, {text:"RabbitMQ cluster - supports MQTT and has good persistence",correct:false,feedback:"RabbitMQ supports MQTT via plugin but handles ~50K connections vs. EMQX's 1M+. It's not optimized for IoT scale."} ],explanation:"This architecture follows the 'Edge MQTT + Cloud Kafka' pattern: EMQX for MQTT 5.0 with session persistence, Kafka for 90-day event retention and replay.",difficulty:"hard",topic:"message-queue-architecture" })); }}
Best for: Global deployments with regional data sovereignty
Publish-Subscribe Pattern
Figure 275.2: Publish-subscribe pattern enabling decoupled IoT device communication
TipMinimum Viable Understanding: Message Queuing for IoT
Core Concept: A message queue is an intermediary buffer that decouples message producers (IoT devices) from consumers (backend services), enabling asynchronous communication where senders and receivers operate independently.
Why It Matters: IoT devices send data in bursts while backend systems process at constant rates. Message queues absorb traffic spikes, handle network interruptions gracefully, and enable system components to fail independently.
Key Takeaway: Choose MQTT brokers for device-to-cloud pub/sub (Mosquitto for <10K devices, EMQX for 10K-1M), Kafka for high-throughput analytics requiring replay, and managed services when operational simplicity matters more than cost.
275.12 Summary
This chapter covered cloud IoT platforms and message queues:
Platform Selection: AWS for breadth, Azure for Microsoft integration
Managed vs Self-Hosted: Break-even around 200M messages/month
Message Broker Types: MQTT for devices, Kafka for analytics
QoS Levels: 90% of traffic should use QoS 0 or 1
Capacity Planning: Calculate connections, throughput, and memory requirements
275.13 Further Reading
Mell, P., & Grance, T. (2011). “The NIST Definition of Cloud Computing.” NIST Special Publication 800-145.
Botta, A., et al. (2016). “Integration of Cloud computing and Internet of Things: A survey.” Future Generation Computer Systems, 56, 684-700.
Gubbi, J., et al. (2013). “Internet of Things (IoT): A vision, architectural elements, and future directions.” Future Generation Computer Systems, 29(7), 1645-1660.
275.14 What’s Next?
You’ve completed the cloud computing series. Continue with: