Fundamentals
  • ← All Modules
  1. Protocol Selection
  2. 36  IoT Architecture Planner
Fundamentals
  • 1  Fundamentals Module Guide
  • Ecosystem Overview
    • 2  The IoT Ecosystem
    • 3  History of the Internet: From ARPANET to IoT
    • 4  Protocol Pioneers: The People Who Built the Internet
  • Data & Number Systems
    • 5  From Bytes to Meaning
    • 6  Number Systems and Data Units
    • 7  Text Encoding for IoT
    • 8  Bitwise Operations and Endianness
  • Data & Packet Formats
    • 9  Binary Data Formats for IoT
    • 10  Choosing an IoT Data Format
    • 11  Packet Anatomy
    • 12  Packet Framing
    • 13  Packet Error Detection
    • 14  Packet Protocol Overhead
  • Signal Processing
    • 15  Sensor-to-Network Pipeline
    • 16  Turning Signals Into Readings
    • 17  Processing Readings Into Packets
    • 18  Sending Readings Over the Link
    • 19  Signal Processing Essentials
    • 20  Sampling and Aliasing
    • 21  Quantization and Digital Filtering
    • 22  Sensor Linearization Methods
    • 23  Sensor Dynamics and Response Time
    • 24  Voice and Audio Compression for IoT
    • 25  Lab: Signal Processing
  • Wireless Propagation
    • 26  Radio Waves and Frequency Bands
    • 27  Path Loss and Link Budgets
    • 28  Fading and RF Interference
    • 29  Lab: Wireless Propagation
  • Protocol Selection
    • 30  Protocol Selection: Series Map
    • 31  Systematic Protocol Selection
    • 32  Protocol Selection Scenarios
    • 33  Protocol Anti-Patterns
    • 34  Why Protocol Choice Is Hard
    • 35  Protocol Selector Wizard
    • 36  IoT Architecture Planner
  • Academic Resources
    • 37  How to Read Research Papers
    • 38  WSN Papers Guide
    • 39  Protocol Papers Guide
    • 40  Architecture Papers Guide
    • 41  Security Papers Guide

On This Page

  • 36.1 In 60 Seconds
  • 36.2 Start With the Story
  • 36.3 Chapter Scope
  • 36.4 IoT Architecture Planner
  • 36.5 How It Works: Turn Requirements Into An Architecture
  • 36.6 Incremental Examples
  • 36.7 Quick Checks
  • 36.8 Try It Yourself
  • 36.9 See Also
  • 36.10 Key Concepts
  • 36.11 Prerequisites
  • 36.12 Step 1: Define Your Application
  • 36.13 Step 2: Sensing Layer
  • 36.14 Step 3: Network Layer
  • 36.15 Step 4: Processing Layer
  • 36.16 Step 5: Application Layer
  • 36.17 Architecture Visualization
  • 36.18 Cost Estimation
  • 36.19 Architecture Recommendations
  • 36.20 Architecture Patterns
  • 36.21 Your Configuration Summary
  • 36.22 Common Pitfalls
  • 36.23 What’s Next
  • 36.24 Related Chapters
  • 36.25 Concept Relationships
  • 36.26 Check Your Understanding
  • 36.27 Practice the Architecture Record
  • 36.28 Deep Dive: Place Computation Where the Constraint Lives
  • 36.29 Summary
  1. Protocol Selection
  2. 36  IoT Architecture Planner

36  IoT Architecture Planner

Interactive Tool for Designing End-to-End IoT Systems

fundamentals
planner

36.1 In 60 Seconds

An IoT architecture spans five layers – sensing, networking, processing, cloud, and application. This interactive planner helps you design a complete system by selecting components at each layer, estimating data volumes and costs, and matching your choices to proven architecture patterns.

36.2 Start With the Story

Start with a product meeting where someone says just use the protocol we know, while the deployment quietly needs different range, power, latency, security, and operations evidence. The core idea in IoT Architecture Planner is simple: protocol choice is a constraint problem, not a popularity contest, and the defensible answer comes from eliminating bad fits before scoring good candidates. This page focuses that idea on Plan and visualize your IoT architecture including sensors, edge processing, connectivity, cloud services, and data flow. In everyday IoT, parking sensors, wearables, logistics tags, and building retrofits need different proof even when they all send small messages. Start simple: state the hard constraints, reject impossible options, compare the finalists, and then validate the chosen protocol in the field.

36.3 Chapter Scope

This chapter focuses on end-to-end architecture decision-making.

  • Use Protocol Selector Wizard for protocol-only decisions.
  • Use Simulation Catalog for broad simulator/tool discovery.
  • Use this chapter when integrating sensing, connectivity, processing, cloud, and application choices as one design.
Chapter Roadmap

Use the planner in four passes:

  1. First frame the job: application, scale, criticality, and the five responsibility layers.
  2. Then size the sensing and network choices so 500 sensors, 50 hectares, gateway count, and battery life become explicit constraints.
  3. Next move into processing, cloud, application interfaces, cost, and recommendation logic.
  4. Finally use the quizzes, deep dive, and summary to turn the selected architecture into a validation record.

Checkpoints recap the evidence; the existing physics panel and interactives remain companion material.

Phoebe’s Field Notes: Where a “5-Year Battery Life” Requirement Comes From

Phoebe the physics guide

Phoebe’s Why

“Five-year battery life” is not a firmware setting – it is a chemistry and arithmetic claim. A cell’s milliamp-hour rating only becomes an energy budget once terminal voltage multiplies in, and that budget bleeds away on its own through self-discharge long before the radio spends a single joule. For a sensor waking a few times a day, the years-long sleep current and the cell’s own leakage usually cost more than the brief transmit bursts do – which is exactly why the vineyard scenario’s chemistry choice matters as much as its duty cycle. The soil sensor itself is a second physics story: a capacitive probe reads volumetric water content because water’s relative permittivity is roughly twenty times that of dry soil, so soil capacitance is dominated by how much water sits between the plates.

The Derivation

Charge rating becomes an energy budget only once voltage multiplies in:

\[E_{cell}\,\mathrm{(Wh)} = C\,\mathrm{(Ah)} \times V\]

Current through internal resistance sags the terminal voltage under load:

\[V_{terminal} = V_{oc} - I R_{int}\]

Usable energy after self-discharge over time \(t\) and a derating margin \(\delta\):

\[E_{usable} = E_{cell}\,(1-k)^{t}\,(1-\delta)\]

The soil probe’s governing equation – a parallel-plate capacitor, dominated by soil permittivity \(\varepsilon_r\):

\[C = \frac{\varepsilon_0\,\varepsilon_r\,A}{d}\]

Worked Numbers: The Vineyard Sensor’s 5-Year Budget

