Skip to content

14.1 Overview of the Full Project Lifecycle

14.1.1 Requirements Analysis Methodology

An IoT project is more likely to die in the requirements phase than in the coding phase. The reason is not that the team writes bad code, but that the project never reached consensus at kickoff on "whose problem, and what problem, this system is actually meant to solve." An IoT project's stakeholders run from hardware, embedded systems, and networks through the platform to business applications — device vendors care about protocol adaptation and firmware OTA, operations teams care about whether offline devices can self-recover, business departments care about data reports and alarm notifications, and finance cares about total cost of ownership. Translating these demands from different dimensions into engineerable requirement items is the first hurdle of requirements analysis.

The Four Sources of Requirements Elicitation

Requirements capture for an IoT project cannot rest on user interviews or a PRD (product requirements document) alone. Effective elicitation covers at least four sources.

  • Interviews with users and business stakeholders: aimed at the business operators, operations teams, and business decision-makers who will actually use the system, to understand the real pain points of daily work. This layer produces scenario-level requirements, such as "an alarm must be pushed within 5 minutes of a device going offline."
  • Device and site surveys: investigating the physical constraints of the actual deployment environment. The metal equipment enclosures in an SMT workshop block wireless signals, and the high temperature of the reflow-oven zone directly constrains where sensors can be mounted and how they are powered. Constraints like these never appear in a pure-software project, yet they directly determine protocol selection and the collection strategy.
  • Analysis of existing systems: if the project must integrate with the enterprise's ERP, MES, or SCADA systems, the data interfaces, communication protocols, field mappings, and historical-data migration requirements must all be sorted out. Cases that get stuck at the data-integration step after go-live are usually caused by legacy systems whose interface documentation does not match reality.
  • Industry standards and compliance requirements: retention periods for connected-vehicle trajectory data, safety-level certification for industrial sites, data-privacy compliance for medical devices — these are not questions of "whether it can be done" but of "without it, the system cannot go live."

Functional Requirements: From Scenarios to Items

Functional requirements describe what the system "does." For an IoT platform, a practice-tested approach is to derive use cases with an asset-lifecycle review method: identify the required capabilities stage by stage — from the device leaving the factory, through deployment, operation, and maintenance, to retirement — rather than listing them by module.

The rest of this section works through the methodology with an electronics-manufacturing case: a mid-sized electronics manufacturing plant with about 2,000 devices, including SMT placement machines, reflow ovens, AOI (Automated Optical Inspection) units, and temperature/humidity sensors; some of the devices run Modbus TCP, some output only serial data, and a few aging devices use a custom binary protocol. Starting with Section 14.2, this case will be carried end-to-end into hands-on practice on IoT DC3. The following are some of the functional requirements sorted out with the asset-lifecycle review method:

  • Device deployment stage: bulk device registration, protocol-driver binding (Modbus TCP, serial, and MQTT side by side), bulk point-table import and validation.
  • Device operation stage: real-time data collection (oven temperature, workshop temperature and humidity, device status words), device online-status monitoring, production-line dashboard data push.
  • Device alarm stage: oven-temperature over-limit alarms, device-offline alarms, alarm severity tiers and push channels (shop-floor dashboard/WeChat Work/email).
  • Device maintenance stage: firmware and driver version management, remote delivery of configuration parameters, remote pulling of device logs.
  • Device retirement stage: device deregistration, data archiving, secure erasure.

This list is not produced in one pass; it takes several rounds of iteration and pruning. One common error is over-stacking in the requirements phase: being able to monitor reflow-oven temperature is a legitimate requirement, but "automatically correcting the process parameters from the oven temperature" is a pseudo-requirement as long as the plant does not yet have the safety assessment and permission foundation needed to write platform decisions into the production-line control system. Another trap is omitting the functional scenarios behind "non-functional constraints" — for example, the deduplication logic when registering about 2,000 devices in bulk, or the throttling strategy during an alarm storm. In an asset-lifecycle review these usually land in the operation stage, but the concrete functional items must be confirmed separately with the operations team.

Non-Functional Requirements: The Hidden Killer of IoT Projects

