protomq
ProtoMQ: Type-safe, bandwidth-efficient MQTT for the rest of us. Stop sending bloated JSON over the wire.
A tiny, fast MQTT message broker for IoT and edge devices, written in Zig, that swaps bulky JSON for compact Protobuf and enforces message schemas at the broker.
ProtoMQ is a message broker built for Internet of Things devices and edge computing, designed to replace bulky JSON data with a compact binary format called Protobuf (Protocol Buffers). In IoT systems, thousands of small sensors constantly send readings — temperature, humidity, and so on. JSON is easy to read but wastes bandwidth. The same data in Protobuf can be about four times smaller, which matters when devices are on cellular connections and you're paying per megabyte.
What makes ProtoMQ distinctive is that it enforces data structure at the broker level — the server in the middle that receives and distributes messages. You define what your messages must look like using schema files, and the broker rejects any message that doesn't match. This catches bad data before it reaches any subscriber. Clients that don't want to deal with binary encoding can send plain JSON and let the bundled command-line tool convert it to Protobuf automatically. The broker supports the standard MQTT messaging protocol, including wildcard topic routing and a built-in discovery system so clients can download schemas automatically. It is written entirely in Zig, runs with no external dependencies, uses about 2.6 MB of memory for 100 simultaneous connections, and handles over 200,000 messages per second on modern hardware.
Where it fits
- Send sensor readings from thousands of IoT devices without wasting cellular bandwidth on verbose JSON
- Reject malformed device data at the broker before it reaches any subscriber
- Run a lightweight MQTT broker on edge hardware with no external dependencies
- Let clients send plain JSON and have it auto-converted to Protobuf via the bundled CLI