System Architecture
Device → Go → Node → Vue. No skipping layers. Plugins swap. Same boundaries from a single host to a cluster.
Architecture is not decoration for architects. It serves the two ledgers on the home page: fewer human days, data you dare use.
Principles: Design Philosophy. Problem framing: What we solve.
Why this split is mandatory
| If the architecture allows… | The field becomes… | Lingdian hard rule |
|---|---|---|
| UI talks to Go / Broker | Auth chaos, version lock, no remote clarity | No cross-layer calls |
| Protocols baked into core | Every device patches the kernel | Hot-plug protocols |
| Only “cleaned” numbers stored | Triage needs a packet capture on site | Raw + normalized dual-track |
| Config scattered on the data plane | Tenant/OTA SSOT unclear | Config/auth only on Node |
| One design for single host, another for cluster | Scale = rewrite | Same boundaries when scaling |
One line: Device → Go → Node → Vue — talk only to neighbors.
Overview
Who does what
| Layer | Component | Does | Does not |
|---|---|---|---|
| Edge | Device / gateway | Collect, execute downlink | — |
| Message | gmqtt | MQTT ingress, topics | Business decode, authz |
| Data plane | Go server | Subscribe, decode, rules/OTA exec, dual-track persist, event bus | Multi-tenant UI, orchestration SSOT |
| Control plane | Node | HTTP APIs, realtime push, config/OTA, auth, open APIs | Own device long connections |
| Presentation | Vue / mini program | UX & field jobs | Call Go or Broker |
| Edge proxy | Nginx | Reverse proxy + static | Business logic |
| Storage | TD / PG / Redis / Manticore (optional) | TS+full uplink / business SSOT / hot / search | — |
Hard rules: Go is Broker Client only (connects to gmqtt); config/firmware/jobs/auth live only on Node; no skipping layers.
How messages move
Topic: {PK}/{GW}/self/{module}/{u|d}. Plugins emit a standard device envelope. Uplink: ingress → decode → dual-track → rules/forward → event bus → realtime push. Downlink: admin/API → Node → Go encode → gmqtt d.
Field meaning: vendors plug in; ops read raw+normalized remotely; UI never touches Broker.
How data flows
Adapter (gmqtt) → Uplink → Processor → Storage (TD / Redis / PG) / Forwarder; Downlink via Node → Go → gmqtt.
Codec & plugin load
Node protocol repo publishes → Go server fetches active pack → hot-load. New protocols as modules — Vue unchanged.
Where it lives: dual-track
TD (telemetry + full uplink) · PG (business/OTA/index) · Redis (hot/shadow/rules) · optional Manticore.
Without a data team, raw for audit + normalized for compute + standard parameters beats another “governance” poster.
How humans connect
HTTP APIs via Node · realtime push via Node · Vue admin + mini program on the same APIs.
Phase-1: single-host start
Same logical layers; processes may co-locate (gmqtt, Go server, Node, Nginx, TD/PG/Redis). Scale later without changing no-skip / dual-track rules.
Capacity: Performance.
Architecture ↔ yardsticks & field stories
| Yardstick | Landing |
|---|---|
| First-pass | Plugins / AI onboard, standard envelope, Topic contract |
| Remote clarity | Dual-track, tracing, full uplink, realtime push |
| Data you dare use | Standard parameters, thing-model-only business, no dirty dump |
| Field story | How architecture holds it |
|---|---|
| Plant under control | Near-realtime rules on Go; auth/orchestration on Node |
| Campus ledger | Business modules on Node; mini program same API |
| OEM white-label | Protocol repo + private deploy, same boundaries |
| Integrator less on-site | Remote dual-track + localizable faults from no-skip |