On this page
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 incubating 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. 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
- 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.
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.
Related
Where this gets done
The work behind this page, run by the same engineers who wrote it.
- 24/7 Kafka supportSelf-managed, MSK or Confluent Platform
- Managed Kafka servicesWe run the clusters, on your infrastructure
- Debezium CDC supportChange data capture from Oracle, SQL Server and PostgreSQL
- Kafka consultingPartition strategy, sizing, security and migration
- RabbitMQ supportIf the estate runs both brokers
- Kubernetes and container servicesKafka on Kubernetes, operated with your team
- Enterprise MQ supportOne contract across Kafka, RabbitMQ and IBM MQ
- Enterprise support plansSLA tiers and what each covers
- Enterprise MQ consultingMulti-broker architecture and migration
Other Kafka guides, comparisons and research
- GuideThe Kafka Operations GuideRead the guide
- GuideBuying Kafka Support: The GuideRead the guide
- GuideThe Kafka Monitoring and Alerting GuideRead the guide
- GuideThe Kafka Migration GuideRead the guide
- GuideKafka for AI Agents Without Confluent CloudRead the guide
- ComparisonManaged Kafka Options ComparedSee the comparison
Recent Kafka articles
- How Much Does Kafka Enterprise Support Cost?Oct 2026
- Kafka Disaster Recovery: Architectures, RPO/RTO, TestingOct 2026
- Apache Kafka End of Life: Supported Versions in 2026Oct 2026
- Confluent Alternatives After the IBM AcquisitionOct 2026
- Confluent vs Independent Kafka SupportOct 2026
- Kafka Consumer Lag: Causes and FixesSep 2026
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.