The chapter fixes 500 sensors, 5 readings/day, and a 5-year battery-life requirement but not a cell, so take a standard choice for that exact duty cycle: one ER14505-class Li-SOCl\(_2\) AA cell (\(C = 2.4\) Ah, \(V = 3.6\) V, self-discharge \(\approx 1\)%/year).

  • \(E_{cell} = 2.4 \times 3.6 = 8.64\) Wh
  • Over 5 years: self-discharge factor \((0.99)^{5} = 0.951\); with a 10% derating margin, \(E_{usable} = 8.64 \times 0.951 \times 0.90 = 7.39\) Wh
  • Sleep cost dominates: at a \(3\ \mu\mathrm{A}\) sleep current, \(E_{sleep} = 3\times10^{-6} \times 3.6 \times (5\times365\times24\times3600) = 1{,}703\) J \(= 0.473\) Wh over 5 years
  • Active cost is small by comparison: at \(9{,}125\) readings (\(5/\mathrm{day} \times 1825\) days) drawing 40 mA for 0.2 s each, \(E_{active} = 9{,}125 \times 0.040 \times 3.6 \times 0.2 = 263\) J \(= 0.0730\) Wh
  • Total spent \(\approx 0.546\) Wh against a \(7.39\) Wh usable budget – only about 7.4%, leaving generous margin for the low-temperature capacity fade and radio retries this estimate does not model
  • Voltage sag: Li-SOCl\(_2\)’s internal resistance (\(R_{int} \approx 10\ \Omega\)) against the 40 mA active burst sags the terminal by \(0.040 \times 10 = 0.4\) V – from 3.6 V to 3.2 V, a real dip worth checking against the radio’s brown-out threshold

36.4 IoT Architecture Planner

Learning Objectives

By using this interactive tool, you will be able to:

  • Design a complete five-layer IoT architecture from sensing through application delivery
  • Evaluate edge-versus-cloud processing trade-offs for a given latency and bandwidth budget
  • Estimate hardware and recurring costs for different architectural approaches
  • Diagnose potential bottlenecks in data flow, gateway capacity, and processing pipelines
  • Select an architecture pattern (direct-to-cloud, gateway-based, or edge-heavy) that matches deployment constraints
  • Justify component choices by linking sensor count, data volume, and cost projections to business requirements

Treat the planner as a decision record, not just a calculator: each slider should expose one assumption to prove before scale.

36.5 How It Works: Turn Requirements Into An Architecture

Use the planner as a requirements-to-evidence loop.

  1. Name the deployment job. Start with the environment, users, sensing task, latency target, data volume, and maintenance constraints.
  2. Place each layer. Decide what belongs in sensing, connectivity, edge/gateway, cloud, and application layers.
  3. Quantify the stress points. Estimate message rate, payload size, gateway load, storage, recurring cost, and response-time pressure.
  4. Choose the pattern. Select direct-to-cloud, gateway-based, or edge-heavy architecture only after the weak layer is visible.

flowchart TD
    A[Deployment requirement] --> B{Needs local timing or offline control?}
    B -- yes --> C[Place control near device or edge]
    B -- no --> D{Is raw data too large for backhaul?}
    D -- yes --> E[Filter or aggregate at gateway]
    D -- no --> F{Needs fleet-wide analytics?}
    F -- yes --> G[Store and analyze in cloud]
    F -- no --> H[Use the simplest direct path]
    C --> I[Record validation test]
    E --> I
    G --> I
    H --> I

36.6 Incremental Examples

Beginner Example: A single greenhouse sensor can send periodic readings directly to a cloud dashboard if latency is low-risk and connectivity is reliable.

Intermediate Example: A building with many rooms may need a gateway to reduce traffic, normalize protocols, and keep some control local.

Advanced Example: A safety-critical industrial line may need edge processing, buffered data, local failover, and a cloud layer for fleet analytics rather than real-time control.

36.7 Quick Checks

Physics PhoebeCheckpoint: Architecture Frame

You now know:

  • The planner is for end-to-end architecture decisions, while the Protocol Selector Wizard is for protocol-only choices.
  • A complete design must place sensing, networking, processing, cloud, and application responsibilities.
  • The first evidence loop is simple: name the deployment job, place each layer, quantify stress points, then choose the pattern.

36.8 Try It Yourself

Write a five-layer architecture note for one IoT scenario. For each layer, list one chosen component, one assumption, and one validation task.

36.9 See Also

  • Protocol Selector Wizard - narrows the connectivity choice inside the architecture.
  • Sensor-to-Network Pipeline - traces evidence from sensing through transport.
  • Application Domains Overview - helps anchor the architecture to a real application need.

36.10 Key Concepts

  • Architecture layer: One responsibility band in the system, such as sensing, network, processing, cloud, or application.
  • Placement decision: The choice of whether a function runs on a device, gateway, edge server, or cloud service.
  • Data-volume estimate: A first-order calculation that turns sensor count, frequency, and payload size into bandwidth and storage pressure.
  • Gateway capacity: The practical limit on how many devices, messages, protocol conversions, and local tasks one gateway can handle.
  • Architecture pattern: A repeatable shape such as direct-to-cloud, gateway-centric, edge-heavy, mesh, or high-availability.
  • Validation task: A specific measurement, pilot, failure drill, or simulation used to prove the architecture’s riskiest assumption.

36.10.1 Key Takeaway

In one sentence: A well-designed IoT architecture balances sensing needs, connectivity options, processing location, and cost constraints across five interconnected layers.

Remember this rule: Process data at the edge when latency matters, send to cloud when you need scale - your architecture should optimize the edge/cloud split for your specific requirements.

No-One-Left-Behind Architecture Loop
  1. Start with a clear deployment scenario and constraints.
  2. Decide one layer at a time, validating dependencies.
  3. Quantify data volume, latency, and cost before finalizing.
  4. Reinforce by testing assumptions with one simulation or lab.

36.11 Prerequisites

Before using this planner, review:

  • IoT Reference Models: Understanding of IoT architecture layers
  • Edge-Fog Computing: Edge vs. cloud processing concepts
  • Protocol Selector Wizard: Choose connectivity before designing architecture
For Beginners: IoT Architecture = Blueprint for Your System

Simple Analogy: Building a House

Designing IoT architecture is like planning a house:

House Component IoT Equivalent Purpose
Sensors (smoke, motion) IoT Sensors Detect what’s happening
Wiring Network/Protocols Connect everything
Electrical panel Gateway/Edge Process locally
Utility connection Cloud Services Connect to outside world
Smart home app Dashboard/App Control and monitor

Three Architecture Patterns:

  1. Direct-to-Cloud: Sensors → Cloud (simple, but needs internet)
  2. Gateway-Based: Sensors → Gateway → Cloud (most common)
  3. Edge-Heavy: Sensors → Edge Processing → Cloud (smart, less data)

36.12 Step 1: Define Your Application

Next comes scale: do not pick gateways, cloud tiers, or edge processing until deployment size and message rate have numbers attached.

Worked Example: Architecture Planning for Smart Agriculture

Scenario: A vineyard owner wants to monitor 50 hectares (500 sensors: soil moisture, temperature, humidity) to optimize irrigation.

