Both Zenoh and Mosquitto provide publish/subscribe messaging for distributed systems, but they take fundamentally different architectural approaches.
Zenoh was designed to eliminate the broker bottleneck entirely. By default, Zenoh applications communicate peer-to-peer, discovering each other through multicast or gossip protocols. This means two devices on the same local network can exchange messages directly without routing through a central server. Zenoh also unifies data in motion (pub/sub) with data at rest (queries and storage) in a single protocol.
Mosquitto follows the traditional MQTT broker model. All messages route through a central broker, which simplifies discovery and enables features like retained messages and last-will-and-testament. However, it creates a single point of congestion and requires infrastructure even for local device-to-device communication.
| Aspect | Zenoh | Mosquitto |
|---|---|---|
| Default topology | Peer-to-peer | Broker-centric |
| Local communication | Direct between peers | Through broker |
| Discovery | Multicast/gossip | Broker registry |
| Wire overhead | 5 bytes | 2 bytes minimum |
| Query/storage | Built-in | Not supported |
| Deployment modes | Peer, client, router | Broker only |
Yes. Zenoh provides an MQTT plugin that can bridge to Mosquitto brokers, allowing gradual migration or hybrid deployments where legacy MQTT devices communicate with Zenoh applications through the bridge.