Mechanical Engineering (University) is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Cloud platforms for IoT

Cloud platforms for IoT are managed services that collect, ingest, process, store and expose IoT device data and provide device management, security, and application integration — engineers pick a platform by balancing protocols, scalability, latency, cost and management features.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Cloud platforms let many IoT devices send data to a central managed service where engineers can process, store and analyze that data. For system designers, the cloud choice determines supported protocols, scalability, cost model, latency, security features and how easy it is to integrate analytics and apps.

Key ideas

Start with clear definitions (I define each bold term before using it):

  • Cloud platform: a managed collection of networked services (compute, storage, messaging, management) provided over the internet that developers use to run applications without owning the physical infrastructure. Assumption: internet connectivity exists between devices (or gateways) and the platform.

  • IoT cloud platform: a cloud platform specialized for IoT needs: device connectivity (protocol adaptors), device lifecycle management, message ingestion, data routing, storage, stream processing and integration with analytics. Assumption: devices may be constrained (battery, CPU, memory) so platform often supports light protocols like MQTT and CoAP.

  • Protocol adapter / broker: software that accepts messages over standard protocols (define MQTT later) and routes them into cloud services.

  • Message broker: a service that receives messages from devices, applies access control and delivers to consumers (rules, storage, queues). The broker can be topic-based or queue-based.

  • Device twin / device shadow: a cloud-side JSON document that stores the last known reported state of a device and desired target state. Different clouds use different names (Azure: Device Twin; AWS: Device Shadow). Assumption: desire for synchronization between cloud and device that may be offline. Related: a device provisioning service automates secure, at-scale enrollment and bootstrap of device identities/credentials (e.g., Azure DPS; AWS IoT Just-In-Time Provisioning/Registration).

  • Ingestion: the process of receiving and validating messages, then routing them to storage, queues, or processing.

  • Edge gateway: a local device that translates between local devices (maybe using Zigbee, BLE) and the cloud, performing protocol conversion, local buffering and optionally edge analytics.

  • PaaS (Platform as a Service): cloud model where vendor supplies managed runtime and platform components (messaging, DB) and customer deploys apps. Assumption: less infra work for developer.

  • IaaS (Infrastructure as a Service): cloud model where vendor provides virtual machines, storage and networking; customer manages OS and middleware.

  • FaaS (Function as a Service) / serverless: short-lived functions triggered by events (messages) used for lightweight processing without managing servers.

  • Multi-tenant: single service instance serves multiple customers while isolating data and control.

  • QoS (Quality of Service) for MQTT: numerical level describing delivery guarantees (0 = at most once, 1 = at least once, 2 = exactly once). Define MQTT: Message Queuing Telemetry Transport — a lightweight publish/subscribe protocol designed for constrained devices.

Important capabilities to compare between platforms (state exact definitions):

  • Supported protocols: list of network protocols the platform accepts (example: MQTT, HTTPS/REST, WebSockets, AMQP, CoAP). Commonly includes MQTT and HTTPS on major platforms.
  • Scalability: ability to increase number of connected devices and message throughput. Can be described as maximum concurrent connections and messages per second under autoscaling assumptions.
  • Ingress throughput and egress throughput: data rate into and out of the platform (bits/s). Measure under a specific SLA.
  • Message retention and storage classes: how long raw messages and processed data are stored and at what cost.
  • Edge integration: whether the platform provides edge runtime to run logic close to devices.
  • Security features: per-device credentials, X.509 client certificates (mutual TLS) or symmetric keys, TLS transport, IAM/authorization policies for access control and credential rotation.

Architecture diagram to draw in an exam answer (draw this):

  • Draw left-to-right layered boxes: "Devices" (label some sensors and say constrained), arrow to "Gateway (optional)" (label protocol translation), arrow to "Cloud Ingestion / Broker" (label MQTT/HTTPS), arrow to two boxes under it: "Stream Processing / Rules Engine" and "Storage (Time-series DB / Blob)". From processing arrow to "Analytics / ML" and to "Application / Dashboard". Label arrows with "messages", "events". Also show a dashed arrow from cloud to device labeled "Device Twin update / Command".