Non-functional requirements are easier to ignore early on, yet in IoT systems they often decide the architecture choices and the cost structure.

  • Reliability: how should the system behave when devices keep losing their connections? Which MQTT (Message Queuing Telemetry Transport) QoS level should be chosen? Can edge nodes cache data while offline and synchronize once the network recovers? Behind these choices lies a quantified definition of the reliability level. In industrial scenarios, "total annual unavailability time" or "data-loss rate" usually serve as the metrics.
  • Security: from device identity authentication (X.509 certificate or token), to communication encryption (which TLS version), to data-storage encryption (database level or field level), to access control (RBAC or ABAC) — the investment in each dimension is bounded by cost and compliance requirements. One common judgment call: for a consumer-electronics platform, certificates cost too much, and a token plus a device key is the more pragmatic choice; for industrial IoT (IIoT), certificate-chain management and secure elements are the baseline.
  • Scalability: initially connecting 1,000 devices and possibly connecting 100,000 devices in the future lead to completely different architecture choices. Scalability is not "supports a million connections" but "how many concurrent connections, at what cost." The requirements phase must give an order-of-magnitude range (for example, "device count grows no more than 5x within 3 years"); otherwise the architect can only design for the worst case, and costs run out of control.
  • Real-time performance: from device data being generated to the platform finishing processing — is the end-to-end latency requirement on the order of seconds, milliseconds, or minutes? Industrial control scenarios demand far more real-time performance than environmental monitoring. "Data-collection latency" and "alarm-delivery latency" must be distinguished: the former is decided by the network and the device, the latter by the platform's processing chain, and the two should not be conflated.

Prioritizing Requirements: MoSCoW in Engineering Practice

Once the requirement items are screened, priorities must be assigned. The MoSCoW method is a natural fit for IoT projects with constrained resources and a clear delivery cadence.

  • Must have: without it the system cannot go live or the security goals cannot be met — for example, device access authentication, point value persistence, and device online status with offline alarms. For this factory case, oven-temperature over-limit alarms bear directly on production-line safety and response time, and belong in Must as well.
  • Should have: important but deferrable by one iteration — for example, flexible configuration of alarm rules, device group management.
  • Could have: nice-to-have capabilities — for example, custom device labels, varied chart types on the data-visualization dashboard.
  • Won't have this time: capabilities explicitly excluded from this delivery's scope — for example, model-based predictive maintenance (the first round only builds a statistical baseline), the device shadow, and multi-tenant isolation.

One engineering judgment: for an IoT platform's first delivery, narrow the Must-have list to the minimum. Every extra Must-have item adds a measure of architectural complexity and testing cost. Better to demote a feature from Must to Should and get the end-to-end chain running first than to stack requirements into the first release. One common cause of IoT project failure is not too few features but a first-release Must-have list so long that the delivery cycle stretches beyond what is acceptable.

The Engineering Boundary of This Section

What the requirements-analysis phase produces is not a "complete" requirements document — completeness is a myth: in IoT scenarios, protocol evolution, hardware iteration, and business change keep refreshing the requirements. The effective output is an actionable requirements baseline and an explicit "what we will not do" list. The latter is often more valuable than the former. How to map it into the system architecture design is the subject of the sections that follow; Section 14.2 will use IoT DC3 and this factory case to walk the complete chain from architecture to deployment.

Figure 14-1 Four Requirement Sources & the Asset Lifecycle ReviewRequirements come from interviews, site surveys, existing systems, and industry regulations; the asset-lifecycle review derives functional requirements.Figure 14-1 Four Requirement Sources & the Asset Lifecycle ReviewThe effective output is an actionable requirements baseline plus an explicit not-to-do listFour Sources of RequirementsUser & Business InterviewsOperations, ops staff, and business decision-makersYield scenario-level requirements"An offline device must alert within 5 minutes"Device & Site SurveysPhysical constraints: metal shielding, power supplyDirectly drive protocol and collection strategyPure-software projects never face such constraintsExisting-System AnalysisERP / MES / SCADA Data InterfacesField mapping & historical data migrationInterface docs often mismatch realityIndustry Regulations & ComplianceTrace retention periods, security certificationMedical data privacy complianceNot "can we do it" but "no launch without it"Asset lifecycle review: derive use cases stage by stage, from factory shipment to retirementDeploymentBulk Registration · Gateway Auto-DiscoveryFirmware Version CheckOperationReal-Time Collection · Online StatusRemote On/Off ControlAlertingTemperature Limits · Device OfflineAlert Grading & PushMaintenanceOTA Firmware Upgrades · Parameter PushRemote Log PullRetirementDevice Deregistration · Data ArchivingSecure ErasurePrioritization (MoSCoW) & Non-Functional RequirementsMust haveMust-have or no launch: device identity auth, data persistence, online statusShould haveImportant but deferrable: flexible alert rules, device groupingCould / Won'tNice-to-have / explicitly excluded this round; keep the Must list minimalNon-Functional Requirements (the silent killer)Reliability · Security · Scalability · Real-TimeThey drive architecture choices and cost structure, and must be quantifiedFigure 14-1 Requirements come from four sources — interviews, site surveys, existing systems, and industry regulations; the asset-lifecycle review derives use cases stage by stage from deployment to retirement, MoSCoW then sets priorities, and non-functional requirements are quantified.
Figure 14-1 Four Requirement Sources & the Asset Lifecycle Review

