Messaging · Updated 2026-06-11

NATS vs Kafka

Kafka when the log is the system of record: long retention, replay for downstream warehouses, the Connect and stream-processing ecosystem. NATS when you want messaging as connective tissue — request/reply, fan-out, edge-to-cloud — with persistence where you need it via JetStream, all from one small binary a two-person team can operate.

NATS
Lightweight pub/sub everywhere; JetStream adds persistence.
Since
2011
By
Synadia / CNCF (created by Derek Collison)
License
Apache 2.0
nats.io ↗
Apache Kafka
Distributed event log. Append-only, partitioned, replayable.
Since
2011
By
LinkedIn / Apache (Confluent commercial)
License
Apache 2.0
kafka.apache.org ↗

These two get compared constantly and are built on opposite instincts. Core NATS is a fire-and-forget pub/sub router: subjects, wildcards, request/reply, sub-millisecond, at-most-once. JetStream layers persisted streams on top when you ask for them. Kafka starts from the other end — everything is a durable, replicated log, and lightness was never the goal. The Kafka vs NATS call is really a call about whether your messages are traffic or records.

Quick takes

If you're…

  • You need service-to-service request/reply with microsecond overhead NATS Request/reply is a NATS primitive. Kafka fakes it with topic pairs and correlation IDs.
  • The stream feeds warehouses, search, and caches that replay history Kafka Long retention, compacted topics, and Connect were built for this.
  • You deploy to edge sites, factories, or fleets of devices NATS Leaf nodes extend one NATS system to the edge; the server runs on a Raspberry Pi and speaks MQTT.
  • You need exactly-once read-process-write pipelines Kafka Kafka transactions plus read_committed are the proven primitive. JetStream offers dedup on publish, not transactional processing.
  • A small team has to operate it without a platform group NATS One Go binary, one config file, clustering built in. Kafka is a platform even with KRaft.
  • Sustained throughput in the hundreds of MB/s with large backlogs Kafka Sequential disk I/O, batching, and tiered storage are Kafka’s home turf.
  • You want key-value and object storage from the same infrastructure NATS JetStream ships KV and object store on top of streams; one system covers three jobs at modest scale.
  • Stream processing with windows, joins, and state Kafka Kafka Streams and Flink integrate natively. The NATS side leaves that to your application.
Decision wizard

A few questions, a verdict.

Q1

What are the messages?

Q2

How long must history live?

Q3

Where does it run?

Q4

Operational appetite?

At a glance

The scorecard.

Dimension
NATS
Kafka
Edge
Router first, log optional
Log first, only a log
depends
Microseconds, memory-speed
Bulk throughput, batched
depends
At-most-once core; JetStream at-least-once
At-least-once + transactional EOS
Kafka
Solid for days/weeks
Built to be the record
Kafka
One small binary
A platform, even with KRaft
NATS
Superclusters + leaf nodes
One region; mirror across
NATS
Ecosystem ecosystem
Good clients, thin tooling
The richest streaming ecosystem
Kafka
CNCF; 2025 scare, resolved
ASF, boringly stable
Kafka
In depth

Dimension by dimension.

core

Core abstraction

depends
NATS

A subject-based message router. Publishers send to subjects (orders.eu.created), subscribers use wildcards, queue groups load-balance, and request/reply is built into the protocol. Persistence is opt-in: JetStream captures subjects into replicated streams with consumers that track their own position.

Kafka

A partitioned, replicated commit log. Producers append, consumers read at an offset, and the broker is fundamentally a storage system. There is no request/reply, no wildcard routing — the log is the entire model, and everything else lives in client libraries.

core

Latency vs throughput

depends
NATS

Core NATS delivers in tens of microseconds to low milliseconds because nothing touches disk. JetStream adds replication and storage cost but stays lean. Throughput per node is strong for small messages; the design optimises for fan-out speed, not bulk transport.

Kafka

Built for throughput: batching, sequential writes, zero-copy reads. Per-message latency is higher — batching trades it away deliberately — but sustained volume on commodity disks is the founding achievement. The trade is structural, not a tuning gap.

core

Delivery semantics

edge: Kafka
NATS

Core NATS is at-most-once: no subscriber, no delivery, by design. JetStream upgrades to at-least-once with acks and redelivery, plus exactly-once publish within a deduplication window via message IDs. Exactly-once processing across systems remains your application’s job.

Kafka

At-least-once by default; idempotent producers remove broker-side duplicates; transactions give exactly-once for read-process-write pipelines inside Kafka. The most complete delivery-semantics toolbox in the category.

features

Retention and system-of-record use

edge: Kafka
NATS

JetStream streams retain by limits, interest, or work-queue policy, with replicas placed via Raft. It holds days or weeks of messages comfortably. But treating it as the permanent source of truth is swimming against the ecosystem — no tiered storage to object stores, thinner tooling for mass reprocessing.

Kafka

Retention is the product. Time- or size-based, compacted topics for latest-value-per-key, and tiered storage (KIP-405) pushing cold segments to object storage so "keep everything" is an actual strategy. Event-sourcing and CDC architectures assume exactly this.

ops

Operational weight

edge: NATS
NATS

