11  Architecture Applications

In 60 Seconds

Architecture selection is driven by constraints: safety-critical systems (<50ms latency) need edge processing, while tolerant systems (minutes-hours) can use cloud-only. LoRaWAN saves $40,000+ over 3 years vs. NB-IoT ($3-5/device/month) for 400+ sensor deployments in one area. Hybrid architectures are the norm in production – real systems combine industrial (ISA-95) and consumer (Matter/Thread) architectures with a secure integration layer.

Minimum Viable Understanding
  • Architecture selection is driven by constraints: safety-critical systems (<50ms latency) need edge processing, while tolerant systems (minutes-hours) can use cloud – never force a single architecture on mixed requirements.
  • Connectivity economics dominate long-term cost: LoRaWAN (one-time gateway investment) saves $40,000+ over 3 years compared to NB-IoT ($3-5/device/month) for 400+ sensor deployments in a single area.
  • Hybrid architectures are the norm: real-world systems often combine industrial (ISA-95) and consumer (Matter/Thread) architectures with a secure integration layer between domains.

The Sensor Squad was hired for four very different missions, and each one needed a different plan!

Mission 1 – The Factory: Sammy the Sensor was placed on a giant machine. β€œIf I detect something dangerous, Max the Microcontroller needs to stop the machine in 50 milliseconds – that is faster than a blink! We can’t wait for a message to travel to the cloud and back.”

Mission 2 – The Farm: Bella the Battery powered sensors spread across hundreds of acres. β€œI need to last 3 years out here! We chose LoRaWAN because it is free to use after buying one gateway, instead of paying $3 per sensor per month for cellular.”

Mission 3 – The Smart Home: Lila the LED was part of a cozy home setup. β€œWe use Matter/Thread protocol so all the smart devices – lights, locks, thermostat – work together, no matter who made them!”

Mission 4 – The Smart City: All four squad members worked together across 50,000 sensors. β€œThe traffic cameras need fast AI at the edge, the air quality sensors can report slowly to the cloud, and the parking meters need real-time updates. We needed a multi-tier architecture because no single approach fits everything!”

The lesson: There is no one-size-fits-all IoT architecture. Always let your specific requirements (speed, cost, battery life, scale) guide your architecture choice!

11.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Apply architecture selection criteria to real industrial, environmental, consumer, and smart city scenarios
  • Evaluate LoRaWAN vs NB-IoT connectivity trade-offs using 3-year TCO analysis
  • Design appropriate network topologies (star vs mesh) for different deployment scales
  • Justify cost-benefit trade-offs in architecture decisions with quantitative evidence

11.2 Prerequisites

Before diving into this chapter, you should be familiar with:

Key Concepts

  • Vertical Application: An IoT deployment targeting a specific industry domain (smart home, industrial, healthcare, smart city) with domain-specific protocols, certifications, and regulatory requirements
  • Smart Home Architecture: A local-first hub-and-spoke topology using short-range protocols (Zigbee, Z-Wave, Matter) with cloud connectivity for remote access and analytics
  • Industrial IoT (IIoT): IoT deployments in manufacturing and industrial settings requiring sub-millisecond determinism, safety certification, harsh environment hardware, and integration with OT systems (SCADA, DCS, PLCs)
  • Smart City Platform: A multi-tenant IoT platform integrating heterogeneous city systems (traffic, utilities, waste, public safety) under unified data governance and open data standards
  • Digital Twin: A virtual model synchronized with a physical asset’s real-time sensor data, enabling monitoring, simulation, and predictive analytics without physical access to the asset
  • Asset Tracking: IoT pattern combining GPS/BLE/RFID with cloud backend to monitor location, condition, and status of mobile assets (vehicles, containers, equipment) across geographic areas

11.3 Introduction

Think of it like choosing transportation for different trips:

Trip Best Transport Why IoT Equivalent
Walk to next room Walk Short, fast, free Edge processing (local, instant)
Commute to work Bus/train Regular, shared route Fog computing (regional, shared)
International travel Airplane Long distance, scheduled Cloud computing (global, batched)

You would not take an airplane to walk to the next room. Similarly, you would not send factory safety data to the cloud when it needs a 50ms response – process it locally at the edge instead!

