
NATS is a cloud-native messaging system that serves as a connective backbone for modern distributed systems. It unifies communication across cloud, on-premise, edge, and IoT environments with a focus on simplicity, performance, and reliability.
NATS supports three primary communication patterns:
Publish-subscribe (pub/sub) — One-to-many message distribution. Publishers send messages to subjects without knowing about subscribers. Multiple subscribers can receive the same message, enabling fan-out scenarios like telemetry broadcasting or event notification.
Request-reply — Synchronous request-response pattern built on top of pub/sub. Clients send requests to a subject and wait for responses, enabling service-to-service RPC without additional infrastructure.
Queue groups — Load-balanced message distribution among multiple consumers. Messages sent to a queue group are delivered to only one subscriber, enabling horizontal scaling of worker pools.
JetStream extends NATS with persistence capabilities:
NATS supports diverse deployment scenarios:
Official clients available for 40+ languages including Go, Python, JavaScript, Java, C#, Rust, and C.
NATS JetStream and Apache Kafka both provide distributed streaming platforms, but differ significantly in complexity, operational overhead, and architectural philosophy.
NATS and Mosquitto are both lightweight messaging brokers popular in IoT and IIoT deployments. Mosquitto is the reference MQTT broker implementation, while NATS offers its own native protocol with MQTT gateway support.