A single ~20 MB Go binary with one config file. Clustering is built in and self-healing; full-mesh routes form automatically. Upgrades are binary swaps. This is the strongest practical argument for NATS and it is not close.

Kafka

KRaft removed ZooKeeper (gone entirely in Kafka 4.0), which genuinely helped — but you still run a JVM cluster with partition counts, rebalancing, ISR health, and capacity planning to manage. MSK, Confluent Cloud, and Redpanda exist mostly because of this line item.

features

Geography and edge

edge: NATS
NATS

Clusters mesh into superclusters via gateways; leaf nodes extend the system into edge sites, vehicles, or single devices with local-first traffic and transparent bridging. The server also speaks MQTT. No other broker covers cloud-to-edge in one system this cleanly.

Kafka

A cluster lives in one place. Cross-region means MirrorMaker 2, Confluent cluster linking, or stretch clusters — all workable, none light. Kafka at the edge is not a thing anyone recommends.

ecosystem

Ecosystem

edge: Kafka
NATS

Forty-plus official and community clients, Kubernetes operators, and JetStream’s KV/object stores. But no Connect-equivalent connector catalogue, no Streams-grade processing layer, and far fewer engineers who have run it at scale.

Kafka

Kafka Connect’s connector catalogue, Kafka Streams, ksqlDB, Flink, Debezium for CDC, schema registries, and a decade of operational lore. The protocol is a de facto standard with multiple independent implementations. This moat decides more migrations than any feature.

ecosystem

Governance and stewardship

edge: Kafka
NATS

A CNCF project. In 2025 Synadia, the main sponsor, explored reclaiming the server under a non-open license; after community pushback, CNCF and Synadia agreed NATS stays Apache 2.0 with the trademarks assigned to the Linux Foundation. Resolved well, but it happened.

Kafka

Apache Software Foundation since 2011, multi-vendor committer base, no licensing drama ever. Confluent monetises a proprietary layer above the project rather than relicensing it.

The real question

When NATS JetStream genuinely replaces Kafka — and when it cannot.

Most teams asking about Kafka vs NATS are really asking: can JetStream let us skip running Kafka?

Often, yes. If your "Kafka use case" is event distribution between services, work queues, short-to-medium replay windows for recovery, and modest sustained throughput — which describes most microservice estates honestly — JetStream covers it with at-least-once delivery, durable consumers, and replay from any point in the stream. You also pick up things Kafka never gives you: request/reply, wildcard subscriptions, a built-in KV store, and an operational footprint small enough that the messaging layer stops being a team’s job.

The cases where it cannot replace Kafka cluster around two themes. First, the log as system of record: indefinite retention with tiered storage, compacted topics feeding caches, replaying years of events to bootstrap a new consumer. JetStream can retain a lot, but the design centre is messaging with memory, not a permanent database of events. Second, the ecosystem: if your architecture leans on Kafka Connect’s connector catalogue, Debezium CDC, Kafka Streams or Flink jobs with exactly-once processing, ksqlDB, or schema-registry governance, there is no NATS equivalent for any of it — you would be rebuilding a platform out of application code.

A useful tiebreaker: count the systems that consume your streams without you writing code (warehouse sinks, search indexers, CDC sources). If that number is high, the connector ecosystem alone justifies Kafka. If it is zero and the consumers are all your own services, you are probably paying Kafka’s operational tax for shape you do not use — exactly the situation NATS was built for.

When to pick neither

A different shape of problem.

  • Classic job queues with rich per-message routing
  • Redpanda
    Kafka protocol with single-binary ops and no JVM
  • Apache Pulsar
    Geo-replication and multi-tenancy as first-class features
  • AWS SQS / SNS / EventBridge
    All-in on AWS and zero broker ops
  • MQTT brokers (EMQX, Mosquitto)
    Pure IoT device messaging at huge connection counts
  • Redis Streams
    Light streaming bolted onto an existing Redis/Valkey deployment
Situational picks

For specific cases.

Microservice backbone: RPC, events, queues for one product

NATS

Request/reply, pub/sub, and JetStream work queues from one binary. Kafka would be the heaviest component in the stack for the least-used part of its design.

Event backbone feeding warehouse, search, and ML pipelines

Kafka

Connect sinks, long retention, replay, and exactly-once processing are the requirements list — and they are Kafka’s feature list.

Edge-to-cloud: retail sites, vehicles, industrial telemetry

NATS

Leaf nodes and MQTT support extend one system from device to cloud. The Kafka answer involves three products and a gateway you write yourself.

Event sourcing or CDC as the system of record

Kafka

Compacted topics, tiered storage, Debezium. This is the canonical use and the ecosystem assumes it.

Replacing RabbitMQ and wondering if you should leap to Kafka

NATS

If routing-style messaging is your shape, NATS keeps the shape and removes the operational ceiling. Kafka changes the model entirely — only do that for log-shaped reasons.

You want Kafka’s model without Kafka’s ops

Redpanda (or a managed Kafka)

Keep the protocol and ecosystem, drop the JVM and ZooKeeper-era ops. NATS is only the answer if you also want a different messaging model.

Sources

Primary material.

Found this useful?