Assumptions behind this architecture: network connectivity exists, gateways can buffer during outages, cloud will scale horizontally.

Vendor-specific terms (define):

  • IoT Hub: (Azure) managed entry point for device messages and device twins.
  • IoT Core: (AWS) managed MQTT/HTTP ingress with device shadows and rules engine. Note: vendor names vary in detail; verify exact feature mapping before quoting in your exam answer.

Design trade-offs to state precisely:

  • Choose serverless (FaaS) for event-driven small processing (stateless) to reduce operational overhead; use PaaS if you need persistent services or more control.
  • Push vs pull: pushing telemetry reduces cloud-side polling and is usually more efficient on constrained uplinks; pulling (devices polling cloud) can be simpler through restrictive firewalls/NAT but increases overhead and latency.
  • Retention vs cost: storing raw telemetry long-term increases cost; store aggregated/processed data for long retention.

Formulas

Total_ingress_rate_bits_per_s = payload_size_bytes × 8 × messages_per_s_per_device × number_of_devices — payload_size_bytes (B), messages_per_s_per_device (s^-1), result in bits per second (bit/s). Applies when messages are uniform and independent.

Daily_data_volume_bytes = payload_size_bytes × messages_per_day_per_device × number_of_devices — result in bytes (B). Use this to estimate storage and egress.

Monthly_storage_GB = Daily_data_volume_bytes × retention_days / (10^9) — storage in GB (SI GB = 10^9 bytes). Apply when only raw messages stored and no compression.

Monthly_message_cost = (total_messages_per_month / 10^6) × cost_per_million_messages — currency unit (e.g., USD). Apply if provider charges per million messages.

Estimated_latency ≈ (network_RTT/2) + broker_processing_time + serverless_startup_time — latency in seconds. Define network_RTT as round-trip time (s); broker_processing_time in s; serverless_startup_time in s (cold start may add hundreds of ms).

If using binary to bits conversion remember: 1 byte = 8 bits.

Worked examples

  1. Bandwidth and daily volume for simple telemetry Problem: 1000 devices each send 1 message every minute. Each message payload is 50 bytes. Find average ingress bandwidth (bits/s) and daily data volume (MB). Steps:
  1. Message rate per device = 1 per 60 s = 1/60 s^-1.
  2. Total messages per second = 1000 × (1/60) = 1000/60 = 16.6666667 s^-1.
  3. payload_size_bytes = 50 B. Convert to bits: 50 × 8 = 400 bits.
  4. Total_ingress_rate_bits_per_s = 400 × 16.6666667 = 6666.66668 bit/s ≈ 6.667 kb/s.
  5. Daily messages = 1000 × 1440 = 1,440,000 messages (since 1440 minutes/day).
  6. Daily data bytes = 1,440,000 × 50 B = 72,000,000 B.
  7. Convert to MB (SI): 72,000,000 / 10^6 = 72 MB. Answer: Average ingress ≈ 6.667 kb/s (kilobits per second), daily volume ≈ 72 MB.
  1. Simple monthly cost estimate using per-message and storage pricing Problem: 5000 devices, each sends 144 messages/day (one every 10 min). Payload 100 bytes. Assume provider charges $0.10 per million messages ingested and $0.02 per GB-month for storage. Retain raw telemetry for 30 days. Compute monthly message cost and storage cost. Steps:
  1. Messages per day = 5000 × 144 = 720,000 messages/day.
  2. Messages per month (30 days) = 720,000 × 30 = 21,600,000 messages/month.
  3. Message cost = (21,600,000 / 1,000,000) × $0.10 = 21.6 × $0.10 = $2.16.
  4. Total bytes = 21,600,000 × 100 B = 2,160,000,000 B = 2.16 GB (SI).
  5. Storage cost = 2.16 × $0.02 = $0.0432.
  6. Total monthly = $2.16 + $0.0432 = $2.2032 ≈ $2.20. Answer: Monthly ingestion ≈ $2.16, storage ≈ $0.043, total ≈ $2.20 (example prices used — verify against real vendor prices).
  1. Model-answer: Design a cloud architecture for 200 temperature sensors sending a reading every minute, requiring a dashboard and 1-year retention with alerts when temperature > threshold. Model answer (exam style):
  • Connectivity: Devices use MQTT to the cloud broker (reason: lightweight pub/sub). If devices lack internet, use an edge gateway with cellular/Wi‑Fi.
  • Ingestion: Use IoT cloud broker (supports MQTT) with per-device authentication (X.509 or per-device symmetric keys). Define device twin to store desired sampling rate and firmware version.
  • Processing: Use a rules engine to filter messages. For each telemetry message, evaluate if temperature > threshold; if true, send an alert to a notification service (email/SMS) and store as high-priority event.
  • Storage: Raw telemetry can be stored in object storage (compressed daily files) and time-series DB for quick queries (last 30 days); archive older data to colder storage for 1-year retention.
  • Dashboard and alerts: Expose processed metrics via API Gateway to a web dashboard; integrate with push notifications.
  • Security: TLS for transport, per-device credentials, role-based access control for dashboards, logging and auditing.
  • Scalability and cost control: Aggregate messages every minute in gateway for network efficiency; use serverless functions for per-message logic to reduce idle costs. Use retention policy to move older data to cheaper storage. Diagram to draw: Devices -> MQTT Broker -> Rules Engine -> (Storage / Alert Service / Time-series DB) -> Dashboard.