Step-by-step planning:

  1. Define scope: 500 sensors across 50 hectares, cellular connectivity (no Wi-Fi), 5-year battery life required
  2. Calculate data volume: 500 sensors × 5 readings/day × 20 bytes/reading = 50 KB/day = 1.5 MB/month
  3. Estimate costs: Sensors ($15 each = $7,500) + gateways ($200 each, need 10 = $2,000) + cellular ($2/month per gateway) = $9,500 upfront + $240/year
  4. Choose architecture: Gateway-based with LoRaWAN (long range, low power) + 4G backhaul, 50% edge processing (local alerts for irrigation triggers)

Outcome: System paid for itself in year 1 through 30% water savings ($12,000/year).

Putting Numbers to It

Architecture choices should be grounded in data-volume math before selecting gateways, cloud plans, and retention policies:

\[ D_{\text{month}} = \frac{N_{\text{sensors}} \times f_{\text{day}} \times B_{\text{msg}} \times 30}{1024^2} \text{ MB} \]

where \(D_{\text{month}}\) is monthly data volume in MB, \(N_{\text{sensors}}\) is sensor count, \(f_{\text{day}}\) is messages per sensor per day, and \(B_{\text{msg}}\) is bytes per message.

Worked example: With 500 sensors sending every 15 minutes (\(f_{\text{day}}=96\)) and 32-byte payloads:

\[ D_{\text{month}} = \frac{500 \times 96 \times 32 \times 30}{1024^2} \approx 43.95 \text{ MB/month} \]

If edge filtering removes 70% of non-actionable records, cloud ingest becomes about \(13.2\) MB/month. That reduction directly affects backhaul usage, storage cost, and query latency.

Common Mistake: Underestimating Gateway Count

Problem: Assuming one gateway can cover an entire deployment area.

Reality: LoRaWAN range is heavily affected by terrain and obstacles. A single gateway might reach 2-5 km in open fields, but only 500m in dense agriculture with trees/hills.

Fix: Use radio propagation tools (e.g., RadioMobile) to model actual coverage before ordering hardware. Budget 1 gateway per 20-50 sensors in challenging terrain.

Show code
viewof arch_app = Inputs.select(
  [
    "Smart Home / Building",
    "Industrial Manufacturing",
    "Smart Agriculture",
    "Healthcare / Wearables",
    "Smart City / Infrastructure",
    "Retail / Logistics",
    "Energy / Utilities",
    "Transportation / Fleet",
    "Environmental Monitoring",
    "Custom Application"
  ],
  {label: "Application Domain:", value: "Smart Home / Building"}
)

viewof arch_scale = Inputs.select(
  [
    "Single location (1 site)",
    "Multiple locations (2-10 sites)",
    "Regional (10-50 sites)",
    "National (50-200 sites)",
    "Global (200+ sites)"
  ],
  {label: "Deployment Scale:", value: "Single location (1 site)"}
)

viewof arch_criticality = Inputs.select(
  [
    "Non-critical (data loss acceptable)",
    "Important (some data loss OK)",
    "Business-critical (minimal data loss)",
    "Mission-critical (no data loss)",
    "Safety-critical (life-safety)"
  ],
  {label: "System Criticality:", value: "Important (some data loss OK)"}
)

36.13 Step 2: Sensing Layer

Layer 1: Sensors and Actuators

The perception layer captures physical world data and executes actions.

Show code
viewof sensor_count = Inputs.range([1, 10000], {
  label: "Number of Sensors:",
  value: 50,
  step: 1
})

viewof sensor_types = Inputs.checkbox(
  ["Temperature", "Humidity", "Motion/PIR", "Light/Luminosity", "Pressure", "Vibration", "GPS/Location", "Camera/Video", "Audio/Sound", "Air Quality", "Water/Moisture", "Power/Energy"],
  {label: "Sensor Types:", value: ["Temperature", "Humidity", "Motion/PIR"]}
)

viewof actuator_count = Inputs.range([0, 500], {
  label: "Number of Actuators:",
  value: 10,
  step: 1
})

viewof actuator_types = Inputs.checkbox(
  ["Relays/Switches", "Motors/Servos", "Valves", "Displays/LEDs", "Speakers/Alarms", "HVAC Controls", "Locks/Access"],
  {label: "Actuator Types:", value: ["Relays/Switches", "Displays/LEDs"]}
)

// Data characteristics
viewof data_rate = Inputs.select(
  [
    "Low (< 1 msg/min per sensor)",
    "Medium (1-10 msg/min)",
    "High (10-60 msg/min)",
    "Very High (> 1 msg/sec)",
    "Streaming (continuous)"
  ],
  {label: "Data Frequency:", value: "Medium (1-10 msg/min)"}
)

viewof data_size = Inputs.select(
  [
    "Tiny (< 100 bytes)",
    "Small (100 bytes - 1 KB)",
    "Medium (1-10 KB)",
    "Large (10-100 KB)",
    "Very Large (> 100 KB, images/video)"
  ],
  {label: "Message Size:", value: "Tiny (< 100 bytes)"}
)

36.14 Step 3: Network Layer

Layer 2: Connectivity

How sensors connect and communicate data.

Decision Framework: Choosing Connectivity Protocol

Use this table to select the right protocol based on your constraints:

Your Constraint Choose Why
Indoor deployment, power available Wi-Fi Highest bandwidth, existing infrastructure
Indoor sensors, battery powered Bluetooth LE or Zigbee Low power, good indoor range (10-30m)
Outdoor, sensors spread 1-5 km LoRaWAN Long range, very low power, proven for agriculture
Mobile assets (vehicles, containers) Cellular (NB-IoT/LTE-M) Ubiquitous coverage, higher cost
Urban dense deployment Thread or Zigbee Mesh networking handles interference
10+ year battery life LoRaWAN or Sigfox Ultra-low power modes, infrequent transmission

Real numbers example: 100 soil sensors, 5 readings/day for 5 years - LoRaWAN: 2× AA batteries last 5-7 years, data cost ~$50/year (gateway backhaul) - Cellular NB-IoT: Battery life 2-3 years, data cost ~$200/year (per-device SIM) - Wi-Fi: Must plug in, data cost $0 (local network)

Show code
viewof primary_protocol = Inputs.select(
  [
    "Wi-Fi (802.11)",
    "Bluetooth LE",
    "Zigbee",
    "Thread",
    "Z-Wave",
    "LoRaWAN",
    "NB-IoT",
    "LTE-M",
    "Sigfox",
    "Ethernet (Wired)",
    "Mixed/Multiple"
  ],
  {label: "Primary Connectivity:", value: "Wi-Fi (802.11)"}
)

viewof gateway_needed = Inputs.select(
  [
    "No gateway (direct to cloud)",
    "Simple gateway (protocol translation)",
    "Smart gateway (local processing)",
    "Edge server (heavy processing)",
    "Multiple gateway tiers"
  ],
  {label: "Gateway Architecture:", value: "Smart gateway (local processing)"}
)

viewof gateway_count = Inputs.range([0, 100], {
  label: "Number of Gateways:",
  value: 3,
  step: 1
})

