17

I am considering mosquitto for a MQTT broker. From what I've read, I realized that Mosquitto doesn't support Horizontal Scaling.

So far all other criteria of my requirements can be met with Mosquitto.

I'm not sure if the question is too generic or broad but what I want to know is, if there's any way to achieve Scaling capabilities, Load Balancing etc. for Mosquitto.

Dhanushka Dolapihilla
  • 1,115
  • 3
  • 17
  • 34

1 Answers1

10

Mosquitto can scale horizontally with is bridge capability where one Broker copies all messages to another Broker.

You can see a basic configuration example here: http://e.verything.co/post/62163759361/bridging-two-mqtt-brokers

You also should take a look at the MQTT Malaria to test the scalability of your setup https://github.com/remakeelectric/mqtt-malaria

Teixi
  • 1,077
  • 8
  • 21
  • 6
    For correctness it has to be mentioned that also other options exist to reach a high scalability. Several brokers support clustering (also open source ones like https://verne.mq or https://rabbitmq.com) which tackle the challenge of scalability in a different way. Typically, the subscription and session state is available on all cluster nodes enabling that a MQTT cluster appears to a device as one big server. – Andre Feb 05 '16 at 16:32
  • Example provides way to connect only 2 brokers using bridge. Is is possible to scale to more than 2, say, 10 brokers using bridge and with no loops? – suresh Mar 15 '17 at 12:32
  • 5
    I don't consider this scaling, because all messages still go to both (indeed max=2) servers. You need a system that can move subscriptions between nodes, so that messages and their interested parties can all be connected to the same node, but all users can be distributed over nodes. – Halfgaar Sep 20 '17 at 13:41
  • 3
    The provided link is not available, can you provide another one because I can't find any explanation. – Shalabyer May 28 '22 at 15:58