On this page
Short answer
Short answer
Choose Kafka when the event log is the product: long or unlimited retention, log compaction, many independent consumer groups replaying history, exactly-once processing between topics, and the Kafka Connect and Kafka Streams ecosystem. Choose NATS when the job is connecting services, devices or sites with low-latency request-reply, publish-subscribe and queue groups, and you want persistence only where it is needed: JetStream adds streams, at-least-once delivery, a key-value store and an object store in the same small server binary. Both are Apache 2.0 licensed. Many estates run both, with NATS at the edge and Kafka as the system of record.
Core NATS, NATS JetStream and Apache Kafka on the same criteria
| Core NATS | NATS JetStream | Apache Kafka | |
|---|---|---|---|
| Delivery guarantee | At most once; only subscribers connected at publish time receive it | At least once with acknowledgements and redelivery; publish deduplication by message ID | At least once by default; idempotent producer and transactions for exactly-once between topics |
| Persistence | None | Streams on file or memory storage | Replicated log on disk, tiered storage optional |
| Retention | Not applicable | Limits (age, size, count), Interest or WorkQueue policy | By time (seven days by default), size, or compaction by key |
| Unit of data | Subject (hierarchical, with wildcards) | Stream bound to one or more subjects | Topic split into partitions |
| Ordering | Per publisher, per subject | Stream sequence; one leader per stream takes writes | Within a partition; same key, same partition |
| Replay | No | Yes, from start, sequence or time | Yes, from any retained offset |
| Clustering | Full-mesh server clusters, gateways, leaf nodes | Raft groups per stream and consumer; up to five replicas | KRaft controllers (ZooKeeper removed in 4.0); replicated partitions |
| Built-in extras | Request-reply, queue groups | Key-value store, object store | Kafka Connect, Kafka Streams, share groups |
| Governance and license | CNCF graduated project, Apache 2.0 | Part of the NATS server, Apache 2.0 | Apache Software Foundation, Apache 2.0 |
Core NATS and JetStream are different products in one binary
Core NATS is fire-and-forget messaging. A publisher sends to a subject such as orders.eu.created; every subscriber whose subject or wildcard matches at that moment gets a copy; anyone offline misses it. The NATS documentation describes this as at-most-once delivery that is never replayed. On top of that sit request-reply and queue groups, which spread messages across a pool of subscribers for load balancing. There is no broker-side storage to size and nothing to clean up, which is why Core NATS is often used for service-to-service calls, control-plane traffic and telemetry where the latest value matters more than every value.
JetStream is the persistence layer built into the same server. A stream captures every message published to its subjects and gives each a sequence number. Consumers are server-side cursors over a stream: the server tracks how far each one has read, redelivers anything not acknowledged in time, and several consumers can read the same stream independently. That makes JetStream the part of NATS that actually competes with Kafka.
Delivery semantics and duplicates
Kafka and JetStream both default to at-least-once delivery, so both can produce duplicates after a retry or a consumer restart. They handle it differently. Kafka's idempotent producer removes duplicates caused by producer retries, and transactions let a stream processor commit consumed offsets and produced records atomically, which is how Kafka Streams gets exactly-once processing between topics.
JetStream deduplicates on the way in: a publisher sets a Nats-Msg-Id header, and the stream rejects a second message with the same ID inside its duplicate window, two minutes by default. On the way out, the application still needs idempotent processing, as it does with any at-least-once consumer. If your design depends on atomic read-process-write across several streams of events, Kafka's transactional model is the more established option.
Persistence, retention and replay
Kafka keeps records until a retention limit removes them, seven days by default, or keeps the latest value per key forever with log compaction. Reading never deletes anything, so a new consumer group can replay months of history. That is the property that makes Kafka a system of record for event sourcing and change data capture.
JetStream offers three retention policies. Limits keeps messages until a size, age or count limit is reached, which behaves like a Kafka topic. Interest deletes a message once every consumer has acknowledged it. WorkQueue deletes it after a single acknowledgement, which turns the stream into a durable queue. JetStream can also cap messages per subject, which is useful for keeping the last state of each device or entity. Replay works from the beginning, a sequence number or a point in time, within whatever the retention policy kept.
Partitions versus subjects and streams
Kafka scales a topic by splitting it into partitions spread across brokers. Ordering holds within a partition, the record key chooses the partition, and a consumer group assigns each partition to one member, so the partition count caps consumer parallelism. Choosing it is a design decision covered in our Kafka architecture guide.
NATS addresses data by subject, a dot-separated hierarchy with wildcards, so consumers filter by meaning (orders.*.created) rather than by partition number. A JetStream stream has one leader that takes every write, so a single stream's throughput is bounded by one server. Large deployments spread load across several streams, or use subject mapping to split one subject space into deterministic partitions. NATS gives more flexible routing; Kafka gives more predictable horizontal scaling of a single high-volume topic.
Clustering and operations
Since Apache Kafka 4.0, released on 18 March 2025, ZooKeeper is gone and KRaft controllers, a Raft-based quorum, manage cluster metadata. Partitions are replicated across brokers, usually three times. Most clusters run three or five controllers, and the Kafka 4.1 documentation advises against combined broker-and-controller mode in critical environments. Running Kafka well means sizing brokers and disks, managing partition counts and rebalances, and operating Connect and schema tooling alongside it.
A NATS server is a single small binary. Servers form full-mesh clusters, clusters join into superclusters through gateways, and leaf nodes extend the system to edge sites. JetStream uses Raft too: a meta group places streams and consumers, and each stream and each consumer gets its own Raft group, with at most five replicas per stream. The documentation recommends an odd number of servers, typically three or five, so a majority can always form. Stream replicas default to one, so a stream is unavailable while its one server is down, and stream limits default to unlimited, so set replicas and a limit for production.
Ecosystem and licensing
Kafka's ecosystem is the larger one: Kafka Connect with a large catalog of source and sink connectors, Kafka Streams for stateful processing, Debezium for change data capture, schema registries, and a wire protocol also spoken by Amazon MSK, Confluent Cloud, Azure Event Hubs and Redpanda. Kafka 4.2 made share groups production-ready, adding queue-style consumption on ordinary topics.
NATS bundles more into the server instead: a key-value store and an object store, both built on JetStream streams, plus MQTT and WebSocket support and clients in most languages. Both projects are Apache 2.0. Kafka is governed by the Apache Software Foundation. NATS was accepted to CNCF as an incubating project on 15 March 2018 and moved to graduated on 2 November 2026; after a public dispute in 2025 over Synadia's plan to move the server to a Business Source License, CNCF and Synadia agreed on 1 May 2025 that NATS stays in CNCF under Apache 2.0, with Synadia transferring the NATS trademarks.
When to choose which
- Must new consumers replay weeks or months of history, or must data be compacted by key? Kafka.
- Do you need exactly-once read-process-write between topics, or Kafka Connect and Debezium? Kafka.
- Is the main need low-latency request-reply, fan-out to services and devices, or links to edge sites? NATS, with Core NATS for transient traffic.
- Do you want durable queues, a key-value store and messaging from one lightweight server? NATS with JetStream.
Moving between them is an application change, not a configuration change: the client APIs, delivery model and addressing differ. Bridging is common, with a connector or small service copying selected NATS subjects into Kafka topics for long-term retention.
NATS vs Kafka vs RabbitMQ: which one for which job
NATS, Kafka and RabbitMQ are three different answers to how services talk to each other. Kafka is the right choice when the event log is the product. NATS is right for lightweight request-reply, fan-out and edge links, with persistence added only where it is needed. RabbitMQ is right when you need routing, per-message acknowledgement and queue semantics, or AMQP and MQTT from one broker.
| Job | Kafka | NATS (Core and JetStream) | RabbitMQ |
|---|---|---|---|
| Replayable event log, long or compacted retention | Best fit: events stay until retention removes them, compaction by key, and new consumer groups can replay | JetStream retains and replays under Limits, Interest or WorkQueue policies; no compaction by key | Streams are a persistent, replicated log that consumers can read from any point and re-read; classic and quorum queues delete on acknowledgement |
| Task queue with per-message acknowledgement and routing | Possible; consumers share partitions, and the partition count caps parallelism | Queue groups in Core NATS, or a WorkQueue stream in JetStream | Best fit: exchanges and bindings route messages to queues, and each message is acknowledged |
| Low-latency request-reply between services | Not its design | Best fit: request-reply is built in | Direct Reply-To, over AMQP 0-9-1 and AMQP 1.0 |
| Edge and multi-site links | MirrorMaker 2 between clusters | Leaf nodes dial out to a remote system, which suits egress-only sites; gateways join clusters | Federation or shovel between clusters |
| Protocols from the server | Kafka protocol | NATS protocol, plus MQTT and WebSocket support | AMQP 0-9-1 and AMQP 1.0 in the core; MQTT 3.1, 3.1.1 and 5.0 and STOMP through plugins |
| Replication model | Replicated partitions; KRaft controllers manage metadata | Raft group per stream and consumer; one leader per stream | Quorum queues replicated by Raft; streams confirm once a quorum of replicas has the data |
| Licence | Apache 2.0 | Apache 2.0 | MPL 2.0 (RabbitMQ server README) |
| Operating footprint | Brokers, controllers, partitions, rebalances, Connect and schema tooling | A single small server binary; clusters, superclusters and leaf nodes | Erlang nodes, queue types, memory and disk alarms |
Is NATS a replacement for Kafka?
For durable queues, work distribution and moderate retention, JetStream often replaces Kafka. It does not replace Kafka where you need long-term or compacted retention, exactly-once processing between topics, Kafka Connect, Kafka Streams or Debezium. Many estates run both: NATS at the edge and between services, Kafka as the system of record. Treat the choice as one application change per workload, not a platform decision for the whole company.
When should we use NATS instead of Kafka?
Use NATS when the main need is low-latency request-reply, fan-out to services and devices, or links to edge sites, and you want persistence only for the subjects that need it. Use Kafka when many consumer groups must replay history, when data must be compacted by key, or when you rely on the Kafka ecosystem. The decision questions under "When to choose which" give the order to ask them in.
Who can run NATS or Kafka for us in production?
AceMQ covers both. NATS JetStream is on the list of platforms AceMQ supports, with L3 escalation, and Apache Kafka has its own Kafka support and managed Kafka services pages. Putting a platform under contract before an incident means the engineer who answers already knows your deployment. Response targets start from 15 minutes, by plan, and a written quote comes back within 1 hour. If the answer is both, AceMQ designs the bridge and supports each side.
How we compared
We compared Core NATS, NATS JetStream and Apache Kafka on nine criteria: delivery guarantee, persistence, retention, unit of data, ordering, replay, clustering, built-in extras, and governance and license. Core NATS and JetStream have separate columns because they behave differently. The facts come from the three projects' own documentation, checked on 9 October 2026; CNCF status, JetStream and KRaft defaults and the RabbitMQ column were checked on 17 November 2026 against cncf.io, docs.nats.io, kafka.apache.org and rabbitmq.com. Release numbers and defaults move, so confirm them for the version you plan to run.
Frequently asked questions
Is NATS faster than Kafka?
They optimize for different things. Core NATS keeps no storage and routes in memory, so it suits low-latency request-reply and fan-out. Kafka writes every record to a replicated log and is built for sustained high throughput with replay. Measure your own message sizes, durability settings and consumer counts rather than relying on published benchmarks.
Can NATS JetStream replace Kafka?
For durable queues, work distribution and moderate retention, often yes. Where you need long-term or compacted retention, exactly-once processing between topics, Kafka Connect or Kafka Streams, Kafka remains the better fit.
Does NATS guarantee message delivery?
Core NATS does not: it is at-most-once, and subscribers that are offline miss the message. JetStream adds at-least-once delivery with acknowledgements and redelivery, plus publish-side deduplication using the Nats-Msg-Id header.
Is NATS open source?
Yes. The NATS server and clients are Apache 2.0 licensed, and NATS is a CNCF graduated project: accepted at incubating level on 15 March 2018, graduated on 2 November 2026. In May 2025 CNCF and Synadia agreed that NATS stays in CNCF under Apache 2.0.
NATS vs Kafka vs RabbitMQ: which should we choose?
Choose Kafka for a replayable event log with many consumer groups, NATS for lightweight request-reply, fan-out and edge links, and RabbitMQ for routing, per-message acknowledgement and queue semantics, or when you need AMQP and MQTT from one broker. If two of those needs appear in one estate, run both and bridge them rather than forcing one platform to do everything.
Does NATS support MQTT?
Yes. The NATS server includes MQTT support alongside WebSocket, on top of its own protocol. RabbitMQ supports MQTT 3.1, 3.1.1 and 5.0 through a plugin, and dedicated MQTT brokers such as Mosquitto also exist; which fits depends on whether you also need JetStream persistence or RabbitMQ routing.