14.1.2 Architecture Design Principles

Once requirements analysis settles "what to do," architecture design answers "how to do it most soundly." Architecture design for an IoT platform is not a one-time technology-selection meeting but a series of engineering trade-offs made under four principles: layering, decoupling, asynchrony, and standardization. The four principles support one another: layering defines system boundaries, decoupling limits the blast radius of changes, asynchrony isolates physical constraints, and standardization reduces integration friction.

Get these four principles right, and an IoT project can at least survive its first two rounds of architectural evolution.

Layered Architecture and Module Decoupling

Layering is the most fundamental principle of IoT architecture — and the one most often given only lip service. Many projects draw a beautiful layered diagram early on — device layer, network layer, platform layer, application layer — but when the real implementation lands, device-access logic calls database writes directly, alarm rules are hard-coded inside business services, and device management is mixed up with user permissions. Under this "layered on the diagram, stacked in the code" approach, nothing shows while the fleet is within a hundred devices; past a thousand, every modification ripples from the bottom all the way to the top.

The core constraint of a layered architecture: each layer may depend only on the layer directly beneath it — no cross-layer calls, no modifying the implementation details of a lower layer. An IIoT platform usually splits the platform layer internally into multiple center services — authorization, device management, data storage, intelligent analysis — so each service can scale up and down and be operated independently, without disturbing the change cadence of the other functional modules.

The most common engineering-judgment error in layering is trying to reserve interfaces for "every scenario that might appear in the future." The result: abstract adaptation layers stuffed between every two layers, and the real business logic drowning in conversion code. One usable rule of thumb: layer only along the system boundaries that are already clear, and use interface isolation in place of intermediate-layer isolation.

Protocol Adaptation for Device Access

Device access is where IoT architecture diverges most from ordinary internet architecture. An internet backend typically faces no more than ten client types, while an IIoT platform may simultaneously connect tens of thousands of device types running MQTT, CoAP (Constrained Application Protocol), HTTP, Modbus TCP, OPC UA (OPC Unified Architecture), or proprietary TCP protocols. Each protocol differs in connection model, heartbeat mechanism, security model, and message format.

The protocol adaptation layer must exist, and its design quality determines the southbound access cost of the entire platform.

In practice, protocol adaptation follows two strategies:

  • Protocol gateway mode: one unified gateway handles access and decoding for all protocols and routes between protocols internally. The advantage is that devices need no extra development work on their side; the disadvantage is that the gateway becomes the single-point bottleneck and the concentration point of complexity.
  • Protocol driver mode: each protocol corresponds to an independent driver service (a microservice), and drivers communicate asynchronously with the platform's center services through a message queue. This is the more recommended engineering approach today — drivers and center services evolve independently; a failing driver does not affect the cloud services, and vice versa. Drivers can be deployed close to the field, keeping wide-area network jitter outside the buffer of the message queue.

When choosing an access protocol, weigh the choice against the actual deployment scenario. MQTT is the first choice in most cases: it supports three QoS levels, retains offline messages for disconnected devices, has extremely low protocol-header overhead, and suits low-bandwidth, high-latency, unreliable networks. CoAP suits severely resource-constrained devices (microcontroller-based sensor nodes, for example): it runs over UDP, offers better real-time performance, but its reliability must be compensated at the application layer. HTTP long polling is usually used only between the device gateway and the cloud — exposing an HTTP interface directly on the device side is not safe.

Data-Flow Design: From Device to Storage to Decision

IoT data flow is a classic producer-consumer model, under which the traditional request-response architecture barely works. A device fleet reporting tens of thousands of readings per second, if written to the database one HTTP PUT at a time, will drain the connection pool rapidly and send database write performance into a steep decline.

The message queue is the standard solution to this problem. Once a message queue is introduced, the data flow becomes a three-stage pipeline: device → message queue → consumer service → storage system.

An MQTT broker and the platform's internal messaging port solve different problems: the former commonly serves device connections and Topic distribution, while the latter isolates protocol Drivers from platform consumers. Whether to cascade an internal broker should be decided by reliability, routing, peak shaving, and multi-consumer needs; "a few thousand devices" cannot serve as a fixed threshold detached from hardware, message size, and QoS. IoT DC3 currently provides internal messaging adapters for RabbitMQ, Kafka, RocketMQ, Pulsar, ActiveMQ, and MQTT 5, with RabbitMQ used in the default examples. Select among them according to delivery semantics, replay needs, operational capability, and load-test results.

