New trends in MQTT services: Understanding MQTT multi-tenant architecture

introduction

Over the past decade, the MQTT protocol has been widely used in the field of Internet of Things. Many IoT service providers need flexible and scalable MQTT services, and MQTT with multi-tenant architecture provides them with a new choice.

This article discusses the MQTT multi-tenant architecture and the advantages and challenges it brings to users.

What is a multi-tenant architecture?

Multi-tenancy (Multi-tenancy) is a software architecture pattern that enables a single instance of an application to provide services to multiple tenants (users or customers) at the same time, and each tenant has its own independent data and configuration.

Under this architecture, multiple tenants share the same infrastructure, database, and cluster, but each tenant can only access its own data and configuration. This means that tenants can customize services according to their needs without affecting other tenants' data or configuration. At the same time, providers can also reduce costs by serving multiple tenants on the same infrastructure.

For MQTT Broker, the multi-tenant architecture is an efficient and economical solution that can provide MQTT services to multiple clients or teams at the same time.

Multi-tenant Architecture in MQTT: Implementing Data Isolation for Each Tenant

The core of the MQTT Broker multi-tenant architecture is data isolation. This ensures that each tenant sees itself as the only user of the entire cluster, and they cannot access or interact with other tenants' clients. It includes the following five main areas:

  • No client restrictions are required . Clients can use arbitrary client IDs, usernames, and passwords, independent of other tenants. Even different tenants can use the same client ID to access at the same time.
  • Authentication/authorization data isolation . Each tenant has its own independent authentication and authorization data, which is used to control client login and publish/subscribe permissions on topics. A tenant can only operate its own data, and these data only take effect on the client of the tenant.
  • Message quarantine . Clients of different tenants cannot communicate with each other. Although tenants can use arbitrary topics, including those used by other tenants, messages are still completely isolated.
  • Independent user-level interface . Includes admin site and HTTP API. Tenants can only manage and view their own data, and cannot modify the data of other tenants.
  • Differentiated configuration . Each tenant should be provided with an independent configuration to meet their specific resource and functional needs.

Advantages and challenges of MQTT multi-tenant architecture

The MQTT multi-tenant architecture brings two advantages to IoT solution providers:

  • Flexibility : MQTT multi-tenant architecture is more flexible than proprietary architecture. This is mainly reflected in two aspects: First, it does not need to build a separate infrastructure for each tenant, and can quickly provide MQTT services. The second is that it can customize charging packages for individual tenants without interrupting service or reallocating the underlying infrastructure.
  • Cost savings : MQTT multi-tenant architecture is a low-cost alternative to dedicated architecture, allowing multiple tenants to share the same infrastructure. In contrast, dedicated architectures require each tenant to have their own infrastructure, which can be costly to build and maintain.

But at the same time, there are some challenges in adopting MQTT multi-tenant architecture:

  • Ensure tenant data is properly segregated . Under no circumstances should tenants access or manage other tenants' devices and data. Therefore, strict security measures must be taken, including strict access control policies, reasonable authentication and authorization mechanisms, and role-based access control. Data encryption is used when necessary to ensure the security of data during transmission.
  • Effectively manage competition for resources . Since multiple tenants share the same set of infrastructure, such as network bandwidth, CPU or memory, there must be resource competition among tenants. The key is that the system must be able to limit the use of resources by tenants, so as to avoid a resource being completely exhausted by a tenant and affecting the normal use of other tenants. Typically, we can control resource consumption by setting quota and rate limit policies for each tenant. For example, you can set limits on the maximum number of connections and subscriptions, as well as message rates, for tenants. Once the limit is reached, the service can deny requests to prevent excessive consumption of resources by tenants.

EMQX Cloud Serverless: MQTT service based on multi-tenant architecture

EMQ has launched a Serverless MQTT service based on innovative multi-tenant technology - EMQX Cloud Serverless. EMQX Cloud Serverless allows users to quickly deploy MQTT services within seconds without worrying about server infrastructure management or resource allocation during service expansion . It also provides a permanent free quota of 1 million minutes per month , and adopts a pay-as-you-go charging model, which greatly reduces the cost of IoT.

epilogue

With the continuous growth of IoT devices and the emergence of new application scenarios, the MQTT multi-tenant architecture has broad prospects in the future IoT market. Adopting this architecture can not only provide customers with more flexible MQTT Broker services, but also reduce operating costs for customers during large-scale deployment.

Copyright statement: This article is original by EMQ, please indicate the source for reprinting.

Original link: https://www.emqx.com/zh/blog/multi-tenancy-architecture-in-mqtt

Guess you like

Origin blog.csdn.net/emqx_broker/article/details/131539544