How to Build an High Availability
MQTT Cluster for the Internet of Things

Create a scalable MQTT infrastructure using Node.js, Redis, HAProxy and nscale to make the deployment phase a piece of cake ☺

TL;DR

What are we talking about?

Devices connecting to a load balancer, forwarding all connections to two MQTT servers. Image copyright to HiveMQ.

Give me some tools

So, how do we start?

1. Setting up the MQTT broker

Node.js code needed to run a simple MQTT server

2. Dockerizing our MQTT server

Docker. An awesome tool to deploy production systems

3. Adding HAProxy as load balancer

4. Making MQTT secure with SSL

Devices connecting to a load balancer, forwarding all connections to two MQTT servers. Image copyright to HiveMQ.

5. Configuring nscale to automate the deployment workflow

Droplet definition
List of Droplets created in Digital Ocean for this tutorial

Conclusions

Building the Connected Home

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store