The second half of the data flow is the storage layer. Write volume, query window, retention period, and the team's operations capability jointly determine the selection: a dedicated time-series database, PostgreSQL with time-series extensions, or properly partitioned ordinary relational tables can all be valid. IoT DC3 isolates time-series storage through TsdbStore, uses TimescaleDB by default, and also provides adapters for TDengine, InfluxDB, and IoTDB. The responsibilities of the relational metadata database and the time-series database must not be conflated.

Microservices and Containerized Deployment

Starting an early IoT platform on a monolithic architecture is a pragmatic move, for very practical reasons: teams are under heavy delivery pressure, and the business logic, though complex, has not reached the split granularity of microservices. As device scale grows and the need to separate service concerns becomes prominent, mature IIoT platforms on the market have gradually turned to microservice architecture. Not because microservices are more fashionable, but because service concerns in IoT scenarios are naturally separated: device access cares about protocol parsing and connection upkeep, data processing cares about throughput and latency, device management cares about the atomicity of state changes, and alarms care about the determinism of rule evaluation. Services this different in operability needs, resource models, and release frequency gain nothing from being squeezed into one monolith.

There is no unified formula for microservice split granularity, but there is an experience-based judgment keyed to change frequency: if two functional modules differ in their reasons for change, change frequency, and change cadence in most cases, they should be split into two services. For example, adding a new protocol touches only the protocol driver service and does not affect the device management service; changing the alarm-rule evaluation logic involves restarting only the rule engine service, without stopping the device access service.

Containerization is the enabling layer of this architecture. Docker packages services as immutable images; Kubernetes provides orchestration, self-healing, scaling, and canary release. In development, java -jar or docker-compose can deploy on a single machine; production switches to a container-orchestration platform. This consistent "development-test-production" environment isolation matters especially in IoT projects — hardware devices cannot be "containerized" and canary-released the way microservices can, but the server side that carries them must be.

Containerized deployment also gives edge-cloud collaboration a more natural shape. Protocol drivers can be packaged as lightweight containers and deployed in the constrained environment of an edge gateway; center services are packaged as standard containers and deployed in the cloud or a private data center. The two communicate asynchronously through a message queue, with a clear boundary and no encroachment on each other.

Architecture Design Checklist

□ Is each layer's responsibility clearly defined? Are there any direct cross-layer calls?
□ Is the protocol adaptation layer deployed and run independently? Is it decoupled from the center services through a message queue?
□ Does the message-queue selection match the data scale and application scenarios?
□ Does data ingestion have peak-shaving and buffering mechanisms? Has the storage solution been validated against capacity and query patterns?
□ Is the service split based on change frequency and separation of concerns, rather than "microservices for microservices' sake"?
□ Can you switch between local single-machine development and the production containerized deployment environment?
□ Is there a clear network boundary and asynchronous isolation between edge protocol-driver capabilities and cloud AI/analytics capabilities?
□ Does the core data-flow path have a degraded-mode fallback (for example, can drivers keep working locally when the message queue is unavailable)?
Figure 14-2 IoT Platform Layered ArchitectureDevices connect through edge drivers; point values are pushed asynchronously via RabbitMQ and fanned out in parallel to the Data Center and Intelligence Center; applications route through the API Gateway to auth, device management, and data queries.Figure 14-2 IoT Platform Layered ArchitectureMessage distribution and API routing form two parallel fan-outs, not serial component callsApplication LayerMonitoring DashboardVisualizationMobile AppMobile AccessBusiness ClientsThird-Party IntegrationAlerts & ConsoleOps ActionsAPI Gateway · Single Entry · Auth · RoutingAPI Routing (parallel fan-out)Platform LayerRabbitMQ · Async Message BusData CenterLatest · History · AlertsIntelligence CenterAI Agent · Task OrchestrationMessage DistributionAPI Group · Auth · Device Mgmt · Data QueryControlled Tools & Audit · Policy Check · Human Confirm · Op TrailEdge Access LayerMQTT / CoAP DriverProtocol Adaptation · Local CacheModbus / Proprietary DriverProtocol Adaptation · Local CacheProtocol Adapter GatewayStandardized Point ValuesAsync PushSensorsPLCSmart GatewayField DevicesProtocol Access (MQTT / CoAP / Modbus)Figure 14-2 Uplink data is fanned out through the message bus; the API and the Agent each complete controlled calls through their local capability groups.
Figure 14-2 IoT Platform Layered Architecture

14.1.3 Development Process and DevOps