viewof backhaul = Inputs.select(
  [
    "Wi-Fi to broadband",
    "Ethernet",
    "Cellular (4G/5G)",
    "Satellite",
    "LoRaWAN network server",
    "Fiber"
  ],
  {label: "Backhaul Connection:", value: "Wi-Fi to broadband"}
)

36.14.1 Quick Knowledge Check: Gateway Architecture

Before proceeding, test your understanding of the gateway decisions you just made.

Physics PhoebeCheckpoint: Scale and Connectivity

You now know:

  • The vineyard example binds the decision to 500 sensors, 50 hectares, 5 readings/day, 20 bytes/reading, 50 KB/day, and 1.5 MB/month.
  • Gateway count is not a guess: the chapter warns that dense agriculture may need one gateway per 20-50 sensors rather than one gateway for the whole area.
  • The network must follow the constraint: LoRaWAN fits wide, low-rate field sensing; Bluetooth mesh or Wi-Fi extenders create power and coverage problems.


36.15 Step 4: Processing Layer

Once connectivity is plausible, look for the next bottleneck: where the data should be reduced, buffered, or acted on before it reaches the cloud.

Layer 3: Where to Process Data

Decide between edge, fog, and cloud processing.

Show code
viewof edge_processing = Inputs.range([0, 100], {
  label: "Edge Processing (%):",
  value: 30,
  step: 5
})

viewof edge_tasks = Inputs.checkbox(
  [
    "Filtering/aggregation",
    "Local alerts",
    "Protocol translation",
    "Data compression",
    "ML inference",
    "Video analytics",
    "Local control loops",
    "Buffering/store-forward"
  ],
  {label: "Edge Tasks:", value: ["Filtering/aggregation", "Local alerts", "Protocol translation"]}
)

viewof cloud_services = Inputs.checkbox(
  [
    "Time-series storage",
    "Long-term analytics",
    "ML model training",
    "Dashboards",
    "API services",
    "User management",
    "Device management",
    "Integration services"
  ],
  {label: "Cloud Services:", value: ["Time-series storage", "Dashboards", "Device management"]}
)

viewof latency_requirement = Inputs.select(
  [
    "Not critical (seconds OK)",
    "Near real-time (< 1 second)",
    "Real-time (< 100 ms)",
    "Ultra-low (< 10 ms)",
    "Deterministic (< 1 ms)"
  ],
  {label: "Latency Requirement:", value: "Near real-time (< 1 second)"}
)

36.16 Step 5: Application Layer

Layer 4: Business Applications

End-user applications and integrations.

Show code
viewof app_interfaces = Inputs.checkbox(
  [
    "Web dashboard",
    "Mobile app (iOS/Android)",
    "REST API",
    "MQTT broker access",
    "Webhooks/notifications",
    "Voice assistant integration",
    "Third-party integrations",
    "Enterprise system (ERP/CRM)"
  ],
  {label: "Application Interfaces:", value: ["Web dashboard", "Mobile app (iOS/Android)", "REST API"]}
)

viewof user_types = Inputs.checkbox(
  [
    "End consumers",
    "Technicians/installers",
    "Operators/managers",
    "Data analysts",
    "Administrators",
    "API developers"
  ],
  {label: "User Types:", value: ["End consumers", "Operators/managers"]}
)

viewof data_retention = Inputs.select(
  [
    "7 days (short-term)",
    "30 days (monthly)",
    "90 days (quarterly)",
    "1 year (annual)",
    "3 years (compliance)",
    "7+ years (long-term archive)"
  ],
  {label: "Data Retention:", value: "1 year (annual)"}
)

Physics PhoebeCheckpoint: Processing Placement

You now know:

  • Processing location follows the bottleneck: latency, resilience, privacy, and bandwidth can justify edge-heavy design.
  • Raw vibration data at 500 sensors, 1 kHz, and 4 bytes/sample becomes 16 Mbps, which cannot fit a 2 Mbps cellular backhaul.
  • Edge processing is valuable only when it changes the evidence: filtering, FFT, anomaly detection, downsampling, buffering, or local control must reduce risk, not just add another layer.

36.17 Architecture Visualization

Show code
arch_metrics = {
  // Data volume calculations
  let msgs_per_min = data_rate.includes("Low") ? 0.5 :
                     data_rate.includes("Medium") ? 5 :
                     data_rate.includes("High") ? 30 :
                     data_rate.includes("Very High") ? 120 : 600;

  let msg_bytes = data_size.includes("Tiny") ? 50 :
                  data_size.includes("Small") ? 500 :
                  data_size.includes("Medium") ? 5000 :
                  data_size.includes("Large") ? 50000 : 500000;

  let daily_msgs = sensor_count * msgs_per_min * 60 * 24;
  let daily_bytes = daily_msgs * msg_bytes;
  let monthly_gb = (daily_bytes * 30) / (1024 * 1024 * 1024);

  // Data after edge processing
  let cloud_data_pct = (100 - edge_processing) / 100;
  let cloud_monthly_gb = monthly_gb * cloud_data_pct;

  // Gateway capacity
  let sensors_per_gateway = gateway_count > 0 ? Math.ceil(sensor_count / gateway_count) : sensor_count;

  // Redundancy needs
  let redundancy = arch_criticality.includes("Mission") || arch_criticality.includes("Safety") ? "High (N+1 or N+2)" :
                   arch_criticality.includes("Business") ? "Medium (N+1)" : "Low (single)";

  // Latency estimate
  let edge_latency = edge_processing > 50 ? 20 : 50;
  let cloud_latency = backhaul.includes("Satellite") ? 600 :
                      backhaul.includes("Cellular") ? 100 :
                      backhaul.includes("Wi-Fi") ? 50 : 30;
  let total_latency = edge_processing > 50 ? edge_latency : edge_latency + cloud_latency;

  return {
    daily_msgs: daily_msgs.toLocaleString(),
    daily_gb: (daily_bytes / (1024 * 1024 * 1024)).toFixed(2),
    monthly_gb: monthly_gb.toFixed(2),
    cloud_monthly_gb: cloud_monthly_gb.toFixed(2),
    sensors_per_gateway: sensors_per_gateway,
    redundancy: redundancy,
    edge_latency: edge_latency,
    cloud_latency: cloud_latency,
    total_latency: total_latency,
    data_reduction: (edge_processing) + '%'
  };
}

short_edge_tasks = edge_tasks
  .slice(0, 2)
  .map((task) => ({
    "Filtering/aggregation": "Filtering",
    "Local alerts": "Alerts",
    "Protocol translation": "Translation",
    "Data compression": "Compression",
    "ML inference": "ML",
    "Video analytics": "Video",
    "Local control loops": "Control loops",
    "Buffering/store-forward": "Buffering"
  }[task] || task))
  .join(', ');

short_cloud_services = cloud_services
  .slice(0, 2)
  .map((service) => ({
    "Time-series storage": "Time-series",
    "Long-term analytics": "Analytics",
    "ML model training": "ML training",
    "Device management": "Device mgmt",
    "Integration services": "Integrations"
  }[service] || service))
  .join(', ');

