Comparison · Kafka

NATS vs Kafka: Core NATS, JetStream and Kafka Compared

NATS and Apache Kafka both move events between services, but they start from opposite ends. Kafka is a partitioned, replicated log that keeps data until a retention limit removes it. NATS is a lightweight messaging system whose core delivers only to whoever is listening, with JetStream adding persistence on top. Comparing "NATS" with Kafka therefore means comparing two things: Core NATS and JetStream. This page sets all three side by side, from the projects' own documentation checked on 9 October 2026.

Tyler Eastridge

By Tyler Eastridge, Head of Operations

LinkedIn · Updated

7 min read7 sections
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 and Apache Kafka on the same criteria
Core NATSNATS JetStreamApache Kafka
Delivery guaranteeAt most once; only subscribers connected at publish time receive itAt least once with acknowledgements and redelivery; publish deduplication by message IDAt least once by default; idempotent producer and transactions for exactly-once between topics
PersistenceNoneStreams on file or memory storageReplicated log on disk, tiered storage optional
RetentionNot applicableLimits (age, size, count), Interest or WorkQueue policyBy time (seven days by default), size, or compaction by key
Unit of dataSubject (hierarchical, with wildcards)Stream bound to one or more subjectsTopic split into partitions
OrderingPer publisher, per subjectStream sequence; one leader per stream takes writesWithin a partition; same key, same partition
ReplayNoYes, from start, sequence or timeYes, from any retained offset
ClusteringFull-mesh server clusters, gateways, leaf nodesRaft groups per stream and consumer; up to five replicasKRaft controllers (ZooKeeper removed in 4.0); replicated partitions
Built-in extrasRequest-reply, queue groupsKey-value store, object storeKafka Connect, Kafka Streams, share groups
Governance and licenseCNCF incubating project, Apache 2.0Part of the NATS server, Apache 2.0Apache Software Foundation, Apache 2.0
Table · Core NATS, NATS JetStream and Apache Kafka on the same criteria. Scroll sideways on small screens.

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. 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.

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 has been a CNCF incubating project since 15 March 2018; 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

  1. Must new consumers replay weeks or months of history, or must data be compacted by key? Kafka.
  2. Do you need exactly-once read-process-write between topics, or Kafka Connect and Debezium? Kafka.
  3. 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.
  4. 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.

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 incubating project, accepted on 15 March 2018. In May 2025 CNCF and Synadia agreed that NATS stays in CNCF under Apache 2.0.

Kafka services

Where this gets done

The work behind this page, run by the same engineers who wrote it.

More resources

Other Kafka guides, comparisons and research

From the blog

Recent Kafka articles

Next step

Need this done on your Kafka estate?

Named senior Kafka engineers, 24/7, with a 15-minute emergency SLA — self-managed, MSK or Confluent Platform.