Requirements analysis and architecture design settle "what to do" and "how to organize it"; once development starts, the easiest thing to wreck is not the implementation quality of any single interface but the delivery-cadence misalignment across modules and teams. An IoT project adds two hard constraints beyond a pure internet backend: the firmware release cycle and the hardware availability window. A standard agile framework copied wholesale usually cannot survive three iterations — one closed loop of firmware flashing, device testing, and regression verification, plus channel shipping and field deployment, puts the cycle in weeks. If backend services iterate faster than the hardware cycle, the result is "versions cannot keep up with the physical world": the backend interface has changed, and the devices running in the field still carry old firmware.

Orchestrating Iterations Around the Hardware Cadence

The more workable practice is to anchor iterations to the hardware release cadence. Suppose firmware is released on a fixed four-week cycle; the iteration cycles of backend services, protocol drivers, and the front-end application then align to four weeks instead of shrinking to two. The development rhythm within the four weeks splits into three segments:

  • Week 1 (solution freeze): decide which thing-model attributes and commands this round of firmware will add, and align the interface contract across front end, back end, and embedded teams. All changes must be recorded in a unified contract document.
  • Weeks 2-3 (parallel development): the embedded team develops firmware, the back-end team develops protocol drivers and APIs, and the front-end team develops the human-machine interface. The most common integration problem in this window is "a field name in the protocol definition changed but the document was not updated." The interface contract must be encoded as automated contract tests, with consistency verified automatically on every pull request (PR).
  • Week 4 (integration and regression): firmware is flashed onto test devices, back end and front end are deployed to the test environment, and the team runs full end-to-end integration testing. The goal of the round is to pass all integration test cases.

The key to this cadence: at every integration, all modules sit on a snapshot of the same known version, so the team never spends time retracing what exactly was changed in some interface weeks ago.

Version Management Across Multiple Repositories

An IoT project usually has two to three times as many code repositories as a pure backend project. A typical engineering tree includes at least: independent repositories for multiple protocol drivers (such as driver-mqtt, driver-modbus, driver-opcua), platform microservice repositories (such as center-auth, center-manager, center-data), the front-end project, the firmware project (one build must adapt to multiple hardware platforms), and the deployment project (such as Docker Compose or a Helm Chart).

With each repository going its own way, cross-module coordination soon turns into a nightmare. Git Flow's branch model is adequate for this scenario, but one hard rule must be added: all modules on the main branch must be in an integrable state at the same time. driver-mqtt and center-data on the develop branch must integration-test cleanly together; one module cannot run several versions ahead while another has not caught up. Multi-repository management tools can pull firmware, drivers, back end, and deployment scripts into one workspace, with each sync ensuring that all child repositories sit on the same snapshot that passed the same CI validation — this solves the fundamental engineering problem of multi-module version alignment; it is not an endorsement of any particular tool.

Eliminating Integration Problems at Commit Time

The core value of a CI/CD pipeline in an IoT project is not the throughput of "automated deployment" but the reliability of "automated integration verification." A change to one data-format field may cross two teams, several repositories, and several services between its commit in a protocol driver and the appearance of abnormal device data. Manually tracing such cross-domain issues costs far more than in a pure software project.

The .gitlab-ci.yml configuration below is one case, showing the basic shape of "staged, per-repository, unified integration verification":

yaml
stages:
  - build
  - integration
  - package

driver-build:
  stage: build
  tags: [iot-runner]
  script:
    - cd driver-mqtt && mvn clean package -DskipTests
    - cp target/driver-mqtt.jar artifacts/driver.jar
  artifacts:
    paths: [artifacts/]
    expire_in: 1 hour

service-build:
  stage: build
  tags: [iot-runner]
  script:
    - cd center-data && mvn clean package -DskipTests
    - cp target/center-data.jar artifacts/center.jar
  artifacts:
    paths: [artifacts/]
    expire_in: 1 hour

firmware-build:
  stage: build
  tags: [iot-embedded-runner]
  script:
    - cd firmware && make clean all
    - cp build/firmware.bin artifacts/firmware.bin
  artifacts:
    paths: [artifacts/]
    expire_in: 1 hour

integration-test:
  stage: integration
  tags: [iot-runner]
  needs: [driver-build, service-build, firmware-build]
  script:
    - docker compose -f ci/docker-compose.yaml up -d
    - sleep 15
    - mvn test -pl integration-test -Dtest=IotE2eTestSuite
    - docker compose -f ci/docker-compose.yaml down

package-docker:
  stage: package
  needs: [integration-test]
  script:
    - docker build -t registry.example.com/iot/center-data:${CI_COMMIT_SHA} .
  only:
    - master

Two engineering trade-offs in this pipeline design deserve attention:

  1. The integration-test stage uses sleep 15 to wait for services to become ready. A production-grade approach would poll health checks, but at this example's scale sleep is reliable enough and keeps the test scripts simpler. When the number of microservice instances reaches double digits, switch to a proper wait-strategy library.
  2. Docker images are pushed only on the master branch. develop and feature branches run build and integration verification only and produce no artifacts. This gate keeps unverified images out of production and pre-release environments.