html`
<div style="background: linear-gradient(135deg, #E8F6F3 0%, #D5F4E6 100%); padding: 25px; border-radius: 12px; margin: 20px 0; border: 2px solid #0B6F5F;">
  <h3 style="color: #0B6F5F; margin-top: 0;">Your IoT Architecture</h3>

  <!-- Architecture Diagram -->
  <div style="background: white; padding: 20px; border-radius: 10px; margin: 15px 0;">
    <h3 style="color: #2C3E50; margin-top: 0;">Architecture Overview</h3>
    <div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 20px 0;">

      <!-- Sensing Layer -->
      <div style="text-align: center; flex: 1; min-width: 120px;">
        <div style="background: #0B6F5F; color: white; padding: 15px; border-radius: 10px; margin-bottom: 10px;">
          <div style="font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em;">SENSING</div>
          <div style="font-weight: bold;">Sensors</div>
          <div style="font-size: 0.9em;">${sensor_count} devices</div>
        </div>
        <div style="font-size: 0.85em; color: #475569;">
          ${sensor_types.slice(0, 3).join(', ')}${sensor_types.length > 3 ? '...' : ''}
        </div>
      </div>

      <div style="font-size: 2em; color: #0B6F5F;">→</div>

      <!-- Network Layer -->
      <div style="text-align: center; flex: 1; min-width: 120px;">
        <div style="background: #2C3E50; color: white; padding: 15px; border-radius: 10px; margin-bottom: 10px;">
          <div style="font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em;">NETWORK</div>
          <div style="font-weight: bold;">${primary_protocol}</div>
          <div style="font-size: 0.9em;">${gateway_count} gateways</div>
        </div>
        <div style="font-size: 0.85em; color: #475569;">
          ${gateway_needed.split('(')[0]}
        </div>
      </div>

      <div style="font-size: 2em; color: #0B6F5F;">→</div>

      <!-- Processing Layer -->
      <div style="text-align: center; flex: 1; min-width: 120px;">
        <div style="background: #9A5200; color: white; padding: 15px; border-radius: 10px; margin-bottom: 10px;">
          <div style="font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em;">PROCESS</div>
          <div style="font-weight: bold;">Processing</div>
          <div style="font-size: 0.9em;">${edge_processing}% edge</div>
        </div>
        <div style="font-size: 0.85em; color: #475569;">
          ${short_edge_tasks}
        </div>
      </div>

      <div style="font-size: 2em; color: #0B6F5F;">→</div>

      <!-- Cloud Layer -->
      <div style="text-align: center; flex: 1; min-width: 120px;">
        <div style="background: #185A9D; color: white; padding: 15px; border-radius: 10px; margin-bottom: 10px;">
          <div style="font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em;">CLOUD</div>
          <div style="font-weight: bold;">Cloud</div>
          <div style="font-size: 0.9em;">${arch_metrics.cloud_monthly_gb} GB/mo</div>
        </div>
        <div style="font-size: 0.85em; color: #475569;">
          ${short_cloud_services}
        </div>
      </div>

      <div style="font-size: 2em; color: #0B6F5F;">→</div>

      <!-- Application Layer -->
      <div style="text-align: center; flex: 1; min-width: 120px;">
        <div style="background: #6D3B83; color: white; padding: 15px; border-radius: 10px; margin-bottom: 10px;">
          <div style="font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em;">APPS</div>
          <div style="font-weight: bold;">Apps</div>
          <div style="font-size: 0.9em;">${app_interfaces.length} interfaces</div>
        </div>
        <div style="font-size: 0.85em; color: #475569;">
          ${app_interfaces.slice(0, 2).join(', ')}
        </div>
      </div>
    </div>
  </div>

  <!-- Key Metrics -->
  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 20px;">
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Daily Messages</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #0B6F5F;">${arch_metrics.daily_msgs}</div>
    </div>
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Daily Data Volume</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #2C3E50;">${arch_metrics.daily_gb} GB</div>
    </div>
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Cloud Data (Monthly)</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #185A9D;">${arch_metrics.cloud_monthly_gb} GB</div>
    </div>
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Edge Data Reduction</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #9A5200;">${arch_metrics.data_reduction}</div>
    </div>
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Sensors per Gateway</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #6D3B83;">${arch_metrics.sensors_per_gateway}</div>
    </div>
    <div style="background: white; padding: 15px; border-radius: 8px; text-align: center;">
      <div style="font-size: 0.85em; color: #475569;">Est. Latency</div>
      <div style="font-size: 1.5em; font-weight: bold; color: #B42318;">${arch_metrics.total_latency}ms</div>
    </div>
  </div>
</div>
`

36.18 Cost Estimation

Show code
cost_estimate = {
  // Hardware costs
  let sensor_unit_cost = sensor_types.includes("Camera/Video") ? 50 :
                         sensor_types.includes("GPS/Location") ? 30 :
                         sensor_types.length > 3 ? 20 : 10;
  let sensor_total = sensor_count * sensor_unit_cost;

  let actuator_unit_cost = actuator_types.includes("Motors/Servos") ? 25 :
                           actuator_types.includes("HVAC Controls") ? 40 : 15;
  let actuator_total = actuator_count * actuator_unit_cost;

  let gateway_unit_cost = gateway_needed.includes("Edge server") ? 500 :
                          gateway_needed.includes("Smart") ? 150 :
                          gateway_needed.includes("Simple") ? 50 : 0;
  let gateway_total = gateway_count * gateway_unit_cost;

  let hw_total = sensor_total + actuator_total + gateway_total;

  // Monthly costs
  let cloud_monthly = arch_metrics.cloud_monthly_gb * 0.5; // $0.50 per GB estimate
  cloud_monthly += cloud_services.length * 20; // Base service costs

  let connectivity_monthly = primary_protocol.includes("NB-IoT") || primary_protocol.includes("LTE") ?
                             sensor_count * 1.5 : // Cellular per device
                             primary_protocol.includes("LoRaWAN") ?
                             gateway_count * 50 : // LoRaWAN network server
                             0; // Wi-Fi/local protocols

  let monthly_total = cloud_monthly + connectivity_monthly;

  // Annual costs
  let annual_total = hw_total + (monthly_total * 12);

  return {
    sensor_total: sensor_total,
    actuator_total: actuator_total,
    gateway_total: gateway_total,
    hw_total: hw_total,
    cloud_monthly: cloud_monthly.toFixed(0),
    connectivity_monthly: connectivity_monthly.toFixed(0),
    monthly_total: monthly_total.toFixed(0),
    annual_total: annual_total.toFixed(0),
    cost_per_sensor: (annual_total / sensor_count).toFixed(2)
  };
}

html`
<div style="background: #f8f9fa; padding: 20px; border-radius: 10px; margin: 20px 0;">
  <h3 style="margin-top: 0; color: #2C3E50;">Estimated Costs</h3>

  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px;">

    <!-- One-time costs -->
    <div style="background: white; padding: 20px; border-radius: 8px; border-left: 4px solid #0B6F5F;">
      <h4 style="margin-top: 0; color: #0B6F5F;">Hardware (One-time)</h4>
      <table style="width: 100%; border-collapse: collapse;">
        <tr><td>Sensors (${sensor_count})</td><td style="text-align: right;">$${cost_estimate.sensor_total.toLocaleString()}</td></tr>
        <tr><td>Actuators (${actuator_count})</td><td style="text-align: right;">$${cost_estimate.actuator_total.toLocaleString()}</td></tr>
        <tr><td>Gateways (${gateway_count})</td><td style="text-align: right;">$${cost_estimate.gateway_total.toLocaleString()}</td></tr>
        <tr style="border-top: 2px solid #0B6F5F; font-weight: bold;">
          <td>Total Hardware</td>
          <td style="text-align: right;">$${cost_estimate.hw_total.toLocaleString()}</td>
        </tr>
      </table>
    </div>

    <!-- Recurring costs -->
    <div style="background: white; padding: 20px; border-radius: 8px; border-left: 4px solid #9A5200;">
      <h4 style="margin-top: 0; color: #9A5200;">Monthly Services</h4>
      <table style="width: 100%; border-collapse: collapse;">
        <tr><td>Cloud Services</td><td style="text-align: right;">$${cost_estimate.cloud_monthly}/mo</td></tr>
        <tr><td>Connectivity</td><td style="text-align: right;">$${cost_estimate.connectivity_monthly}/mo</td></tr>
        <tr style="border-top: 2px solid #9A5200; font-weight: bold;">
          <td>Total Monthly</td>
          <td style="text-align: right;">$${cost_estimate.monthly_total}/mo</td>
        </tr>
      </table>
    </div>
  </div>

  <div style="margin-top: 20px; padding: 15px; background: #E8F6F3; border-radius: 8px; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 20px;">
    <div style="text-align: center;">
      <div style="font-size: 0.9em; color: #475569;">First Year Total</div>
      <div style="font-size: 1.8em; font-weight: bold; color: #2C3E50;">$${parseInt(cost_estimate.annual_total).toLocaleString()}</div>
    </div>
    <div style="text-align: center;">
      <div style="font-size: 0.9em; color: #475569;">Cost per Sensor (Annual)</div>
      <div style="font-size: 1.8em; font-weight: bold; color: #0B6F5F;">$${cost_estimate.cost_per_sensor}</div>
    </div>
  </div>

  <p style="font-size: 0.85em; color: #475569; margin-top: 15px; margin-bottom: 0;">
    * Estimates are approximate. Actual costs vary by vendor, region, and specific requirements.
  </p>
</div>
`

36.19 Architecture Recommendations

Show code
recommendations = {
  let recs = [];
  let warnings = [];

  // Gateway recommendations
  if (gateway_count > 0 && arch_metrics.sensors_per_gateway > 100) {
    warnings.push({
      type: "capacity",
      message: `High sensor density (${arch_metrics.sensors_per_gateway} per gateway). Consider adding more gateways for reliability.`
    });
  }

  if (gateway_needed.includes("No gateway") && sensor_count > 20) {
    warnings.push({
      type: "architecture",
      message: "Direct-to-cloud with many sensors may cause scalability issues. Consider adding a gateway layer."
    });
  }

  // Edge processing recommendations
  if (edge_processing < 20 && (data_rate.includes("High") || data_rate.includes("Very High"))) {
    recs.push({
      type: "optimization",
      message: "High data rate with low edge processing. Consider increasing edge processing to reduce cloud costs and latency."
    });
  }

  if (latency_requirement.includes("Real-time") && edge_processing < 50) {
    warnings.push({
      type: "latency",
      message: "Real-time latency requirement with cloud-heavy processing may not meet SLA. Increase edge processing."
    });
  }

  // Data retention recommendations
  if (data_retention.includes("3 years") || data_retention.includes("7+")) {
    recs.push({
      type: "storage",
      message: "Long retention period. Implement data tiering: hot (recent), warm (months), cold (archive) storage."
    });
  }

  // Criticality recommendations
  if (arch_criticality.includes("Mission") || arch_criticality.includes("Safety")) {
    recs.push({
      type: "reliability",
      message: "Critical system requires N+1 redundancy for gateways, multi-region cloud, and offline capability."
    });
    if (!edge_tasks.includes("Buffering/store-forward")) {
      warnings.push({
        type: "reliability",
        message: "Critical system should include store-forward buffering for connectivity failures."
      });
    }
  }

  // Protocol-specific recommendations
  if (primary_protocol.includes("LoRaWAN") && data_rate.includes("High")) {
    warnings.push({
      type: "bandwidth",
      message: "LoRaWAN bandwidth may be insufficient for high data rates. Consider Wi-Fi or cellular for high-frequency sensors."
    });
  }

  // Security recommendations
  if (sensor_types.includes("Camera/Video")) {
    recs.push({
      type: "security",
      message: "Video devices require strong encryption, access control, and privacy compliance (GDPR/CCPA)."
    });
  }

  // Cost optimization
  if (cost_estimate.connectivity_monthly > 500) {
    recs.push({
      type: "cost",
      message: "High connectivity costs. Consider LoRaWAN or private network instead of cellular for stationary sensors."
    });
  }

  return { recommendations: recs, warnings: warnings };
}

html`
<div style="margin: 20px 0;">
  ${recommendations.warnings.length > 0 ? html`
    <div style="background: #FADBD8; padding: 20px; border-radius: 10px; margin-bottom: 15px; border-left: 4px solid #B42318;">
      <h3 style="margin-top: 0; color: #B42318;">Warnings</h3>
      <ul style="margin: 0; padding-left: 20px;">
        ${recommendations.warnings.map(w => html`<li style="margin: 8px 0;">${w.message}</li>`)}
      </ul>
    </div>
  ` : ''}

  ${recommendations.recommendations.length > 0 ? html`
    <div style="background: #E8F6F3; padding: 20px; border-radius: 10px; border-left: 4px solid #0B6F5F;">
      <h3 style="margin-top: 0; color: #0B6F5F;">Recommendations</h3>
      <ul style="margin: 0; padding-left: 20px;">
        ${recommendations.recommendations.map(r => html`<li style="margin: 8px 0;">${r.message}</li>`)}
      </ul>
    </div>
  ` : html`
    <div style="background: #D5F4E6; padding: 20px; border-radius: 10px; border-left: 4px solid #146C43;">
      <h3 style="margin-top: 0; color: #146C43;">Architecture Looks Good</h3>
      <p style="margin: 0;">Your architecture configuration appears well-balanced for your requirements.</p>
    </div>
  `}
</div>
`

36.20 Architecture Patterns

Based on your selections, here are relevant architecture patterns:

Recommended Patterns for Your Application
Show code
patterns = {
  let applicable = [];

  if (edge_processing >= 50) {
    applicable.push({
      name: "Edge-Heavy Architecture",
      description: "Process most data at the edge, send only insights to cloud",
      pros: ["Low latency", "Reduced bandwidth", "Works offline"],
      cons: ["Edge hardware cost", "Distributed management"],
      learn_more: "/edge-fog/edge-fog-computing.html"
    });
  }

  if (gateway_needed.includes("Smart") || gateway_needed.includes("Edge")) {
    applicable.push({
      name: "Gateway-Centric Architecture",
      description: "Gateways aggregate, process, and forward data",
      pros: ["Protocol translation", "Local control", "Security boundary"],
      cons: ["Gateway is single point of failure"],
      learn_more: "/protocol-bridging/communication-and-protocol-bridging.html"
    });
  }

  if (primary_protocol.includes("Zigbee") || primary_protocol.includes("Thread")) {
    applicable.push({
      name: "Mesh Network Architecture",
      description: "Self-healing mesh for resilient sensor networks",
      pros: ["Self-healing", "Extended range", "No single point of failure"],
      cons: ["Latency increases with hops", "Complexity"],
      learn_more: "/zigbee-thread/zigbee-network-topologies.html"
    });
  }

  if (arch_criticality.includes("Mission") || arch_criticality.includes("Safety")) {
    applicable.push({
      name: "High-Availability Architecture",
      description: "Redundant components at every layer",
      pros: ["99.99%+ uptime", "Fault tolerance", "Disaster recovery"],
      cons: ["Higher cost", "Operational complexity"],
      learn_more: "/reference-architectures/production-architecture-management.html"
    });
  }

  if (arch_scale.includes("Regional") || arch_scale.includes("National") || arch_scale.includes("Global")) {
    applicable.push({
      name: "Distributed Cloud Architecture",
      description: "Multi-region deployment with data locality",
      pros: ["Global reach", "Data sovereignty", "Low latency"],
      cons: ["Sync complexity", "Higher cost"],
      learn_more: "/reference-architectures/cloud-computing-fundamentals.html"
    });
  }

  // Default pattern
  if (applicable.length === 0) {
    applicable.push({
      name: "Standard Three-Tier Architecture",
      description: "Sensors → Gateway → Cloud (most common IoT pattern)",
      pros: ["Simple", "Well-documented", "Vendor support"],
      cons: ["Depends on connectivity"],
      learn_more: "/reference-architectures/iot-reference-models-introduction.html"
    });
  }

  return applicable;
}

html`
<div style="display: grid; gap: 15px;">
  ${patterns.map(p => html`
    <div style="background: white; padding: 20px; border-radius: 10px; border: 1px solid #ddd; border-left: 4px solid #0B6F5F;">
      <h3 style="margin-top: 0; color: #2C3E50;">${p.name}</h3>
      <p style="color: #475569; margin: 10px 0;">${p.description}</p>
      <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px;">
        <div>
          <strong style="color: #146C43;">Advantages:</strong>
          <ul style="margin: 5px 0; padding-left: 18px; font-size: 0.9em;">
            ${p.pros.map(pro => html`<li>${pro}</li>`)}
          </ul>
        </div>
        <div>
          <strong style="color: #9A5200;">Considerations:</strong>
          <ul style="margin: 5px 0; padding-left: 18px; font-size: 0.9em;">
            ${p.cons.map(con => html`<li>${con}</li>`)}
          </ul>
        </div>
      </div>
    </div>
  `)}
</div>
`

36.21 Your Configuration Summary

After visualization and recommendations, pause before treating the output as final. The summary below is a candidate architecture to validate.

Show code
html`
<div style="background: #f0f4f8; padding: 20px; border-radius: 10px; margin: 20px 0;">
  <h3 style="margin-top: 0; color: #2C3E50;">Architecture Summary</h3>

  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Application</strong>
      <p style="margin: 5px 0;">${arch_app}</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">Scale: ${arch_scale}</p>
    </div>

    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Devices</strong>
      <p style="margin: 5px 0;">${sensor_count} sensors, ${actuator_count} actuators</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">${sensor_types.join(', ')}</p>
    </div>

    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Connectivity</strong>
      <p style="margin: 5px 0;">${primary_protocol}</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">${gateway_count} gateways, ${backhaul}</p>
    </div>

    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Processing</strong>
      <p style="margin: 5px 0;">${edge_processing}% edge, ${100-edge_processing}% cloud</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">${short_edge_tasks}</p>
    </div>

    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Data Profile</strong>
      <p style="margin: 5px 0;">${data_rate}, ${data_size}</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">Retention: ${data_retention}</p>
    </div>

    <div style="background: white; padding: 15px; border-radius: 8px;">
      <strong style="color: #0B6F5F;">Applications</strong>
      <p style="margin: 5px 0;">${app_interfaces.join(', ')}</p>
      <p style="margin: 0; font-size: 0.9em; color: #475569;">Users: ${user_types.join(', ')}</p>
    </div>
  </div>
</div>
`

36.22 Common Pitfalls

1. Prioritizing Theory Over Measurement

Relying on theoretical models without profiling actual behavior leads to designs that miss performance targets by 2-10×. Always measure the dominant bottleneck in your specific deployment environment — hardware variability, interference, and load patterns routinely differ from textbook assumptions.

2. Ignoring System-Level Trade-offs

Optimizing one parameter in isolation (latency, throughput, energy) without considering impact on others creates systems that excel on benchmarks but fail in production. Document the top three trade-offs before finalizing any design decision and verify with realistic workloads.

3. Skipping Failure Mode Analysis

Most field failures come from edge cases that work in the lab: intermittent connectivity, partial node failure, clock drift, and buffer overflow under peak load. Explicitly design and test failure handling before deployment — retrofitting error recovery after deployment costs 5-10× more than building it in.

36.23 What’s Next

  • Select protocols: Protocol Selector Wizard to refine connectivity choices based on your architecture constraints.
  • Plan your learning: Learning Paths to create a curriculum matched to your design goals.
  • Explore simulations: Simulation Playground to test your architecture virtually before committing to hardware.
  • Build a prototype: Capstone Projects to apply your architecture in a guided end-to-end project.
  • Deepen reference models: IoT Reference Models to compare your design against standard IoT architecture frameworks.
  • Reinforce decisions: IoT Games Hub to practise architecture trade-off reasoning through challenge rounds.

36.24 Related Chapters

  • Reference Models: IoT Reference Models for standard IoT architecture frameworks.
  • Edge Computing: Edge-Fog Computing for when and how to process at the edge.
  • Cloud Platforms: Cloud Computing for cloud IoT platform options.
  • Security: Security Architecture for securing your IoT architecture.
  • Data Management: Data Storage for database selection in IoT systems.

36.25 Concept Relationships

  • IoT Architecture Planning Builds on: system design principles and layer models. Leads to: platform selection and protocol choice. Contrasts with: ad-hoc device deployment.

  • Edge vs Cloud Processing Builds on: computing fundamentals and latency requirements. Leads to: edge computing frameworks and fog architectures. Contrasts with: pure cloud-only architectures.

  • Gateway Architecture Builds on: protocol translation and network layers. Leads to: mesh networking and multi-protocol gateways. Contrasts with: direct device-to-cloud approaches.

  • Cost Estimation Builds on: TCO analysis and subscription models. Leads to: vendor negotiation and ROI calculation. Contrasts with: one-time hardware cost focus.

  • Redundancy Planning Builds on: system reliability and fault tolerance. Leads to: high-availability architectures and disaster recovery. Contrasts with: single-point-of-failure designs.