Each IoT project has different β€œtrips” for its data, so it needs a different combination of edge, fog, and cloud processing.

This chapter applies the architecture selection framework to real-world scenarios across multiple industries. Each example demonstrates how scale, latency, connectivity, and data volume requirements drive specific architecture decisions.

11.4 Example 1: Smart Factory (Industrial)

  • Scale: 5,000 devices (Medium)
  • Latency: < 50ms for critical control loops (Ultra-low)
  • Connectivity: Wired Ethernet (Reliable)
  • Data Volume: 50 GB/day (Medium-high)
  • Domain: Industrial/Manufacturing

Decision Path: Medium Scale β†’ Reliable connectivity β†’ Industrial domain

Recommended Architecture: Industrial IoT Reference Architecture (ISA-95)

  • Edge controllers for real-time machine control
  • Fog layer for factory-floor analytics
  • Cloud for enterprise integration and long-term storage
  • OPC UA for interoperability

11.5 Example 2: Wildlife Monitoring (Agriculture/Environmental)

  • Scale: 200 devices (Medium)
  • Latency: Minutes to hours acceptable (Standard)
  • Connectivity: Intermittent (cellular, solar-powered)
  • Data Volume: 500 MB/day (Low)
  • Domain: Agriculture/Environmental

Decision Path: Medium Scale β†’ Intermittent connectivity β†’ Agriculture domain

Recommended Architecture: WSN-based with Fog Computing

  • Battery-powered sensor nodes with sleep cycles
  • Gateway with local storage for offline periods
  • LoRa or NB-IoT for long-range communication
  • Cloud for data analysis and visualization

11.6 LoRaWAN vs NB-IoT Connectivity Trade-offs

Tradeoff: LoRaWAN vs NB-IoT for Remote Sensor Deployments

Option A (LoRaWAN): Unlicensed spectrum (868/915 MHz), free to operate after gateway investment. Range: 2-15km rural, 1-5km urban. Data rate: 0.3-50 kbps. Power: 10-year battery life possible. Latency: seconds to minutes (class A devices).

Option B (NB-IoT): Licensed cellular spectrum, requires carrier subscription ($1-5/device/month). Range: same as cellular coverage. Data rate: 20-250 kbps. Power: 10-year battery life. Latency: 1-10 seconds with better reliability.

Decision Factors:

  • Choose LoRaWAN when: You control the deployment area and can install gateways, device count exceeds 1,000 where per-device cellular fees become prohibitive ($12,000-60,000/year), data rates under 50 kbps are sufficient, or you need to operate in areas without cellular coverage.

  • Choose NB-IoT when: Devices are geographically dispersed (no gateway coverage), existing cellular infrastructure provides adequate coverage, you need carrier-grade reliability (99.9% SLA), higher data rates (100+ kbps) are required, or total device count is under 500 where carrier fees are acceptable.

  • Hybrid approach: Deploy LoRaWAN for dense clusters (farms, campuses) and NB-IoT for isolated remote sites. Gateway cost: $500-2,000 covers 100-1,000 LoRaWAN devices. NB-IoT makes sense for <50 devices in an area or when cellular already exists.

Interactive: LoRaWAN vs NB-IoT Cost Calculator

Adjust the inputs to compare 3-year total cost of ownership between connectivity options.

11.7 Star vs Mesh Topology Trade-offs

Tradeoff: Star Topology vs Mesh Topology for Sensor Networks

Option A (Star Topology): All sensors connect directly to a central gateway. Simpler architecture, predictable latency (single hop: 5-50ms), easier troubleshooting. Gateway is single point of failure. Range limited to gateway coverage (50-200m indoor, 1-10km outdoor depending on technology).

Option B (Mesh Topology): Sensors relay messages through each other to reach gateway. Extended range (multi-hop extends coverage), self-healing (routes around failed nodes), better coverage in complex environments. Higher complexity, variable latency (50-500ms for multi-hop), increased power consumption for relay nodes.