Another key judgment: do not let one build toolchain compile both firmware and Java microservices. The environment dependencies of firmware cross-compilation (specific versions of ARM GCC, linker scripts, board support packages) are completely incompatible with the Maven/Gradle environment of Java services. The right approach is separate builds, each on its own toolchain, pulling the artifacts together only at the integration-test stage.

A Layered Automated-Testing Strategy

The biggest testing challenge in an IoT project is not writing test code but verifying protocol-driver behavior without real devices. The common compromise comes in three layers:

  • Unit tests: cover microservice business logic — device-registration validation rules, alarm-condition computation, data-format conversion. This layer needs no devices and runs fastest; it should cover the great majority of paths through the core business logic.
  • Integration tests: start the protocol drivers, MQTT broker, and data services, then use a simulated client to send compliant and non-compliant packets and verify that the drivers parse, convert, and forward correctly. Integration tests should cover the common packet variants of mainstream protocols. These tests most readily surface cross-team issues such as thing-model field-type mismatches.
  • End-to-end tests: real firmware is flashed onto test boards, which communicate with the platform over physical interfaces, verifying the full chain from power-on registration through data storage to alarm triggering. End-to-end tests cost the most and usually run several times longer than unit tests, so they are normally executed only on critical commits and release candidates. But this layer most deserves the investment — most device error codes, protocol handshake failures, and heartbeat timeouts can only be reproduced with real devices.

The Engineering Essence of the Development Process

The core task of DevOps in an IoT project is not the throughput of "100 deploys a day" but the guarantee that "after every commit, the impact scope of the change is traceable." This carries the same thread as the layered-decoupling principle of the previous section's architecture design — good architecture shrinks the cross-module blast radius, and a good DevOps process keeps that radius continuously verified.

A change to a firmware protocol stack must not go live without any integration verification; a change to a set of configuration parameters must show its effect on the real-time data flow in the test environment before it enters release. If the team can fit firmware, drivers, back end, and front end into the same orchestrated pipeline, and use automated quality gates (not meetings) to block unverified code from the main branch, the project's failure rate in the operations stage will drop markedly.


Engineering checklist

  • Are iteration cycles aligned to the hardware release cadence rather than a pure-software cadence?
  • Are all modules on the main branch in an integrable state at the same time?
  • Does the CI pipeline's integration test trigger automatically after the build completes, using real or high-fidelity simulated devices?
  • Does unit-test coverage span all core business logic, rather than chasing a line-count percentage?
  • Do end-to-end tests execute automatically on critical commits and release candidates?
Figure 14-3 Hardware-Cadence Iterations & Three-Layer TestingFour-week iterations anchored on hardware releases; CI/CD runs staged unified integration validation; testing spans unit, integration, and end-to-end layers.Figure 14-3 Hardware-Cadence Iterations & Three-Layer TestingHardware release cadence as the iteration anchor · every integration runs on the same known version snapshotFour-Week Iteration (firmware ships every four weeks)Week 1 · Plan FreezeDefine new firmware thing-model attributes and commandsFrontend, backend, and embedded align on interface contractsAll changes recorded in one contract documentWeeks 2–3 · Parallel DevelopmentEmbedded: firmware; backend: drivers + APIFrontend: the HMIInterface contracts encoded as automated contract testsWeek 4 · Integration & RegressionFirmware flashed to test devices; backend and frontend deployed to the test environmentRun full-chain joint debuggingGoal: pass all integration test casesHard Ruleall modules on the main branchmust always stay in anintegrable stateCI/CD: staged, per-repo, unified integration validationbuild (compile)integration (integration tests)package (master only)Never build firmware and Java microservices with one toolchain: build separately and pull artifacts together only at the integration-test stageThree-Layer Test StrategyUnit Tests · Fastest & MostDevice registration checks, alert condition math, data format conversionNo devices needed; covers most core business-logic pathsIntegration Tests · Simulated DevicesStart drivers, broker, and data services; simulate clients exchanging messagesBest at catching cross-team issues such as thing-model field type mismatchesEnd-to-End Tests · Real FirmwareReal firmware on test boards verifies the full chain from power-on registration to alert triggeringHighest cost; run only on key commits and release candidatesFigure 14-3 Iterations align with the hardware release cadence: plan freeze, parallel development, and integration regression complete within four weeks; CI/CD runs staged, unified integration validation, and testing spans three layers — unit, integration, and end-to-end.
Figure 14-3 Hardware-Cadence Iterations & Three-Layer Testing

