Corso Systems

View Original

Choosing an MQTT Broker

If you Google MQTT Broker you’ll find about as many choices as there are results. In our world we have come across a handful of them time and time again and figured it was time to share some insight into why you would pick one over another.

Like All Answers…It Depends

As with any software purchase in our industry, there are a lot of factors to consider. Before we ever get to a specific type of software like an MQTT broker, the first things to ask are:

  1. What are we using now?

  2. Are we looking for the “let’s build the end goal to start with” or the “do we need something to get started to learn what the end goal is along the way” approach?

  3. What’s the overall budget?

  4. How involved do we want IT to be in the implementation?

  5. Does it need to integrate with anything else from day 1, or will that come later?

Generally the answer to question 1 will dictate 90% of the decision for you. If you are using Ignition, use Cirrus Link’s modules. If you are using Amazon Web Services or Microsoft Azure you can use their modules, and if you aren’t using any of those you can probably start with an MQTT specific product like HiveMQ, RabbitMQ, VerneMQ, or the most popular, Mosquitto.

The Tried and True Options

  • Cirrus Link (mostly assuming you are using Ignition)

  • HiveMQ

  • Mosquitto

  • AWS IoT Core

  • Microsoft Azure IoT

Cirrus Link

Headed by Arlen Nipper, one of the inventors or the MQTT protocol, Cirrus Link provides modules for Inductive Automation’s Ignition platform, as well as a stand-alone Chariot Server. If you are using Ignition our first recommendation is to use the Cirrus Link modules because of the sheer ease of use. Unless your time is worth $0/hour or you can build modules for Ignition in your sleep you are going to be hard pressed to get MQTT data to show up in Ignition as tags for lower cost than buying the MQTT Engine Module.

If you are running a system with 50 or fewer, or 250 or fewer devices the MQTT Distributor module is one of the easiest options listed to set up. If you are going to send data from Ignition to other MQTT brokers then you want the Transmission Module, however most companies we work with are using Ignition as the final destination for the data and don’t require this module.

If you are going to go above 250 devices then you can use the Chariot Server as your broker and get a world class broker at a very affordable cost.

Listening to the stories about the various implementations of the Chariot Server if you spend any time around Arlen, getting millions of data points from thousands of devices is not an issue at all using Cirrus Link products.

Use:

If you are using Ignition or want a broker developed by the inventors of MQTT

Avoid:

If you aren’t using Ignition

HiveMQ

HiveMQ is a company both offering an open source community version you can self-host as well as an enterprise capable cloud-based solution with all of the features you would expect from an enterprise class platform like high availability, fault tolerance, enhanced security, built-in integrations, and support.

While things like Mosquitto are open source and popular, they might still feel a little like the wild west. If you have used open source software before you know what that means. HiveMQ has taken the opposite approach to that and has focused on building an enterprise scale tool from the beginning.

Use:

If you want high availability, fault-tolerant systems that can scale to tens of millions of clients, or if you want a “broker as a service” pricing model with their cloud-hosted solution, or if you have a small system and are learning about MQTT and can take advantage of their 100 Device for free plan, or are going to do a self-hosted solution.

Avoid:

If you are using other cloud hosted MQTT brokers and don’t want an additional cost for HiveMQ hosting, or don’t want to host something yourself.

Mosquitto

Mosquitto is the first MQTT broker you will likely read about if you do any research as they are essentially ubiquitous at this point. They are open source, self-hosted (although you can find hosted options if you look) and give you a lot of flexibility. They also require a fair amount of work to take advantage of the flexibility.

If you go through most MQTT tutorials online you will have some experience setting up Mosquitto. In our opinion it is a good “set it and forget it” broker. It also doesn’t support clustering or high availability out of the box, so if you want more of an enterprise class solution you should look elsewhere.

Use:

If you don’t need an enterprise class solution, are comfortable setting something up that uses the defaults and doesn’t need much more, and if you need something that just works.

Avoid:

If you need an enterprise class solution that can scale to meet any need with high availability and clustering capability.

AWS IoT Core

AWS IoT Core is basically a broker on AWS you can use to get data into AWS then access it elsewhere on the AWS stack. One of the data ingestion options is MQTT, and unlike the other brokers listed here it accepts LoRaWAN data as well.

If you are on AWS it is a perfectly viable option, and will also give you access to AWS Sitewise tools which are very handy for industrial data. If you aren’t on AWS you probably aren’t looking at AWS IoT core for your solution in the first place.

Use:

If you are on AWS and don’t have another MQTT Broker or you want to get your data into AWS for further processing on other services.

Avoid:

If you aren’t on AWS.

Azure IoT

Much like AWS IoT Core on AWS, Azure IoT is the primary way to get MQTT data into Microsoft Azure. It will let you access your data using other Azure services and tools like Power BI, Time Series Insights, or simply store the data in a data lake.

If you are on Azure it is a great option, and if you aren’t on Azure you probably aren’t looking at this as an option.

Use:

If you are on Azure and don’t have another broker or you want to get your data into Azure.

Avoid:

If you aren’t on Azure.

Wrapping Up

Yes there are tons more options than we have listed here, these are just the most common ones we run across in our projects. If you have one you would like us to take a look at we’d be happy to add it to the list and share our opinions.

Updated - 6/13/2022