长白山大秃狗熊
26-06-05 18:28

Here's how I prototype entire IoT backends on my desk for less than £50.

Like with the hardware prototype, the purpose of this is to get a system up and running that can be put in front of a test group or investors. Before any of it is deployed to the cloud, the whole stack runs on a Raspberry Pi. It costs nothing to run, iterates faster than anything cloud-based, and the architecture maps cleanly to cloud equivalents when it’s time to scale.

Here's what's on it.

1. Mosquitto for the MQTT broker. It's the standard for IoT device communication and the main open-source choice. Lightweight enough to run on a Pi, and it'll handle far more device connections than a prototype ever needs.

2. Node-RED as the backend logic layer. This is the bit I think most founders are missing. It's a visual flow-based editor that lets you wire up MQTT messages, database writes, HTTP endpoints and dashboards without writing a full custom backend. You change a flow and see the result immediately, rather than writing code, redeploying and testing. It's incredibly flexible and for prototyping it's hard to beat. 🔀

3. InfluxDB for time-series data. Most IoT prototypes are capturing sensor data over time, and InfluxDB is purpose-built for it. Integrates natively with Node-RED and Grafana, runs comfortably on a Pi. 📊

4. Grafana for the dashboards. Reads directly from InfluxDB and gives you graphs of your data, telemetry and alerting. Looks professional enough to put in front of investors without you having to build a custom UI. 📲

5. PostgreSQL for the relational data. User accounts, device metadata and configuration. The less interesting database, but it's great for managing the backend. 📋

6. Docker Compose to run all of the above. One file brings the whole stack up, which saves a lot of pain when something inevitably breaks. 🚢

The Pi isn't the production system. When you're ready for larger test deployments, all of these services scale nicely to managed cloud equivalents like AWS or Google Cloud Platform. For something in between, you can rent a remote server from providers like DigitalOcean for under £10 a month.

The prototype backend isn't a throwaway, it's a working draft of the production one.

发布于 广东