Cloud-only IoT pipelines are brittle during connectivity outages. I prefer running a local MQTT broker on Raspberry Pi and forwarding data upstream when possible.
Mosquitto with persistent sessions and retained state gives a robust baseline. I split topics by device class and enforce ACL rules so each client publishes only to its namespace.
For observability, I forward broker metrics into a small dashboard and alert on queue growth, client churn, and authentication failures.
This edge-first approach keeps automation loops responsive locally, while still allowing cloud analytics once links recover.