14.1.4 Deployment and Operations Essentials

Requirements analysis, architecture design, and the development process settle "what to do" and "how to build it," but the phase where an IoT project's problems truly surface is usually the first three months after deployment. Pure backend microservice deployment already has mature containerized solutions, but an IoT system adds one more layer of entry into the physical world — edge gateways and device firmware. The choice of deployment topology, the management of edge nodes, and operational predicaments like "the device is online, but is the data right" are what decide whether the system can run stably.

Choosing a Deployment Model: Cloud, Private, and Edge Are Not a Linear Gradient

Public cloud, private cloud, edge deployment — these three are not a simple gradient from cheap to expensive; they correspond to different requirements for data sovereignty, operations capability, and business continuity.

The public cloud suits scenarios with widely distributed devices, standardized traffic, and a small operations team. The cloud vendor provides the access layer, message queue, and K8s cluster, with a clear responsibility boundary. One price to pay: bandwidth and message bills often grow faster than expected — especially where uplink device data is large in volume but low in business-value density (trackers reporting GPS coordinates every second, for example), where the cost of message counts and storage can outweigh the compute resources themselves.

Private-cloud deployment gives strong control and suits data-sovereignty-sensitive scenarios such as factories, campuses, and healthcare. But a private cloud means the operations team must carry high availability on its own: two sets of physical machines, independent storage, network redundancy, plus staffed operations. Running on a single server keeps the failure probability low, but one crash — field devices offline, business interrupted, and no remote recovery possible — can cost more, in combined losses, than a year of hosting fees. Most private-cloud deployments end at a single node plus cold standby; that is not a technical question but the realistic compromise of high-availability cost against the budget.

Edge deployment does not replace the central-cloud architecture; it is a sensible tailoring of it. Protocol drivers are pushed down to run on edge gateways, exchanging messages asynchronously with the data center through a message queue, and wide-area network jitter is absorbed in this layer of message cache. Edge nodes filter, aggregate, and raise local alarms as needed, sending only the valuable business data back to the cloud side. This model lowers cloud bandwidth and storage costs and keeps field business running through network outages.

Table 14-1 summarizes the core trade-off dimensions of the three deployment options. In real projects most solutions are combinations of the three — core services on the public cloud, key protocol drivers pushed down to the edge, and the private cloud carrying sensitive-data storage.

Table 14-1 Core trade-off dimensions of the three deployment options

DimensionPublic cloudPrivate cloudEdge deployment
Initial investmentPay-as-you-go, no hardware costOne-time hardware + server-room investmentEdge-gateway hardware + cloud services
Operations complexityLow, the cloud vendor covers itHigh, needs a dedicated operations teamMedium, edge nodes need unified management
Network dependencyDepends on broadband connectivityDepends on the internal networkCan run offline, locally autonomous during outages
Data sovereigntyControlled by the cloud vendorFully controllableCan be stored locally or uploaded on demand
Scaling elasticityFast horizontal scalingCapped by hardware resource limitsScales by adding edge nodes
Typical scenariosSmart cities, connected vehiclesFactories, campuses, healthcareIndustrial sites, mines, ports

Edge-Node Management: An Underestimated Operational Burden

Server nodes have fixed IPs, stable power, and terminal access. Edge gateways are the opposite: shifting IPs, intermittent networks, no one on site. Once the node count passes ten, manual SSH debugging is no longer sustainable.

Edge management must solve three problems:

  1. Status awareness: whether the gateway is online, whether CPU/memory/disk are over their limits. An agent program must reside in the gateway and report heartbeats to the management platform periodically over MQTT or HTTP. The heartbeat period should be set independently of the data-reporting period, with headroom reserved for network reconnection (the Keep Alive mechanism is covered in Section 9.2). After several consecutive missed heartbeats, the system should mark the node "offline."

  2. Configuration distribution: if changes to driver parameters, collection frequency, or alarm thresholds rely on ops engineers manually editing files on the gateway, the follow-up troubleshooting becomes a recursively compounding burden. Configuration changes must pass through a centralized configuration-management service, delivered via REST API, with the gateway-side agent pulling or pushing updates. In a layered architecture this duty is carried by the management service in the platform layer.

  3. Version control: the versions of protocol drivers and of the agent itself must be traceable and reversible. Keep the container images of the last few driver versions at deployment, so a failure can be rolled back to the previous stable version with one click. Protocol drivers themselves should run containerized, with versions and update strategies managed by the orchestration tool.

Observability and Logs: Online Does Not Mean Available