Decision Factors:

  • Choose Star when: Deployment area fits within single gateway range, latency must be predictable and low (<100ms), all sensors are battery-powered (no relay burden), network topology is stable, or simplicity is valued over coverage flexibility.

  • Choose Mesh when: Coverage area exceeds single gateway range, physical obstacles block direct communication (warehouses, forests), network must self-heal from node failures, some nodes can be mains-powered to serve as reliable relays, or deployment area may expand unpredictably.

  • Power impact: Star topology sensors with 1 message/hour achieve 5-10 year battery life. Mesh relay nodes forwarding 50 messages/hour reduce to 6-18 month battery life. Use mains power or solar for mesh relay nodes, battery for leaf nodes only.

Let’s do a detailed 5-year total cost of ownership (TCO) analysis for LoRaWAN vs NB-IoT across different farm sizes.

Scenario: Soil moisture sensors transmitting 2Γ— daily, 3-year battery life target.

\[\text{NB-IoT Monthly Cost} = N_{\text{sensors}} \times \$3/\text{month}\]

\[\text{NB-IoT 5-year TCO} = N_{\text{sensors}} \times \$3 \times 60\text{ months} = N_{\text{sensors}} \times \$180\]

\[\text{LoRaWAN Infrastructure} = N_{\text{gateways}} \times \$800 + \$200\text{ network server}\]

Gateway coverage: Each gateway covers Ο€rΒ² = Ο€(5km)Β² β‰ˆ 78.5 kmΒ² β‰ˆ 19,400 acres.

For 400 sensors on 200 acres (< 1 kmΒ²):

  • LoRaWAN: 1 gateway ($800) + network server ($200) = $1,000 total
  • NB-IoT: 400 Γ— $180 = $72,000 total
  • Savings: $71,000 (98.6% cheaper with LoRaWAN!)

\[\text{Break-even point} = \frac{\$1,000}{\$3/\text{month}} = 333\text{ sensor-months} = 28\text{ sensors for 1 year}\]

For any deployment with > 28 sensors lasting > 1 year, LoRaWAN is cheaper. With 400 sensors, LoRaWAN pays for itself in just 0.83 months!

Battery life bonus: LoRaWAN Class A transmission uses ~50 mAh/year, while NB-IoT uses ~80 mAh/year (60% more). With a 2,000 mAh battery: LoRaWAN = 40 years, NB-IoT = 25 years (both exceed 3-year replacement target).

11.8 Example 3: Smart Home Automation

  • Scale: 50 devices (Small)
  • Latency: < 500ms for responsiveness (Low)
  • Connectivity: Wi-Fi (Reliable)
  • Data Volume: 100 MB/day (Low)
  • Domain: Consumer/Smart Home

Decision Path: Small Scale β†’ Low latency β†’ Smart Home domain

Recommended Architecture: Hybrid Edge-Cloud (Matter/Thread)

  • Local hub for immediate control
  • Cloud for remote access and automation rules
  • Standard protocols (Matter) for interoperability
  • Voice assistant integration

11.9 Example 4: Smart City Traffic Management

  • Scale: 50,000 sensors/cameras (Large)
  • Latency: 1-5 seconds for traffic adaptation (Low)
  • Connectivity: Mixed (fiber, cellular, Wi-Fi)
  • Data Volume: 500 GB/day (Very high)
  • Domain: Smart City

Decision Path: Large Scale β†’ High data volume β†’ Smart City domain

Recommended Architecture: Distributed Multi-Tier

  • Edge cameras with local AI for vehicle detection
  • Intersection controllers for real-time signal coordination
  • District fog nodes for area-wide optimization
  • Central cloud for city-wide analytics and planning
  • Open APIs for third-party integration

11.10 Multi-Architecture Hybrid Systems

Some systems have conflicting requirements that necessitate combining architectures:

  • Factory + Smart Building: Industrial IoT for production equipment, consumer IoT for office spaces
  • Healthcare + Home: Medical-grade for patient monitoring, consumer-grade for ambient assisted living
  • Agriculture + Supply Chain: WSN for field sensing, enterprise IoT for logistics tracking

When architecting an IoT system, one of the most critical decisions is where to process data. This framework guides you through the decision systematically.

Step 1: Map Your Requirements

Create a requirements matrix for your system:

