EMQX vs Mosquitto | MQTT Broker comparison

IoT developers need to choose appropriate MQTT messaging products or services for their IoT projects
to build a reliable and efficient basic data layer to ensure upper-layer IoT services. There are many open source MQTT
products on the market, each with its own advantages in terms of performance and functions. This article will select the two most popular open source MQTT Brokers: EMQX and
Mosquitto, and conduct a 1v1 comparison from multiple dimensions such as technical architecture, performance, functions, and community situations to help readers gain a deeper understanding of these two brokers. products.

Insert image description here

Github community situation

EMQX is the highest-rated and most active MQTT Broker project on GitHub, with 11.4K Stars and over 3000 Commits in the past 12 months.

Mosquitto, with its lightweight single-threaded architecture, is more commonly deployed than EMQX, especially on resource-constrained embedded devices.
Insert image description here

Introduction to Mosquitto

The Mosquitto project was originally developed by IBM and Eurotech in 2013 and later donated to the Eclipse Foundation in 2016. Eclipse Mosquitto is released based on the Eclipse Public License (EPL/EDL license) and can be used by users for free. As one of the most widely used MQTT protocol implementations in the world, Mosquitto has more than 7.1 K GitHub stars as of March 2023.

Mosquitto is written in C/C++ and uses a single-threaded architecture. Mosquitto supports versions 5.0, 3.1.1, and 3.1 of the MQTT protocol, as well as SSL/TLS and WebSockets. The lightweight design makes it suitable for deployment on embedded devices or servers with limited resources.

advantage:

Easy to install and use
Support MQTT 5.0 protocol
Lightweight and efficient
Active community support

shortcoming:

Limited scalability (<100k)
No cluster support
Lack of enterprise features
Limited cloud Native support

Introduction to EMQX

The EMQX project was released on Github at the end of 2012 with the license Apache2. It has now become the most scalable MQTT message server in the world and is widely used in various key business scenarios such as the Internet of Things, the Internet of Vehicles, and the Industrial Internet of Things.

EMQX is written in Erlang/OTP, a programming language for building massively scalable soft real-time systems. Unlike Mosquitto, EMQX adopted a distributed cluster architecture from the beginning of its design, which can easily achieve elastic horizontal expansion and thus stably host large-scale MQTT client access. The latest version, EMQX 5.0, can establish 100 million concurrent MQTT connections in a single cluster of 23 nodes.

Excellent score

Support large-scale deployment
High availability
Horizontal scalability
High performance and high reliability First to adopt MQTT over QUIC
Rich enterprise functions

shortcoming:

Complicated to get started
Difficult to manage effectively
Community situation

Authentication and Authentication

In terms of client authentication permissions and access control,Mosiquitto provides a dynamic security plug-in to handle username/password identities in a flexible way Authentication and access control. Mosiquitto supports anonymous and username and password authentication, and can control access to message topics through custom groups and roles provided by dynamic security plug-ins.

EMQX supports multiple authentication mechanisms, such as username and password authentication, JWT authentication, and enhanced authentication based on the MQTT 5.0 protocol.

EMQX supports integration with a variety of data stores, including built-in databases, files, MySQL, PostgreSQL, MongoDB, and Redis.

In addition, EMQX provides users with a blacklist function. Users can add specified clients to the blacklist through Dashboard and HTTP API to deny access to the client. In addition to client identifiers, it also supports direct banning of user names and even IP addresses, which is convenient. Users can flexibly manage client connections and access.

Insert image description here

data integration

Mosquitto uses MQTT client message subscription to consume data from external systems by default. In addition, Mosquitto provides data bridging capabilities between multiple Mosquittos, which can be used for distributed deployment and data connection between multiple brokers.

EMQX provides WebHook method for data integration to push client messages and events to external systems. EMQX also provides an MQTT data bridging function similar to Mosquitto, which can connect multiple EMQX clusters or other standard MQTT services. EMQX focuses on enhancing data integration capabilities in the enterprise version. EMQX Enterprise Edition can connect to various mainstream databases, message queues and cloud services through the rule engine, greatly enhancing data reliability and architecture design flexibility.

Insert image description here

rules engine

In order for users to more conveniently implement high-performance data preprocessing and data routing based on business needs, EMQX has a built-in SQL-based rule engine component, which can be used with data bridging to achieve one-stop IoT data extraction, filtering, and data processing without writing code. Transform, store and process to accelerate application integration and business innovation.

Insert image description here

Operability and observability

Mosquitto provides basic logging and debugging capabilities for monitoring agent status and troubleshooting. However, it lacks advanced management and monitoring functions, making it difficult for users to gain more insights from its running status for performance optimization.

EMQX provides rich and visual monitoring functions through HTTP API and Dashboard, making it easier to monitor and manage. In addition, EMQX supports integration with Prometheus, StatsD, and Datadog, allowing operations teams to easily use third-party monitoring platforms.

Insert image description here

Cloud native deployment and K8s support

  • Mosquitto supports containerized deployment based on docker.

  • On this basis, EMQX provides cloud-native automatic deployment capabilities based on Kubernetes Operator and Terraform, making deployment and operation and maintenance in a container environment more convenient.

Insert image description here

Conclusion

Through the above comparison, we can see:

Mosquitto, as a single-node lightweight MQTT message middleware, is more suitable for deployment in industrial gateways, industrial computers, and small servers to realize small and medium-sized MQTT device connection scenarios. Fast and efficient data access and message routing.

As a large-scale MQTT message server that supports high-availability clusters, EMQX is more suitable for deployment in data centers, public clouds or private cloud environments , providing services for larger-scale data access and users who require high availability.

You can choose Mosquitto for embedded hardware and IoT edge deployments, and use EMQX as a highly scalable, highly available MQTT messaging service in the cloud.

Guess you like

Origin blog.csdn.net/hai411741962/article/details/134500604