~/tools/nats
NATS
tool

NATS

NATS is an open source messaging system for connecting services, apps, and devices — a lightweight, self-hostable alternative to Amazon SQS and Google Cloud Pub/Sub that handles pub/sub, request-reply, and persistent streaming from a single Go binary.

What is NATS?

NATS is an open source messaging system for sending data between services, applications, and devices. It runs as a single lightweight Go binary and supports several communication patterns in one system: publish/subscribe, request-reply, queue groups for load balancing, and — through its JetStream layer — persistent streaming, a key-value store, and an object store. It’s a graduated Cloud Native Computing Foundation (CNCF) project.

What is NATS best for?

NATS suits teams that want low-latency, many-to-many messaging without running heavy infrastructure. It shines for microservice communication, IoT and edge deployments, and command/event fabrics that span multiple clouds. Because the core is a small binary with sub-millisecond latency, it fits environments from a Raspberry Pi to a global supercluster.

What can NATS do?

  • Publish/subscribe messaging with subject-based, wildcard routing for many-to-many delivery
  • Request-reply for synchronous service calls, and queue groups for automatic load balancing across workers
  • JetStream for persistent streams with replay, at-least-once and exactly-once delivery, and retention policies
  • A built-in key-value store and object store layered on JetStream
  • Official clients for 10+ languages (Go, Rust, Python, Java, C#, JavaScript/TypeScript, and more), plus 30+ community clients
  • Multi-tenancy via accounts, plus leaf nodes and superclusters to link edge and multi-cloud topologies
  • Secure connections with TLS, JWT/NKey auth, and decentralized authorization

Where does NATS fall short?

  • For large payloads (roughly above 1 MB), Kafka and RabbitMQ generally handle throughput better — NATS is optimized for high volumes of small messages, not big-blob transfer.
  • JetStream persistence, replication, and stream configuration add real operational surface on top of the simple core, so durable streaming is more to reason about than plain pub/sub.
  • Its ecosystem of connectors and stream-processing tooling is smaller than Kafka’s — there’s no equivalent of Kafka Connect or a large third-party processing layer, so integrations often mean writing client code.

Is NATS free?

Yes — NATS is fully open source under the Apache 2.0 license and free to self-host, with no paid edition gating features. The core server, JetStream, and all official clients are open source. A managed option exists through Synadia Cloud (from Synadia, the company that stewards NATS), which is a paid hosted service, but you never need it to run NATS yourself.

What does NATS replace?

NATS is a self-hosted alternative to managed cloud messaging services like Amazon SQS, Google Cloud Pub/Sub, and Azure Service Bus. With JetStream it also overlaps with streaming platforms — it can cover use cases people reach for Confluent Cloud or a self-run Apache Kafka cluster to solve, in a much lighter package.

FAQ

Is NATS open source? Yes. NATS is licensed under Apache 2.0, an OSI-approved license, and is a graduated CNCF project. The server, JetStream, and official clients are all open source and free to use.

Can I self-host NATS for free? Yes. Self-hosting is free — you only pay for the infrastructure it runs on. The single binary starts with no external dependencies; persistence (JetStream) uses local or clustered storage you provide.

Is NATS a good Kafka alternative? For low-latency messaging and lighter streaming needs, often yes — it’s far simpler to run than a Kafka cluster. For very high-throughput big-data pipelines with a rich processing ecosystem, Kafka remains the stronger fit.

What do I need to run NATS? Just the nats-server binary (or its Docker image) on a machine as small as a Raspberry Pi. For persistent streams, configure JetStream with disk storage; for high availability, run a clustered set of servers.