Requirement Measurement Threshold Decision Weight
Latency Time from sensor β†’ action < 100ms = edge required; 100ms-2s = fog optional; > 2s = cloud acceptable Critical (40%)
Data Volume Daily data generated < 1 GB/day = cloud direct; 1-100 GB = fog filter; > 100 GB = edge mandatory High (25%)
Connectivity Network reliability Always-on = cloud OK; intermittent = fog buffer; offline periods = edge autonomous High (20%)
Device Count Total endpoints < 100 = cloud direct; 100-10K = fog aggregate; > 10K = edge hierarchical Medium (10%)
Data Privacy Regulatory constraints Public data = cloud OK; PII = fog process locally; HIPAA/regulated = edge only Critical (5%)

Step 2: Calculate Architecture Score

For Farm Environmental Monitoring (200 soil sensors):

  • Latency: Hourly reporting acceptable (> 2s) β†’ Cloud = 10/10 | Fog = 10/10 | Edge = 5/10 (overkill)
  • Data Volume: 200 sensors Γ— 12 bytes Γ— 24 readings = 57.6 KB/day β†’ Cloud = 10/10 | Fog = 10/10 | Edge = 5/10
  • Connectivity: Cellular with occasional gaps β†’ Cloud = 5/10 | Fog = 10/10 | Edge = 8/10
  • Device Count: 200 β†’ Cloud = 6/10 | Fog = 10/10 | Edge = 8/10
  • Data Privacy: Soil readings are public β†’ Cloud = 10/10 | Fog = 10/10 | Edge = 10/10

Weighted Score:

  • Cloud-Centric: (10Γ—0.4) + (10Γ—0.25) + (5Γ—0.2) + (6Γ—0.1) + (10Γ—0.05) = 8.6/10 ← Best fit
  • Fog Computing: (10Γ—0.4) + (10Γ—0.25) + (10Γ—0.2) + (10Γ—0.1) + (10Γ—0.05) = 10/10 ← Overengineered
  • Edge Processing: (5Γ—0.4) + (5Γ—0.25) + (8Γ—0.2) + (8Γ—0.1) + (10Γ—0.05) = 6.8/10

Verdict: Cloud-centric with LoRaWAN gateway acting as simple relay (not fog compute). The intermittent connectivity slightly favors fog but does not justify the added complexity for tolerant-latency applications.

Step 3: Cost-Benefit Analysis

Architecture Infrastructure Cost Monthly Opex Development Complexity Maintenance Burden
Cloud-Centric $500 (LoRaWAN gateway) $50 (cloud hosting for 200 devices) Low (standard REST APIs) Low (single update target)
Fog Computing $2,000 (edge server + redundancy) $80 (cloud + fog power/cooling) Medium (fog orchestration, sync) Medium (2-tier updates)
Edge Processing $8,000 (edge nodes per zone) $120 (edge + cloud tiers) High (distributed logic) High (update 20+ edge nodes)

3-year TCO:

  • Cloud: $500 + ($50 Γ— 36) = $2,300
  • Fog: $2,000 + ($80 Γ— 36) = $4,880
  • Edge: $8,000 + ($120 Γ— 36) = $12,320

For tolerant-latency applications, fog costs 2.1Γ— and edge costs 5.4Γ— more than cloud-centric with minimal functional benefit.

Step 4: Decision Tree

START: What is your latency requirement?
β”‚
β”œβ”€ < 100ms (safety-critical)
β”‚   └─ EDGE mandatory (local PLC, no cloud dependency)
β”‚
β”œβ”€ 100ms - 2s (responsive but not critical)
β”‚   └─ Data volume?
β”‚       β”œβ”€ > 100 GB/day β†’ FOG (filter at gateway)
β”‚       └─ < 100 GB/day β†’ Is connectivity reliable?
β”‚           β”œβ”€ Yes β†’ CLOUD (simplest)
β”‚           └─ No β†’ FOG (buffer during outages)
β”‚
└─ > 2s (tolerant)
    └─ Connectivity?
        β”œβ”€ Offline periods > 1 hour β†’ FOG (autonomous operation)
        └─ Intermittent OK β†’ CLOUD (with device buffering)

Common Pitfalls:

  1. Edge for the sake of edge: β€œWe want to be cutting-edge” is not a valid architectural driver. Edge adds 3-5Γ— cost and 2-3Γ— complexity. Only use when latency, bandwidth, or privacy requirements mandate it.

  2. Ignoring network costs: Cloud-centric with cellular backhaul for 1,000 devices at 1 GB/device/month = $3,000-5,000/month (NB-IoT data plans). Fog filtering to 10 MB/device saves $2,500/month, paying for fog infrastructure in 9 months.

  3. Premature optimization: Start cloud-centric for MVP (fastest time-to-market). Measure actual latency, bandwidth, and cost in production. Migrate to fog/edge only when metrics prove the need.

Real-world validation: A smart building pilot started with cloud-centric HVAC control (2-minute latency acceptable). At 5,000-device scale, network costs hit $800/month. They added fog gateways for local aggregation, reducing bandwidth 90% and cloud costs to $120/month. The $4,000 fog infrastructure paid for itself in 6 months. Key insight: let actual data (not assumptions) drive the cloud→fog→edge migration decision.

How It Works: LoRaWAN Gateway Economics at Scale

Understanding why LoRaWAN becomes cost-effective at 400+ sensors in a concentrated area.

LoRaWAN Architecture:

  1. Sensors transmit to gateway (unlicensed 868/915 MHz, 2-15km range)
  2. Gateway forwards messages to network server via internet (LTE/Ethernet backhaul)
  3. Network server (cloud) routes to application servers
  4. No per-device cellular fees β€” only gateway needs internet connectivity

Cost Breakdown (400 sensors, 3 years):

Cost Component LoRaWAN NB-IoT Cellular
Gateway hardware $2,000 (one-time, covers 400 sensors) $0 (uses carrier network)
Gateway backhaul $50/month Γ— 36 months = $1,800 N/A
Per-sensor connectivity $0 (unlicensed spectrum) 400 Γ— $3/month Γ— 36 = $43,200
Network server $200/year Γ— 3 = $600 (self-hosted LoRa Server) Included in carrier fee
Total 3-year TCO $4,400 $43,200
Cost per sensor $11 over 3 years $108 over 3 years

Break-Even Analysis:

  • Fixed costs (LoRaWAN): $2,000 gateway + $1,800 backhaul + $600 server = $4,400
  • Variable costs (NB-IoT): $3/month per sensor Γ— 36 months = $108 per sensor
  • Break-even: $4,400 / $108 = 41 sensors

Key Insight: LoRaWAN is cheaper when you have 41+ sensors within one gateway’s coverage area. Below 41 sensors, NB-IoT’s zero upfront cost is more economical. For 1,000 sensors, LoRaWAN saves $103,600 over 3 years!

Trade-off: LoRaWAN requires self-managing the gateway (firmware updates, monitoring), while NB-IoT delegates infrastructure to the carrier. Choose LoRaWAN when cost savings justify operational overhead.

Objective: Apply the architecture selection framework to a real-world scenario.

Scenario: You’re deploying parking sensors across a 10-block downtown area. Requirements:

  • 500 parking spaces (500 sensors)
  • Report occupancy changes within 5 seconds
  • Battery-powered (5-year target life)
  • City has public Wi-Fi (50% coverage), good LTE coverage (95%), no LoRaWAN infrastructure

Step 1: Map Requirements

Requirement Measurement Architecture Implication
Scale 500 sensors Medium scale β€” edge aggregation beneficial
Latency 5 seconds Tolerant β€” cloud processing acceptable
Connectivity Wi-Fi (50%), LTE (95%) Mixed β€” need fallback strategy
Battery Life 5 years Low-power protocol essential
Data Volume 500 Γ— 10 messages/day = 5,000 msg/day Low bandwidth β€” any protocol works

Step 2: Connectivity Decision

Evaluate three options:

  1. Wi-Fi: 50% coverage inadequate. Sensors in uncovered areas fail.
  2. NB-IoT: 95% coverage. Cost: 500 Γ— $3/month Γ— 60 months = $90,000. Battery life: 5-10 years achievable.
  3. Deploy LoRaWAN: Install 3-5 gateways ($2,000 each) for 100% coverage. Cost: $10,000 gateways + $3,600 backhaul (3Γ— LTE SIMs) + $600 network server = $14,200. Battery life: 10+ years.

Step 3: Calculate Your Decision

  • Option A (NB-IoT): $90,000 over 5 years. Zero infrastructure effort. Carrier-managed.
  • Option B (LoRaWAN): $14,200 over 5 years. Requires managing 3-5 gateways. Saves $75,800.

What to Observe: At 500 sensors, LoRaWAN’s upfront investment pays for itself in 6 months ($14,200 / ($90,000/60 months)). The break-even point for LoRaWAN vs NB-IoT is ~80 sensors in this scenario.

Your Task: Modify the scenario for 50 sensors (one parking garage). Recalculate β€” you’ll find NB-IoT becomes cheaper ($9,000 vs $6,200 for minimal LoRaWAN setup). This demonstrates how scale drives connectivity decisions.

Common Pitfalls

A smart factory and a wildlife monitoring system have fundamentally different requirements: the factory needs sub-second latency and deterministic messaging; the wildlife tracker needs multi-year battery life and sparse connectivity. Using the same 3-layer architecture for both will over-engineer one and under-serve the other. Always map requirements to architecture.

Healthcare IoT requires HIPAA compliance and fail-safe redundancy. Agriculture IoT must handle intermittent connectivity in rural areas. Industrial IoT requires compliance with IEC 62443 security standards. Ignoring domain constraints during architecture selection leads to expensive redesigns after deployment.

Real-world IoT deployments encounter failed sensors, network partitions, power outages, and device tampering. An architecture that performs perfectly under normal conditions but lacks graceful degradation will fail in production. Build fault tolerance and offline operation into the architecture from the beginning.

A successful 50-sensor pilot in controlled conditions does not validate an architecture for 50,000 sensors in diverse environments. Pilots rarely expose protocol scalability limits, security vulnerabilities under adversarial conditions, or maintenance burden over years. Plan architecture validation at 10x the pilot scale before committing to full deployment.

11.11 Summary

Real-world IoT deployments demonstrate that architecture selection must be driven by specific requirements:

Scenario Key Constraints Architecture Choice
Smart Factory Safety (<50ms), reliability ISA-95 with edge PLCs
Wildlife Monitoring Power, intermittent connectivity WSN + fog computing
Smart Home User experience, interoperability Matter/Thread hybrid
Smart City Scale, multi-domain, open APIs Multi-tier with IoT-A

Key insights:

  • Connectivity economics (LoRaWAN vs NB-IoT) significantly impact 3-5 year TCO
  • Topology choices (star vs mesh) affect both battery life and coverage
  • Hybrid architectures are common when requirements span industrial and consumer domains
  • Edge processing is mandatory for high data volume + low latency combinations

11.12 Concept Relationships

Concept Relationship Connected Concept
LoRaWAN Becomes cost-effective at 400+ sensors in one area (break-even vs NB-IoT cellular subscriptions)
Star Topology Requires Single-hop coverage within gateway range (50-200m indoor, 1-10km outdoor)
Mesh Topology Enables Extended range via multi-hop but shortens battery life 50-80% for relay nodes
Edge Processing Mandatory when Data volume >100 GB/day OR latency requirement <100 ms
Fog Computing Provides Regional aggregation for 100-10K device clusters before cloud transmission
Multi-Architecture Systems Common in Mixed domains (industrial + consumer) requiring different safety/UX standards
NB-IoT Preferred for Sparse deployments (<100 sensors) or wide geographic dispersion without gateway coverage

11.13 See Also

Architecture Fundamentals:

Connectivity Technologies:

  • LoRa & LoRaWAN - Technical deep dive on LoRaWAN network architecture and economics
  • Cellular IoT - NB-IoT and LTE-M coverage, power, and cost characteristics

System Design:

11.14 Knowledge Check

11.15 What’s Next

If you want to… Read this
Study common architectural mistakes Common Pitfalls and Best Practices
Select the right architecture for your use case Architecture Selection Framework
Learn about edge-fog computing architectures Edge and Fog Computing
Explore WSN architecture patterns Wireless Sensor Networks
Study QoS for production IoT QoS and Service Management