Azure Event Hubs vs Apache Kafka: when each fits
Choose Azure Event Hubs when your team wants a managed Azure stream with no brokers to run. Choose self-hosted Apache Kafka when streaming data must stay in your own network or an air-gapped environment. Those two conditions usually settle the question before features come into it. Start by writing down where event payloads are allowed to live, because Event Hubs is an Azure-only managed service with no self-hosted edition. Microsoft's Event Hubs overview says Event Hubs supports the Apache Kafka protocol and that existing Kafka workloads can run without code changes or cluster management. The decision therefore turns mainly on where the platform runs and who operates it. The Event Hubs emulator is for local development and testing only.
Four questions settle most cases. First, data location: confirm whether event payloads, including personal or regulated fields, may be processed in Azure, and whether Private Link meets your network rule, which your security team should verify. Second, retention: Event Hubs Standard keeps data for up to 7 days and Premium and Dedicated for up to 90 days. If your rules need longer retention on the stream itself, Event Hubs does not meet that requirement, and Capture to Azure Blob Storage or Azure Data Lake Storage becomes an archive step to design. Third, operating work: a self-hosted cluster means your team owns brokers, KRaft metadata, upgrades, certificates, SASL settings and monitoring, and Kafka 4.x brokers need Java 17. Fourth, existing clients: list every producer, consumer, Kafka Connect connector and Kafka Streams application that must keep running, then test each one against Event Hubs before committing.
The cost comparison is mostly a question of labor and infrastructure. Apache Kafka is licensed under the Apache License 2.0 and has no paid edition from the project, so your costs are the servers or cloud instances, storage, networking, monitoring, and the engineering hours for upgrades and incident response. Event Hubs bills per hour by Throughput Unit, Processing Unit or Capacity Unit depending on tier, and Basic and Standard also bill ingress events, so its cost recurs with capacity whatever your staffing. Confirm current rates on the Azure Event Hubs pricing page and ask any self-hosting partner for a written scope covering upgrades, patching and on-call coverage. Before you decide, check that your identity model maps: Kafka clients authenticate with SSL or SASL mechanisms such as SCRAM-SHA-512 or OAUTHBEARER, while Event Hubs uses Entra ID RBAC, Shared Access Signatures or managed identities.
Which option fits each buying scenario
This table maps seven buying scenarios to the option that fits better, along with the condition under which that advantage holds. Read each row against your own estate: the deciding factors are where data must live, who operates the brokers, how long events must be kept, and whether a contract needs a vendor SLA. Azure Event Hubs fits when the workload stays in Azure and a managed service is the goal, while Apache Kafka fits when portability, residency or long retention matter more.
| Scenario | Better fit | Why it matters |
|---|---|---|
| Azure-only estate, no on-premises or air-gapped need | Azure Event Hubs | Fully managed with Entra ID RBAC, Private Link and no brokers to run. Holds only if every producer and consumer stays in Azure. |
| Existing Kafka application that must stay portable | Apache Kafka | Runs on any Kafka cluster you control, and MirrorMaker 2 moves topics and offsets between clusters. |
| Data residency or air-gapped requirement | Apache Kafka | Event Hubs runs only on Azure, so residency depends on Azure regions. Kafka can run in your data center or an air-gapped network. |
| No one available to operate brokers | Azure Event Hubs | Microsoft runs the service. Self-hosted Kafka needs staff for upgrades, storage, monitoring and patching. The advantage holds if no team can own brokers. |
| Retention beyond 90 days | Apache Kafka, once capacity is confirmed | Event Hubs keeps data up to 90 days on Premium and Dedicated. Kafka retention is set by your storage and topic settings, so confirm capacity. |
| Capture into Azure Blob Storage or Data Lake Storage | Azure Event Hubs | Capture writes events to Blob Storage or Data Lake Storage as a built-in feature. Kafka needs a sink connector you select, run and patch. |
| Vendor SLA in the contract | Azure Event Hubs | Microsoft Learn lists an SLA of up to 99.99%. The Kafka project offers no SLA, so availability depends on your design. |
Azure Event Hubs vs Apache Kafka: where data lives and who holds the keys
Event Hubs and Kafka differ less in what they stream than in where the streams run and who controls the keys, identities and evidence around them. The five points below separate what Azure manages for you from what your team would own after a move. Check each one against your own environment before you compare costs.
Where the service runs
Event Hubs runs only on Azure. It is a fully managed service with no self-hosted edition, and the Event Hubs emulator is meant for local development and testing only. Apache Kafka is Apache 2.0 software that you can run in your own cloud account, your data center or an air-gapped network. Confirm which of those locations your data rules allow before you choose a target, because that decision determines where brokers, storage and operators sit.
Event Hubs overviewIdentity and access controls
Kafka trades Entra ID roles for SASL mechanisms and ACLs you manage. Event Hubs authenticates callers through Microsoft Entra ID RBAC, Shared Access Signatures or managed identities. Kafka authenticates clients, brokers and tools with SSL or SASL, using GSSAPI (Kerberos), PLAIN, SCRAM-SHA-256, SCRAM-SHA-512 or OAUTHBEARER, and authorizes access through ACLs you define. Confirm how OAUTHBEARER connects to your identity provider, including token validation and claim mapping, with your identity team.
Kafka security overviewNetwork isolation design
Private Link is a managed control, while segmentation is a design you own. Event Hubs supports Azure Private Link, which keeps traffic on private addresses inside your Azure network. With Kafka, isolation comes from the network you build: subnets, firewall rules, private listeners and, where needed, a VPN or reverse proxy. Decide which brokers accept traffic from which clients, and test those rules from outside the segment as well as inside it.
Encryption and key ownership
Key control moves to your team after a move. Event Hubs encrypts data at rest with Microsoft-managed or customer-managed keys and uses TLS 1.2 in transit. Kafka supports TLS through its SSL listeners, but encryption at rest and key management are configured by you around the brokers and storage volumes. Confirm which key store holds the keys, who can rotate them, which TLS version and cipher policy your brokers enforce, and how backups are encrypted.
Compliance evidence and assessment
DeployOpen prepares evidence, and auditors assess it. Whichever platform you run, an assessor will look for similar proof: access reviews, change records, audit logs, key management and backup restores. DeployOpen can configure those controls in your environment and prepare the evidence. DeployOpen does not issue audit reports, attestations or certifications. Ask your assessor which evidence formats they accept before any migration starts.
Azure Event Hubs vs Apache Kafka capabilities, side by side
This table compares Azure Event Hubs with self-hosted Apache Kafka on the capabilities that usually drive a migration decision. Read each row as what the platform provides out of the box, and where the Kafka cell says to confirm, check the choice against your own design and environment. The main takeaway is that Event Hubs bundles capture, schema support and an SLA as managed features, while on Kafka you choose, license-check and operate those parts yourself.
| Capability | Azure Event Hubs | Apache Kafka (self-hosted) |
|---|---|---|
| Protocols | Apache Kafka, AMQP 1.0 and HTTPS. Existing Kafka workloads can run without code changes. | Kafka's own protocol, used through Kafka clients. |
| Ingestion scale | Millions of events per second, as described by Microsoft Learn. | Depends on your hardware, broker count, partitioning and client design. Load test before you commit. |
| Capture to storage | Capture writes events to Azure Blob Storage or Azure Data Lake Storage. | Set up a Kafka Connect sink for your target store. Confirm which connector you will use and its license. |
| Schema support | Schema Registry for Avro and JSON schemas. | Not included in Apache Kafka. Add a schema registry and check its license first, since some are not Apache 2.0. |
| Geo-replication | Geo-replication and geo-disaster recovery features. | MirrorMaker 2 replicates topics, offsets and ACLs between Kafka clusters. Confirm whether it can read from an Event Hubs endpoint. |
| Retention | Up to 7 days on Standard, 90 days on Premium and Dedicated. | Set by your own storage and retention settings. Plan disk capacity for the window you need. |
| SLA | Up to 99.99%, as described by Microsoft Learn. | No SLA from the Apache project. Uptime depends on your own design, operations and support contracts. |
Apache 2.0 Kafka carries no license fee, but Event Hubs tiers set the bill
Apache Kafka is an Apache Software Foundation project released under the Apache License 2.0, and the project itself offers no paid edition. The license cost is zero, but running Kafka is not free. You pay for broker compute, block storage, network traffic between zones or sites, and the platform engineers who size, patch, upgrade and monitor the clusters. These costs recur every month and grow with throughput and retention. Event Hubs is a managed service on Azure with no self-hosted edition, so its bill is set by the tier you choose and the units you buy. The comparison therefore turns on which costs you carry yourself and which costs Azure bills you for.
Event Hubs comes in four tiers: Basic, Standard, Premium and Dedicated. Basic and Standard are billed per hour by Throughput Unit, Premium by Processing Unit and Dedicated by Capacity Unit. Basic and Standard also bill ingress events per million, and each event up to 64 KB counts as one event. A producer that sends many small messages will generate more billable events than its byte volume suggests. Premium and Dedicated include ingress events in their pricing. Build a cost model from your own event count, average message size and peak unit count, then check it against the Event Hubs pricing page. Size the Kafka cluster for the same load so both sides rest on the same assumptions.
Before you treat the Kafka side as free, confirm with a vendor distribution or support provider whether any paid support or add-on applies to the version and deployment you plan to run. The Apache project does not sell support, so any paid option comes from a third party, and its scope should be written down in the quote. Check the license terms for your own use, including any bundled components, with counsel. The Apache Kafka downloads page lists the supported releases, which helps you choose a version to model. Record each answer beside your cost model so finance and engineering review the same assumptions.
What self-hosted Apache Kafka costs compared with Event Hubs billing
Event Hubs bills in layers, and only some of them follow message volume. On Basic and Standard, you pay an hourly rate for each Throughput Unit you provision, whether or not traffic flows. Premium bills per Processing Unit and Dedicated per Capacity Unit. Ingress events are billed per million on Basic and Standard, with each event up to 64 KB counted as one. Premium and Dedicated include ingress events. Check the Event Hubs pricing page for current rates.
- Hourly units (recurring): Throughput, Processing and Capacity Units are billed for every hour they are provisioned, so peak sizing becomes a standing monthly cost.
- Ingress events (recurring, Basic and Standard): The meter counts events, so a producer that sends many small messages generates more billable events than one that batches the same data, up to the 64 KB boundary.
- Capture storage (recurring): Captured data lands in Blob Storage or Data Lake Storage and is billed at storage rates that grow with throughput and retention.
- Supporting services (recurring unless noted): Private Link, diagnostic logs, Schema Registry, geo-disaster recovery and outbound data transfer may carry separate charges, so confirm each one on the pricing page before relying on a total.
- Retention and tier: Standard keeps data up to 7 days and Premium and Dedicated up to 90 days, so a longer replay window moves you to a higher tier with a different hourly unit.
Ask for hourly units by tier, a monthly event count, the Capture storage volume and every add-on in writing, then confirm each rate and inclusion on the pricing page. Throughput, event size, retention, tier, region and Capture volume drive the bill, and team skill affects configuration effort.
Self-hosted Kafka removes the hourly and per-event meters and replaces them with infrastructure and people. Apache Kafka is licensed under the Apache License 2.0 with no paid edition from the project, so the software carries no license fee. Your spend goes to compute, storage, network and the staff who run the cluster. Design, deployment automation and migration are one-time costs, and most of the rest recurs every month. Background on the project is on the Apache Kafka downloads page.
- Broker and controller compute (recurring): Brokers and KRaft controllers run on VMs or Kubernetes nodes in your account or data center, sized for peak throughput plus headroom for failures and rebalancing.
- Storage and replication (recurring): Retention multiplied by the replication factor sets disk size, so raising either setting also raises the network traffic that feeds it.
- Network (recurring): Client traffic, replication traffic and any cross-zone or cross-region links are billed by your provider or carried on your own circuits.
- Connect, schema registry, monitoring and backups (setup and recurring): Connect workers, a hosted schema registry, metrics stacks and topic backups need their own compute and storage. Confirm the license terms of Confluent Community License components before you host them.
- Upgrade and on-call time (recurring): Kafka targets three releases a year, Kafka 4.0 removed ZooKeeper mode, and brokers require Java 17, so each upgrade consumes planned engineering hours. Optional vendor support is a fixed recurring line that should be scoped in writing.
Throughput, partition count, retention, replication, region and team skill drive the total. Ask for instance sizes, storage per broker, the replication factor, monthly staff hours, the on-call model, the upgrade owner and the support scope, all in writing.
How much operating work Kafka 4.x asks of your team
The first operating question is which cluster mode and version you already run, because that sets the upgrade path before any capacity planning starts. Apache Kafka 4.0 supports only KRaft mode and removed ZooKeeper mode, so a ZooKeeper-based cluster must migrate to KRaft before it can move to any 4.x release. The upgrade notes also recommend that KRaft clusters older than 3.3.x go to 3.9.x before moving to 4.x. Java needs an inventory too. Since Kafka 4.0, brokers, Kafka Connect and the command-line tools require Java 17, while clients and Kafka Streams applications need at least Java 11. Ask each team which JVM its services and stream processors run, because application runtimes often sit outside the platform team's view. Read the Kafka 4.3 upgrade notes before you schedule any of these steps.
Kafka's release cadence sets the rhythm of your maintenance calendar. The project aims for three releases a year, one every four months, and supports rolling upgrades from each release in the past year to the latest version. A cluster that falls well behind may need an intermediate upgrade, so confirm the path in the upgrade notes before you postpone. The downloads page lists 4.3.1, 4.2.2 and 4.1.2 as the supported releases, with older versions archived. Check the Apache Kafka downloads page for the current list before you plan, because it changes with each release. Someone on your team must own that calendar, test each upgrade in a non-production cluster and decide when to apply bugfix releases, which the project makes only for supported releases.
Event Hubs moves most of this work to Microsoft. As a fully managed service, it runs the platform and its updates, so your team does not schedule broker upgrades, rolling restarts or JVM changes beneath the service. That matters most for teams without platform engineers, because a self-hosted Kafka cluster needs someone who watches the release calendar, rehearses each upgrade and owns the rollback plan. Self-hosting keeps that work in your own change process, so the timing and testing decisions stay with your organization. Before you choose, name the owner for upgrades and broker on-call, and confirm that person has time for every upgrade cycle the release calendar produces. DeployOpen can plan, implement and support a cluster through a retainer, but upgrade decisions still need an owner inside your organization.
How the residency, Kafka client and operations questions lead to one platform
The diagram starts with one question: must the data stay in your own network or an air-gapped environment? If yes, the path leads to self-hosted Apache Kafka and a written operating plan covering brokers, upgrades and backups. If no, ask whether your team wants to run brokers. If it does not, Azure Event Hubs fits, and existing Kafka clients should connect without code changes, which a test should confirm. If the team does run brokers, the choice turns on whether you need retention beyond 90 days or a vendor SLA. Each branch ends with a next step: a proof of concept or a written scope.
Decision path from data location and broker ownership to a next step.
What moving from Event Hubs to self-hosted Kafka involves
The sequence below moves a streaming workload from an Azure Event Hubs namespace to a self-hosted Apache Kafka cluster in your own infrastructure without breaking producers or consumers. Each step ends with a check the team can verify, so cutover happens only when both platforms agree on what has moved.
Inventory producers, consumers and protocols
Your team lists every producer and consumer that uses the Event Hubs namespace, along with the protocol each one speaks: Kafka, AMQP 1.0 or HTTPS. For each workload, record how it authenticates (Entra ID RBAC, Shared Access Signatures or managed identity), whether it depends on Capture or Schema Registry for Avro or JSON, and the retention it relies on. Each application owner confirms their row. The step is done when every workload has an entry, a named owner and a stated dependency list.
Size a KRaft cluster for your workload
Size the Kafka cluster from the inventory: peak throughput, the retention each topic needs, replication settings, and the region and zones where data must stay. Kafka 4.0 and later support only KRaft mode, so no ZooKeeper ensemble is needed, and brokers and Kafka Connect require Java 17. Event Hubs Standard retains data up to 7 days and Premium and Dedicated up to 90 days, so those windows set your baseline. Choose the release from the supported list on the Kafka downloads page and confirm it with your platform team. The step is done when a sizing document, backed by a load test, is approved.
Map Entra ID access to SASL and ACLs
Translate each access model into Kafka terms. Kafka authenticates clients, brokers and tools with SSL or SASL, and the documented SASL mechanisms are GSSAPI (Kerberos), PLAIN, SCRAM-SHA-256, SCRAM-SHA-512 and OAUTHBEARER. Work with your identity provider to decide which mechanism carries Entra ID or managed identity trust, then write Kafka ACLs for each principal. Shared Access Signatures have no Kafka equivalent, so each one becomes a new credential. Test denials as well as grants. The step is done when every principal authenticates and is refused access it should not have.
Rebuild capture as sink connectors
Event Hubs Capture writes events to Azure Blob Storage or Azure Data Lake Storage. Rebuild each capture pipeline as a Kafka Connect sink connector that writes to your own object storage or data lake. Confirm which sink each pipeline needs, and match the file format, partitioning and naming that downstream readers expect. Run each connector against a test topic and compare its output with a sample from Capture. The step is done when each pipeline has a named connector, a confirmed sink and a matching output sample.
Move topics, offsets and ACLs
Recreate each topic with matching partition counts and retention settings, then use MirrorMaker 2 to replicate topic data, consumer group offsets and ACLs. Its documented scope is between Kafka clusters, so confirm with a test run whether it can read from an Event Hubs source through its Kafka endpoint and which offset and ACL translations apply. Also confirm the export options Event Hubs offers before cutover, since they set your backfill path if MirrorMaker 2 cannot read the source. The step is done when message counts, offsets and ACL lists match on a test topic.
Run both platforms in parallel with rollback
Run producers and consumers on both platforms in parallel, with Event Hubs kept as the rollback path. Dual writes can produce duplicates, so decide per workload which platform is authoritative at each stage. Write a rollback runbook that names the switch for each producer and consumer, the owner who flips it and the checks that must pass first. Rehearse the rollback in a non-production environment before the production cutover. The step is done when a rehearsed rollback succeeds and each workload owner approves cutover in writing.
Decommission the Event Hubs namespace last
Keep the Event Hubs namespace until the retention window has passed and reconciliation checks pass: message counts, offsets, consumer lag, schema versions and capture output must agree between platforms. Archive anything you must keep using the export option confirmed earlier. Then remove Private Link endpoints, managed identities and shared access policies together with the namespace, under change control. The step is done when the reconciliation report is signed off and the namespace is deleted.
What buyers ask before moving off Event Hubs
Is self-hosted Apache Kafka cheaper than Azure Event Hubs?
It depends on your throughput, retention and staffing, so no fixed answer exists until the workload is sized. Apache Kafka has no license fee, but running it costs money every month. The main components are compute for brokers and controllers, storage sized for your retention period and replication factor, network traffic between zones or regions, monitoring and backup tooling, and the staff who operate the cluster. Event Hubs bills by throughput units, processing units or capacity units and, on Basic and Standard, by ingress events, so those meters do not map directly onto a self-hosted cluster. Compare both options at average and peak load, including on-call time. Ask for a quote built from a written scope that lists each component and states what it includes.
How long does it take to move off Event Hubs?
The timeline depends on how many producers, consumers and schemas you run, and the agreed plan sets the dates in writing before work starts. No single duration applies to every estate. The counts that matter most are the number of event hubs and consumer groups, the number of applications that publish or read, the number of schemas in use, and whether any consumers depend on Capture output in Blob Storage or Data Lake Storage. Each application needs a test, a cutover step and a rollback path, so more applications means more work. Running both platforms in parallel for a period adds time but lowers risk. Ask for a plan that lists each workload group, its dependencies, the cutover order and the test window, and check the schedule against your change calendar before accepting it.
What does our team need to provide for a Kafka migration?
The work needs access and people from several teams, plus a test window the business has agreed to. Expect to provide:
- Access to the Azure subscription that holds the Event Hubs namespaces, including read access to configuration, consumer groups and monitoring.
- Named owners for the streaming platform and for each producing and consuming application.
- Identity and network teams who can approve changes to Entra ID or managed identity use, Private Link and firewall rules for the target environment.
- A test window in a non-production environment, followed by an agreed production cutover window.
Confirm these owners and dates in the written scope before work starts, because approvals usually cause more delay than the technical work does.
Can our own engineers run self-hosted Kafka without outside help?
Yes, a capable platform team can run Kafka if it has a written plan for upgrades, monitoring and on-call. Apache Kafka 4.0 supports only KRaft mode, so ZooKeeper-based clusters must migrate before upgrading to 4.x, and brokers require Java 17. Rolling upgrades are supported from each release in the past year to the latest version, so upgrades must be scheduled and owned. Plan for:
- Upgrade and patch cycles, tested first on a staging cluster that mirrors production.
- Monitoring of broker health, consumer lag, disk use and under-replicated partitions.
- An on-call rota with runbooks for broker failure, partition reassignment and client authentication problems.
Some teams bring in outside help for the first build and handover, then run the cluster in-house. Decide early, because that choice changes the scope and the quote.
Do our Kafka-protocol clients need code changes after moving to self-hosted Kafka?
Usually not in application logic, but connection and authentication settings almost always change. Microsoft Learn says existing Kafka workloads can run on Event Hubs without code changes or cluster management, so clients written against the Kafka protocol are a good starting point. What changes is configuration: the bootstrap servers, the security protocol and the authentication mechanism. Event Hubs clients may authenticate with Shared Access Signatures, Entra ID or managed identities, while a self-hosted cluster supports SASL mechanisms such as GSSAPI, PLAIN, SCRAM-SHA-256, SCRAM-SHA-512 and OAUTHBEARER, so you must choose one and configure every client to match. Test each client's connection settings, authentication and consumer group behavior in a non-production cluster. Kafka Streams applications also need at least Java 11, so check runtime versions too.
Is Apache Kafka free to run?
The Kafka software is free to use, but running it is not free. Apache Kafka is released under the Apache License 2.0, and the project itself offers no paid edition, so there is no license fee. Costs recur through the infrastructure that hosts brokers and storage, backup, monitoring, network traffic and the staff who run upgrades and on-call. Some tools around Kafka carry different terms. Schema Registry, REST Proxy, ksqlDB and some connectors are under the Confluent Community License, which forbids offering them as a hosted service that competes with Confluent. Check the license of every component you plan to use, and have counsel review it if you plan to offer a streaming service to others. The Confluent Community License FAQ explains the terms in more detail.
What happens to Event Hubs Capture and Schema Registry after the move?
Capture and Schema Registry have no one-to-one equivalent in Apache Kafka, so each needs its own replacement plan. Event Hubs Capture writes events to Azure Blob Storage or Azure Data Lake Storage, and Event Hubs includes a Schema Registry for Avro and JSON schemas. On a self-hosted cluster you choose how to replace each one, for example a sink connector built on Kafka Connect for archiving and a separate schema registry for governance. Confirm the license terms of any registry you pick, since Schema Registry in the Confluent ecosystem is under the Confluent Community License. Also confirm how archive consumers will read data during and after cutover. Event Hubs retention of up to 7 days on Standard or 90 days on Premium and Dedicated, per Microsoft Learn, does not carry over automatically, so set retention on the cluster you size yourself.
How DeployOpen scopes an evaluation or a move
DeployOpen starts with the workloads that depend on Azure Event Hubs, including the Kafka clients, retention settings, Capture targets and access rules they use. Most engagements are fixed-scope, with deliverables agreed in writing before work starts, and the platform can run in your own cloud account, data center or air-gapped network.
How we scope
- Inventory every Event Hubs namespace, event hub, consumer group, producer and the protocols each one uses.
- Record retention, throughput or capacity tier, Capture targets and Entra ID or SAS access patterns in the written scope.
- Agree deliverables and timing in writing before work starts; most engagements are fixed-scope.
How we build
- Stand up the target Kafka cluster in your infrastructure on Apache Kafka 4.x in KRaft mode, with no ZooKeeper.
- Configure SASL and SSL authentication and ACLs, then test each client against its current access rules.
- Plan the cutover with MirrorMaker 2 for Kafka-to-Kafka copies, and confirm which Event Hubs data can be copied out.
How we hand over
- Deliver architecture notes, runbooks, a topic inventory mapped from event hubs, and security configuration documentation.
- Run a cutover rehearsal with the producers and consumers named in the scope, and record the results.
- Prepare retention, backup and access-review evidence so your compliance team can review the setup.
How we support
- Offer ongoing support, Kafka upgrades and continuous testing under a retainer.
- Plan upgrades around Kafka's supported releases and its rolling upgrade path from the last three releases.
- Run security testing of the Kafka deployment and its access paths, then confirm fixes in a follow-up test.