See Also

Related Interactive Tools:

  • Protocol Selector Wizard - Choose connectivity protocols based on your architecture constraints
  • Learning Paths - Get personalized curriculum recommendations for system design
  • IoT Games Hub - Reinforce architecture trade-off decisions through challenge rounds

Architecture Deep Dives:

  • IoT Reference Models - Standard architecture frameworks and patterns
  • Edge-Fog Computing - When to process at edge vs cloud
  • Integration Gateways - Protocol translation and aggregation patterns

Cost and Business Planning:

  • IoT Business Models - Monetization and revenue strategies
  • Simulation Catalog - Find calculators and planning tools

Implementation Guides:

  • Capstone Projects - Build complete end-to-end systems
  • Simulation Playground - Test architectures virtually

36.26 Check Your Understanding

36.26.1 Match Architecture Layers to Their Primary Responsibility

36.26.2 Order: IoT Architecture Design Process

36.26.3 Label the Diagram

36.27 Practice the Architecture Record

36.27.1 Code Challenge

36.27.2 Order the Steps

Physics PhoebeCheckpoint: Architecture Record

You now know:

  • Cost estimates combine hardware, cloud services, and connectivity; the chapter’s edge-filtering example moves 43.95 MB/month toward about 13.2 MB/month after 70% filtering.
  • Recommendations are warnings to test, not automatic approvals.
  • A complete architecture record names components, assumptions, data flow, security measures, and validation tasks in order.

36.27.3 Match the Concepts

36.28 Deep Dive: Place Computation Where the Constraint Lives

An IoT architecture spans sensing, networking, processing, cloud, and application layers, but the decision that shapes cost and behavior most is where computation runs. The same analytics can execute on the device, at the edge through a nearby gateway, or in the cloud. Each placement trades a different set of properties.

Push work toward the device and you gain low latency, offline autonomy, and privacy, but you are limited by compute and battery. Push it to the cloud and you gain large-scale storage, analytics, and fleet-wide visibility, but you pay in latency, bandwidth, connectivity dependence, and exposure of raw data. The edge sits between those extremes.

Three-tier IoT architecture showing edge devices and sensors, a fog layer for edge compute, aggregation, local cache, and gateways, and a cloud layer for storage, analytics, applications, and management.
Use the edge, fog, and cloud tiers as a placement record: immediate sensing and actuation stay low, local aggregation and offline decisions sit in the fog or gateway layer, and fleet analytics plus management live in the cloud.

36.28.1 Compare the Three Tiers

Property On-device Edge / gateway Cloud
Latency Lowest, often milliseconds Low on the local network Highest because of the internet round trip
Compute and storage Very limited Moderate Effectively elastic
WAN bandwidth Minimal when only results leave the device Reduced by aggregation Highest when raw data is uploaded
Privacy Data can stay local Data can stay on-site Raw or detailed data may leave the premises
Offline operation Can keep working Can keep the site working Depends on connectivity

A supermarket cold-room monitor shows the split. It may read DS18B20 or SHT31 probes every few seconds, trigger a local buzzer when temperature crosses a food-safety threshold, and publish summaries to a cloud dashboard. The alarm decision belongs on the device or gateway because staff need it during an internet outage. The hourly trend, cross-site comparison, and maintenance report can live in the cloud because they need storage and fleet context more than millisecond timing.

Video analytics creates the same pressure. Streaming raw 1080p video to the cloud for hazard detection costs large amounts of bandwidth, adds latency, and ships sensitive footage off-site. Running the detection model on a gateway or camera means only a compact event travels upstream: timestamp, camera ID, confidence score, and a short retained clip when policy allows. The cloud still aggregates events and retrains models, but it should not sit in the real-time inference path.

36.28.2 Hybrid Systems Need State Ownership

The device-vs-edge-vs-cloud choice is rarely all-or-nothing. Strong architectures are hybrids that place each function where it fits: filter and threshold on the device, aggregate and run time-critical logic at the edge, then store, analyze across sites, and train models in the cloud. Data gets smaller and less time-sensitive as it moves up the tiers.

A building HVAC system can run its per-room control loop on local controllers so comfort continues during WAN loss, have the site gateway aggregate zone data and enforce schedules, and send hourly summaries to the cloud for cross-building optimization and fault prediction. Each tier does the job it is suited for, and the architecture degrades gracefully instead of failing when the cloud link drops.

The hidden mechanism is ownership of state. The room controller owns immediate actuator state, the gateway owns site schedule and buffered telemetry, and the cloud owns fleet models and reporting history. Each handoff should name message schema, retry behavior, timestamp source, and stale-data rules. Without that ownership map, a hybrid design can become three partial systems that disagree during an outage.

Validate the placement by forcing failures: disconnect WAN, restart the gateway, replay delayed messages, and confirm the room controller still follows local limits while the cloud marks the site data as stale.

36.29 Summary

The IoT Architecture Planner helps you design complete IoT systems:

  • 5-layer design covering sensing, network, processing, cloud, and application
  • Data volume estimation based on sensors, frequency, and message size
  • Cost projection for hardware and ongoing services
  • Edge vs. cloud trade-offs with automatic recommendations
  • Pattern matching to relevant architecture approaches
Key Architecture Principles
  1. Start small, scale up - Begin with proven patterns, add complexity as needed
  2. Design for failure - Assume components will fail; build redundancy
  3. Secure by design - Security is not an afterthought
  4. Optimize data flow - Process at the edge when possible to reduce costs
  5. Plan for evolution - Requirements change; choose flexible architectures
For Kids: Meet the Sensor Squad!

Sammy the Sensor is excited! “I want to build the BIGGEST IoT system ever!” he shouts.

Max the Microcontroller laughs. “Whoa, slow down! Building a great IoT system is like planning an awesome school project. You need a plan!”

“First,” says Lila the LED, “you pick what you want to SENSE – like temperature, motion, or light. That’s the sensing layer!”

“Then,” adds Max, “you figure out HOW to send your data. Wi-Fi? Bluetooth? LoRa? That’s the network layer!”

Bella the Battery pipes up: “And don’t forget about me! If you process data close to the sensors (at the ‘edge’), I last longer because you don’t have to send everything far away to the cloud!”

“So an IoT architecture is like a relay race,” Sammy says. “Sensors collect data, the network passes it along, the processor does something smart with it, the cloud stores it, and the app shows it to people!”

“Exactly!” cheers the whole Squad. “Layers working together – that’s architecture!”

Fun fact: The biggest IoT systems in the world (like smart cities) have MILLIONS of sensors all working together through these five layers!

35  Protocol Selector Wizard
37  How to Read Research Papers