Explain choices and trade-offs, and include QoS=1 if network is unreliable (at least once delivery).

Common mistakes

  • Wrong unit conversions: using 1 MB = 1024^2 bytes interchangeably with 10^6 bytes without stating which convention.
  • Ignoring metadata and protocol overhead: calculating bandwidth with only payload bytes (but MQTT has header bytes, TLS overhead) — mention overhead for accurate production planning.
  • Assuming unlimited scalability without noting throttling limits or quotas.
  • Omitting security (per-device auth) when designing examples — this loses marks in exams.

For your exam

Kinds of questions you will see:

  • Definitions and short answers (define cloud platform, device twin, MQTT broker).
  • Block diagrams (draw an IoT ingestion and processing pipeline and label components).
  • Comparisons and trade-offs (PaaS vs IaaS vs FaaS for IoT workloads).
  • Numerical problems (bandwidth, storage, cost estimates using given rates).
  • Long design question (design an IoT cloud solution for given scale and requirements).

What a full-marks answer includes:

  • Clear definitions of bold terms used.
  • A labelled diagram where asked, with data flow arrows and component names.
  • Assumptions stated explicitly (e.g., payload size, frequency, overheads included or excluded).
  • Step-by-step calculations with units carried through; final answer highlighted.
  • Security and scalability considerations when designing systems.

Quick check

  1. Define "device twin" in one sentence.
  2. How many bits are in a 200 byte payload? Give the formula and number.
  3. If each of 200 devices sends 2 messages per minute with payload 80 B, what is approximate total ingress in kb/s? (Use 1 byte = 8 bits)

Answers: 1) A device twin (or device shadow) is a cloud-side JSON document that stores the device's reported state and desired state to synchronize and manage devices. 2) 200 bytes × 8 = 1600 bits. 3) Messages per s = 200 × (2/60) = 6.6667 s^-1; bits per message = 80×8 = 640 bits; ingress ≈ 640 × 6.6667 = 4266.67 bit/s ≈ 4.267 kb/s.

Note on uncertainties: I have used generic example pricing and general vendor-name mappings; verify vendor feature names, current pricing and exact protocol support for the cloud platform you plan to use before quoting them in an assignment or production design.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?