NATS JetStream vs Apache Kafka vs Apache Pulsar: Latency SLAs, Throughput & Multi-Tenancy
NATS JetStream vs Apache Kafka vs Apache Pulsar: Latency SLAs, Throughput & Multi-Tenancy Executive Summary & Decision Matrix All three systems are durable, replayable logs. The differences are in the tax each one charges on every message: JetStream buys low latency with a single Raft-group-per-stream design (low coordination overhead, limited per-stream scale ceiling), Kafka buys throughput and…
NATS JetStream, Apache Kafka, and Apache Pulsar are all durable, replayable log-based systems with differences in how they charge for each message. JetStream focuses on low latency with a single Raft-group-per-stream design, Kafka prioritizes throughput and ecosystem importance with a partition-consumer-thread model, and Pulsar emphasizes horizontal elasticity and multi-tenancy isolation with a BookKeeper-ledger/broker-compute split architecture.
This article examines the latency SLAs, throughput, and multi-tenancy capabilities of these systems using a benchmark environment.
In terms of latency, JetStream offers p50 publish latency of 1.1 ms and p99 publish latency of 6.8 ms for a 1 KiB payload, with fsync on every write. It has the lowest latency during leader election, ranging from 22 to 180 ms. Kafka, on the other hand, has higher latency with a p50 of 2.9 ms and p99 of 14.2 ms. Its latency during leader election is around 45 ms. Pulsar's p50 publish latency is 3.4 ms, with a p99 of 11.9 ms. It experiences higher latency during leader election, ranging from 60 to 140 ms.
Throughput is another area where these systems differ. JetStream achieves a maximum sustained throughput of 310k messages per second with a 1 KiB payload. Kafka can handle 1.28M messages per second in the same scenario. Pulsar trails behind with a maximum throughput of 940k messages per second.
When it comes to multi-tenancy, JetStream uses namespaces via accounts and resource isolation via limits, providing no broker-side CPU isolation. Kafka relies on quotas, ACLs, and placement as bolt-ons for tenancy management. Pulsar's approach involves a tenant→namespace→topic hierarchy with isolation policies and per-namespace BookKeeper ensemble pinning for better isolation.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to