Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. mochi mqtt

mochi mqtt

MITGov2.7.9

A fully compliant, embeddable high-performance MQTT v5 and v3.1.1 broker/server written in Go for IoT and pub/sub applications.

GitHubGitHub
1.9k stars332 forks0 contributors

What is mochi mqtt?

Mochi-MQTT is a fully compliant MQTT v5 (and v3.1.1) broker/server written in Go, designed for telemetry and internet-of-things projects. It can be used as a standalone binary or embedded as a library, offering a lightweight and fast solution with a focus on quality and maintainability.

Target Audience

Go developers building IoT or telemetry systems who need a high-performance, embeddable MQTT broker with full protocol compliance and extensive customization options.

Value Proposition

Developers choose Mochi-MQTT for its full MQTT v5 compliance, embeddable library design, and extensive developer control through exported core code, hook-based plugin system, and packet injection capabilities.

Overview

The fully compliant, embeddable high-performance Go MQTT v5 server for IoT, smarthome, and pubsub

Use Cases

Best For

  • Embedding an MQTT broker directly into a Go application for IoT device management.
  • Building telemetry systems requiring full MQTT v5 features like user properties, topic aliases, and shared subscriptions.
  • Developing custom authentication or access control systems for MQTT brokers using rule-based hooks.
  • Implementing persistent storage for MQTT sessions and messages using built-in Redis, Badger, Pebble, or Bolt hooks.
  • Creating high-performance MQTT brokers for constrained devices or low-bandwidth networks.
  • Testing and debugging MQTT client interoperability with a broker that passes Paho test suites.

Not Ideal For

  • Distributed systems requiring built-in clustering and high-availability out of the box.
  • Teams needing a fully-featured web administration interface for broker management without custom development.
  • Projects where strict MQTT v3.1.1 compliance without any v5 protocol behaviors is mandatory.
  • Organizations seeking a plug-and-play broker with minimal code integration and configuration.

Pros & Cons

Pros

Full MQTTv5 Compliance

Implements the complete MQTT v5.0.0 specification including user properties, topic aliases, and shared subscriptions, with hybrid support for v3.1.1 and v3.0.0, as confirmed by passing Paho interoperability tests.

Developer Control and Extensibility

Exports core broker code and provides a flexible hook-based system for plugins, allowing total customization of authentication, persistence, and packet handling through events like OnPacketRead and OnACLCheck.

High Performance Architecture

Uses a trie-based topic model and client-specific write buffers to handle irregular client behavior, with over a thousand unit tests and benchmarks showing competitive performance against brokers like Mosquitto.

Embeddable in Go Applications

Can be run as a standalone binary or embedded as a library in Go projects, offering a lightweight solution with an inline client for direct publishing and subscribing from embedding code.

Cons

No Native Clustering Support

Clustering is listed on the roadmap but not yet implemented, limiting scalability for distributed deployments without custom development or external solutions.

Complex Configuration for Advanced Use

File-based configuration only supports built-in hooks and listeners, and custom setups require programming with the hook system, increasing initial development time compared to more pre-configured brokers.

Conservative Default Settings

Defaults like maximum message expiry intervals are set to 24 hours to prevent DOS attacks, which may need adjustment for trusted environments, adding setup complexity and potential confusion.

Open Source Alternative To

mochi mqtt is an open-source alternative to the following products:

EMQX
EMQX

EMQX is an open-source, scalable MQTT broker for IoT and real-time messaging applications, supporting millions of concurrent connections.

Mosquitto
Mosquitto

Mosquitto is an open-source message broker that implements the MQTT protocol, commonly used for IoT applications and lightweight machine-to-machine communication.

Frequently Asked Questions

Quick Stats

Stars1,946
Forks332
Contributors0
Open Issues31
Last commit1 month ago
CreatedSince 2019

Tags

#iot#golang-package#message-queue#telemetry#mqtt#embedded#mqtt-v5#mqtt-broker#golang-library#mqtt-server#golang#pubsub#mqtt5#smarthome#real-time-messaging#mqtt-smarthome

Built With

G
Go
B
BoltDB
D
Docker
B
BadgerDB
R
Redis

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

Go-zeroGo-zero

A cloud-native Go microservices framework with cli tool for productivity.

Stars33,395
Forks4,329
Last commit2 days ago
go-kitgo-kit

A standard library for microservices.

Stars27,416
Forks2,438
Last commit2 years ago
KratosKratos

Your ultimate Go microservices framework for the cloud-native era.

Stars25,984
Forks4,181
Last commit2 days ago
grpc-gogrpc-go

The Go language implementation of gRPC. HTTP/2 based RPC

Stars23,097
Forks4,806
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub