A Backend That Talks to SCADA
Building a Nest.js service that speaks OPC UA and MQTT without melting under shift-change load.
Why SCADA is not just another source
SCADA systems expect determinism. Your REST API does not. Bridging the two is the entire job of the backend I build most often. Get the bridge right and the rest of the stack becomes boring, which is the nicest thing you can say about an industrial service.
The shape of the service
- Nest.js as the framework because the module boundaries keep the OPC UA adapter separate from the REST surface
- node-opcua for the southbound connection
- MQTT for events that don't need request/response
- Prisma + PostgreSQL for durable state
- Redis for the ephemeral hot-path cache
Shift-change is the load test
Every site has a shift change twice a day, and every shift change causes a burst of simultaneous logins, dashboard refreshes, and handoff notes. If your service can survive the 2 p.m. shift change on a Monday, it can survive most things. I always simulate it in staging.
Draw the data flow on paper before you write the first controller. OPC UA topologies have a way of teaching humility.