Online status is one of the least informative metrics on the dashboard: a gateway leaking memory stays green right up to the moment it crashes, and what operations really needs is visibility into runtime behavior. Edge-side metric aggregation and push, center-service metric pull, and alarm-noise suppression (duplicate-event silencing) are not expanded on in this section — see Section 5.3 on edge observability and Section 6.3.4 for the log and monitoring checklist. Logs follow the same principle: keep them structured, collect them centrally, and tier retention as "full volume short, WARN/ERROR long, statistical trends into the data warehouse," with concrete values assessed against business needs and hardware cost — again, see Section 6.3.4.

OTA Upgrades: Success or Failure Comes Down to One-Click Rollback

Firmware updates carry the highest operational risk: one bad firmware release can cut off an entire device fleet, and the field often has no physical means of recovery. The how-to and the pitfalls of the three pieces — delta upgrades, upgrade transactions that roll back on failure, and canary releases that go from a small batch to the full fleet — are covered in detail in Section 5.3 (edge batch OTA management) and Section 8.2.2 (firmware signing and secure boot). Here only the platform side's boundary of responsibility bears repeating: the management center maintains device firmware versions and upgrade policies, the data center records the history of every upgrade and its success/failure distribution, and when the failure rate during the canary period looks abnormal, pause the rollout instead of pushing it forward.

Engineering Checks at the Operations Level

  • Infrastructure first: stand up the monitoring, logging, and alarm channels before running the business-service orchestration. The two days saved by "get it running first and look" are usually paid back double in the first incident after go-live.
  • Write an operations runbook: not an appendix to the architecture design document, but a standalone, continuously updated SOP for fault handling. Every common fault (gateway offline, message-queue backlog, abnormal device data) should be written out clearly: symptom → possible cause → check steps → handling command/API/restart procedure. Section 14.3.5 provides a quick-reference table for this chapter's chains and can serve as a starting point.
  • Restrict production change windows: every change (configuration modification, driver upgrade, parameter adjustment) must pass an approval process, with complete, auditable change records. Suppose an ops engineer changes a high-tempo workshop's collection frequency from minute-level to second-level without review: device message rates will rise severalfold, and RabbitMQ queue backlog and command latency follow — a team lacking change management will run into this kind of incident sooner or later; the only variable is when.

Further reading: Chapter 5 discusses the platform layer's resource management and the batch operations of edge nodes (5.3, 5.6); Chapter 6 gives the checklist for the microservice logging and monitoring system (6.3.4); Chapter 8 covers how device identity authentication, firmware signing, and transport security are put into practice at deployment time (8.2, 8.3); the MQTT Keep Alive and session mechanisms are covered in Section 9.2.

Figure 14-4 Deployment Form Selection & Edge Node ManagementPublic cloud, private cloud, and edge represent different trade-offs; edge nodes must solve status sensing, configuration distribution, and version control.Figure 14-4 Deployment Form Selection & Edge Node ManagementCloud, private, and edge are not a linear gradient — they map to different data sovereignty and ops capabilitiesPublic CloudLow ops complexity; the cloud vendor carries failuresSuits widely distributed devices and standard trafficwith small ops teamsCost: bandwidth and message bills often exceed expectationsTypical: smart cities, connected vehiclesPrivate CloudStrong control; data-sovereignty-sensitive scenariosFactories, campuses, healthcareHigh availability is your own burdenOne server down can cost more than a year of hosting feesMost settle for the pragmatic single node plus cold standbyEdge DeploymentProtocol drivers pushed down to edge gatewaysWAN jitter absorbed in message cachesLocal autonomy when the network is downLess bandwidth and storage, but node-management costTypical: industrial sites, mines, portsEdge Node Management: an underrated ops burden1. Status SensingA resident agent on the gateway reports heartbeats over MQTT/HTTPHeartbeat interval ≈ 1.5× the reporting intervalA few consecutive misses mark the node "offline"2. Config DistributionDriver parameters, collection frequency, alert thresholdsPushed via a central config service + REST APINo manual file edits, no snowballing troubleshooting load3. Version ControlDriver and agent versions are traceable and rollback-readyKeep images of the last few driver versionsDrivers are containerized; the orchestrator manages update policyThree OTA Capabilities: success hinges on one-click rollbackDelta updates (only changes are shipped) · upgrade transactions (download→verify signature→write→switch→report, roll back on failure) · canary releases (a few devices first, then watch volume and error rate)Figure 14-4 Public cloud, private cloud, and edge are three deployment forms with different trade-offs; edge node management must solve status sensing, configuration distribution, and version control, and OTA upgrades rely on delta updates, transactions, and canary releases to guarantee one-click rollback.
Figure 14-4 Deployment Form Selection & Edge Node Management

From Industrial Software to AI Agents · Building a multi-protocol, cloud-native, open-source industrial IoT platform ready to evolve toward AI agents