Pulsar 4.x vs Kafka 4.0 for AI Workloads: The Million-Topic Problem
By Sagar Shankaran, Founder of CallSphere
Kafka 4.0 wins on raw throughput. Pulsar 4.x wins on multi-tenancy and the million-topic problem. We map both onto AI agent workloads — per-customer topics, geo-replication, separate compute and storage.
Key takeaways
TL;DR — Both Kafka 4.0 and Pulsar 4.x are post-ZooKeeper now (KRaft and Oxia respectively). Kafka is faster on raw throughput. Pulsar is the only sane choice when every customer needs its own topic, when you need built-in geo-replication, and when you want compute and storage to scale independently.
The pattern
You're building a SaaS AI platform. Every customer is a tenant. You want per-customer audit topics, per-customer event isolation, per-customer retention policies. Kafka makes this hard — partitions, ACLs, and broker memory all suffer at 100k+ topics. Pulsar makes this trivial — multi-tenancy is first-class, topics are cheap, BookKeeper handles the storage tier.
How it works (architecture)
flowchart TB
subgraph Pulsar
P_Brokers[Stateless brokers] -->|reads/writes| BK[BookKeeper bookies]
Oxia[Oxia coordination] -.metadata.- P_Brokers
end
subgraph Kafka
K_Brokers[Brokers tier 1: serve + store]
K_Brokers -.metadata.- KRaft[KRaft controller quorum]
end
Producer --> Pulsar
Producer --> Kafka
Pulsar's two-tier (broker + bookie) lets you scale brokers (CPU, network) independently from bookies (storage). Kafka's single-tier puts both on the broker; tiered storage (KIP-405) moves cold segments to S3.
CallSphere implementation
Explore a live demo and compare current plans to find the right fit for your business.
Build steps with code
- Decide topology: single-tenant + Kafka, or multi-tenant + Pulsar.
- For Pulsar: install via Helm, configure tenants and namespaces.
- Wire BookKeeper with at least 3 bookies for replication.
- Use TopicPolicies for per-tenant retention.
- Pulsar IO connectors replace Kafka Connect.
- Geo-replication: enable at namespace level, point to remote cluster.
- Benchmark: don't trust marketing — run OpenMessaging benchmark on your hardware.
import org.apache.pulsar.client.api.*;
PulsarClient client = PulsarClient.builder().serviceUrl("pulsar://pulsar:6650").build();
Producer<byte[]> producer = client.newProducer().topic("persistent://callsphere/real-estate/call-events").compressionType(CompressionType.ZSTD).create();
producer.newMessage().key(callId).property("ce-type", "com.callsphere.call.completed.v1").value(payload).send();
Consumer<byte[]> consumer = client.newConsumer().topic("persistent://callsphere/real-estate/call-events").subscriptionName("embeddings").subscriptionType(SubscriptionType.Shared).subscribe();
Common pitfalls
- Picking Pulsar for throughput — Kafka still wins benchmarks; pick Pulsar for multi-tenancy not speed.
- Picking Kafka for million topics — partition limits and broker memory bite hard.
- Skipping BookKeeper config — bookie disks fill up if Ensemble/Quorum/Ack are wrong.
- Comparing without geo-replication — Pulsar's geo is built-in; Kafka MirrorMaker 2 is bolted-on.
- Underestimating ecosystem — Kafka has 17 language clients and a massive Connect ecosystem; Pulsar is leaner.
FAQ
Is Pulsar still relevant after Kafka shed ZooKeeper? Yes — Pulsar's separation of compute/storage and its multi-tenancy story stand on their own.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
Can I run both? Sure — Kafka for fan-out, Pulsar for per-tenant. Adds operator load.
What's Oxia? Pulsar's purpose-built coordination service replacing ZooKeeper, designed for the million-topic case.
Where does CallSphere stand? Kafka + NATS today; we'll re-evaluate Pulsar when per-tenant topic isolation becomes a contractual requirement. See /pricing.
Can I demo our event flow? /demo.
Sources
- Confluent: Kafka vs Pulsar — Performance, Features, Architecture
- Pulsar vs Kafka 2026: The Post-ZooKeeper Era
- Kafka vs Pulsar: Streaming Platform Comparison
- Apache Kafka vs. Apache Pulsar: Differences & Comparison
Pulsar 4.x vs Kafka 4.0 for AI Workloads: The Million-Topic Problem: production view
Pulsar 4.x vs Kafka 4.0 for AI Workloads: The Million-Topic Problem ultimately resolves into one engineering question: when do you use the OpenAI Realtime API versus an async pipeline? Realtime wins on latency for live calls. Async wins on cost, retries, and structured tool reliability for callbacks and SMS flows. Most teams need both, and the routing layer between them becomes the most load-bearing piece of the stack.
Serving stack tradeoffs
The big fork is managed (OpenAI Realtime, ElevenLabs Conversational AI) versus self-hosted on GPUs you operate. Managed wins on cold-start, model freshness, and zero-ops; self-hosted wins on unit economics past a certain conversation volume and on data residency for regulated verticals. CallSphere runs hybrid: Realtime for live calls, self-hosted Whisper + a hosted LLM for async, both routed through a Go gateway that enforces per-tenant rate limits.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Latency budgets are non-negotiable on voice. End-to-end target is sub-800ms ASR-to-first-token and sub-1.4s first-audio-out; anything beyond that and turn-taking feels stilted. GPU residency in the same region as your TURN servers matters more than choosing a slightly bigger model.
Observability is the unglamorous backbone — every conversation produces logs, traces, sentiment scoring, and cost attribution piped to a per-tenant dashboard. HIPAA aligned isolation keeps healthcare traffic separated from salon traffic at the storage layer, not just the API.
FAQ
Is this realistic for a small business, or is it enterprise-only? 57+ languages are supported out of the box, and the platform is HIPAA aligned, which removes most of the procurement friction in regulated verticals. For a topic like "Pulsar 4.x vs Kafka 4.0 for AI Workloads: The Million-Topic Problem", that means you're not starting from scratch — you're configuring an agent template that's already been hardened across thousands of conversations.
Which integrations have to be in place before launch? Day one is integration mapping (scheduler, CRM, messaging) and prompt tuning against your top 20 real call transcripts. Day two through five is shadow-mode running, where the agent transcribes and recommends but a human still answers, so you can compare side-by-side. Go-live is the moment your eval pass-rate clears your internal bar.
How do we measure whether it's actually working? The honest answer: it scales until your tool catalog gets stale. The agent is only as good as the integrations it can actually call, so the operational discipline is keeping schemas, webhooks, and fallback paths green. The platform handles the rest — observability, retries, multi-region routing — without your team owning the GPU layer.
Talk to us
Explore a live demo and compare current plans to find the right fit for your business.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
Try CallSphere AI Voice Agents
See how AI voice agents work for your industry. Live demo available -- no signup required.