Connect. Control. Secure.

High-Availability IoT Cluster Demo

(Interactive SMQ Example & Tutorial)

The following article and interactive demo shows how to set up a very cost effective High-Availability Internet of Things Cluster. A High-Availability (HA) cluster may use a load-balancer and/or use DNS, or other technologies such as Anycast. In this article and demo, we use a load-balancer-less solution based purely on DNS -- a so called DNS Round-Robin setup.

Round Robin DNS provides a low cost alternative to traditional cloud services. We recommend reading the DZone article Cheaper Alternatives to IoT Cloud Services if you are new to Round Robin DNS.

We have selected a low cost Virtual Private Server (VPS) provider for our example, and we have the two servers located in Portland and Los Angeles. The geographical dispersion provides strong redundancy. The yearly lease for each server is $12, thus the total cost for our example cluster is $24 per year.

We have two html frames below, and each html frame opens the SMQ IoT LED example on a separate server. The domain name translates to two IP addresses (two online servers) and you randomly get one of these IP addresses when navigating to However, we have also configured the DNS such that you can navigate directly to a specific cluster node.

Notice that clicking a button in any frame window below is synchronized. Not only does the SMQ protocol provide synchronization between multiple HTML5 clients, SMQ also automatically synchronizes between the servers in the cluster.

Before clicking any of the LED buttons below, make sure to select the same device in each window. You do this by clicking the same IP address in the left pane for each window below.

You can connect your own device to the cluster, and the easiest way to do this is to either download a simulated LED device for Windows and run this program or compile the SMQ source code using the online C compiler we have setup. Click the '' start button below and wait for the C code to compile and start. This may take a few seconds. You should see the simulated device in the two iframes above after it connects.

The following video shows how to compile and run SMQ using the online C compiler. Note, you do not need to signup!

For more information on the SMQ LED demo, see the SMQ tutorial: LED control using SMQ.

Connect your own ESP32 to the cluster

You may purchase an ESP32 device, use the SharkSSL FreeRTOS/lwIP IDE, and upload the SMQ LED demo to the device. See the tutorial Noobs friendly IoT IDE for an introduction.

Additional SMQ Videos

The above video is for the tutorial:
A Modern Approach to Embedding a Web Server in a Device.

Download SMQ Source Code

Download SMQ Source Code and Libraries