On this page
Kafka guide · Multi-DC and DR
Kafka disaster recovery across data centers
Running Kafka across sites starts with one choice: a single cluster stretched over them, replicating synchronously, or a cluster per site with an asynchronous copy between them. This page sets out what each architecture costs in lost records, downtime, write latency, money and operations, which replication tool fits when clusters are mirrored, and what to measure in your own setup before you commit.
Start with RPO and RTO
RPO is how many acknowledged records you can lose when a site goes. In Kafka it follows from where a record is when the producer gets its ack: zero only if the ack waits for a copy in another site, otherwise the lag of whatever copies records across.
RTO is how long producers and consumers cannot work. Inside one cluster it is a leader election, which the controller runs without an operator. Between clusters it is the time to decide to fail over, move every client to the other cluster and position each consumer group there.
Questions to answer first
- How many acknowledged records may be lost when a site goes: none, or the writes of a known number of seconds?
- How many seconds may the standby trail the primary before a downstream promise breaks?
- Can downstream systems take the same record twice without a double charge or a duplicate row?
- How soon must producers and consumers be working again, and what points them at the other cluster?
- Is a person deciding to fail over acceptable, or must it happen without one?
What one cluster already gives you
One cluster already survives losing brokers. A record is committed when every replica in the partition’s in-sync replica set (ISR) has it, a topic with f+1 replicas tolerates f failures without losing committed records, and when a leader fails the controller elects a new one from the remaining ISR members.
That replication is synchronous: an acks=all producer is acked only after every in-sync replica has the record. Replication between clusters is asynchronous with every tool on this page: the producer is acked by its own cluster and the copy follows. So zero data loss across sites needs one cluster whose ISR spans the sites, and every write then waits for the round trip between them.
replication.factor- Copies of each partition. With f+1 replicas, a partition tolerates f failed replicas without losing committed records. Apache Kafka 4.3 docs, Design: Replication
broker.rack- The broker’s failure domain, which can be its data center. Kafka then spreads each partition over min(racks, replication factor) of them, so RF=3 over three sites puts one replica in each. Apache Kafka 4.3 docs, Balancing replicas across racks
acks=all- The producer is acked once every current in-sync replica has the record, even when
min.insync.replicasis lower. An ISR that spans sites puts the slowest site into every write. Apache Kafka 4.3 docs, topic config min.insync.replicas min.insync.replicas- The smallest ISR that still takes
acks=allwrites; below it the producer getsNotEnoughReplicas. The default is 1. With RF=3 and 2, writes continue after one replica is lost and stop after two. Apache Kafka 4.3 docs, topic config min.insync.replicas unclean.leader.election.enable- Default
false: a partition with no in-sync replica left stays offline rather than elect a replica that may lack committed records.truetrades those records for availability. Apache Kafka 4.3 docs, topic config unclean.leader.election.enable
The architectures side by side
| Dimension | Stretched cluster, 3 DCs | Stretched cluster, 2.5 DCs | Active-passive | Active-active |
|---|---|---|---|---|
| RPO | Zero for acknowledged writes with RF=3, one replica per site and min.insync.replicas=2: every acked record is in at least two sites. source: Apache Kafka 4.3 docs, topic config min.insync.replicas | Zero while the ISR spans both data sites. With RF=4, two per site, min.insync.replicas=3 keeps every acked record in both; at 2, an ISR shrunk to one site acks writes held only there. source: Apache Kafka 4.3 docs, topic config min.insync.replicas | The mirror’s lag when the primary fails. Records not yet copied are lost on failover, whichever tool copies them. source: Confluent Cloud docs, Cluster Linking disaster recovery and failover | The lag of the lost region’s outbound mirror. What it wrote and had not copied is missing on the survivor, until and unless the region returns with its disks. source: Confluent Cloud docs, Cluster Linking disaster recovery and failover |
| RTO | A leader election for each partition that lost its leader, run by the controller from the remaining in-sync replicas. source: Apache Kafka 4.3 docs, Design: Replication | The same election, if min.insync.replicas still fits in one site; if not, acks=all writes stop. Confluent’s automatic observer promotion adds observers to the ISR to keep them going. source: Confluent Platform docs, Configure Multi-Region Clusters | Detect, decide, then move every client to the standby and position each consumer group. Cluster Linking’s failover runs whatever the lag or the source’s state; promote needs zero lag and the source online. source: Confluent Platform docs, Cluster Linking mirror topics | No promotion: the lost region’s producers reconnect to the survivor, which already takes writes. Each moved consumer group still has to start on the survivor’s copy of its region’s topic (west.orders under MirrorMaker 2’s default naming) at a translated or synced offset. source: Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring) |
| Write latency | Every acks=all write waits for the in-sync replicas in the other sites, so the round trip to the farthest site in the ISR is in every produce. source: Apache Kafka 4.3 docs, topic config min.insync.replicas | Apache: the round trip between the two data sites. Confluent: observers are not waited for, so a topic with its sync replicas in one site acks at local latency. source: Confluent Platform docs, Configure Multi-Region Clusters | Local. The producer is acked by its own cluster; the mirror copies afterwards. source: Confluent Platform docs, Cluster Linking mirror topics | Local in each region, for the same reason. source: Confluent Platform docs, Cluster Linking mirror topics |
| Cost | Three sites with brokers. RF=3 puts one replica in each, so every record crosses sites twice. source: Apache Kafka 4.3 docs, Balancing replicas across racks | Two sites with brokers and a third that runs only a KRaft controller. RF=4, two per site, puts two replicas away from the leader’s site, so every record crosses sites twice. source: Confluent Platform docs, Configure Multi-Region Clusters | Two full clusters, each with its own controller quorum, plus the mirror’s own processes unless it runs in the brokers. Every record crosses once. source: Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring) | Two full clusters, both serving traffic, and a mirror in each direction. Every record crosses once. source: Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring) |
| Operational complexity | One cluster. Set broker.rack to the site and place one KRaft voter in each: with 3 voters, losing any one site leaves a majority. source: Apache Kafka 4.3 docs, KRaft: deploying considerations | One cluster and a controller-only site. Confluent warns that a partition between the brokers that leaves the controllers connected needs manual action, even with automatic observer promotion. source: Confluent Platform docs, Configure Multi-Region Clusters | Two clusters to keep in step: the standby needs topic configs, ACLs and consumer group offsets, not only records. Failover and failback are runbooks to rehearse. source: Confluent Platform docs, Cluster Linking mirror topics | Two clusters, two mirrors and cycles to prevent. MirrorMaker 2 prefixes each copied topic with its source cluster’s alias, so each region writes its own topic and reads both. source: Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring) |
| Vendor-only parts | None. Racks, min.insync.replicas and the KRaft quorum are Apache Kafka. | Observers, automatic observer promotion and replica placement constraints (Confluent Server). The controller-only third site is Apache Kafka. source: Confluent Platform docs, Configure Multi-Region Clusters | Only the mirror, if it is Replicator or Cluster Linking (Confluent) or K2K (Lenses). MirrorMaker 2 is Apache Kafka; Apache Kafka’s Cluster Mirroring (KIP-1279) is accepted but not yet released. source: KIP-1279: Cluster Mirroring (status Accepted) | Only the mirror, as for active-passive. Cluster Mirroring (KIP-1279) does not support same-topic active-active at first; it can mirror different topics in each direction. source: KIP-1279: Cluster Mirroring (status Accepted) |
| In the simulator |
|
|
|
|
| Stretched cluster, 2 DCs: The design not to choose | A cluster stretched over only two sites is the design not to choose. With one KRaft controller in each, a broken link splits the voters one and one, and neither side has the majority the quorum needs. Confluent’s guidance for two data centers is a preferred site that wins every election, such as a 3:2 voter split, or reconfiguring the quorum by hand during the partition; with 3:2, losing the site that holds three voters loses the quorum. The in-sync replicas have the same problem: if
| |||
Stretched cluster, 2.5 DCs, vendor-only parts. Observers and automatic observer promotion are Confluent Server features (Multi-Region Clusters). A third site that runs only a KRaft controller is plain Apache Kafka.
Choosing: what it depends on
If no acknowledged record may be lost
Only synchronous replication inside one cluster gets RPO to zero, which rules out every mirror. That means a stretched cluster over three sites, or over two with a third that runs a KRaft controller, close enough that the round trip between them fits inside every write.
A stretched cluster puts that round trip into every acks=all produce, and min.insync.replicas decides whether losing a site stops writes or lets a write rest on one site.
What to measure: RTT between your sites, and produce p99 with acks=all against a test topic whose replicas span them.
- Durability vs latency placementOne cluster, two topics: a synchronous replica in each site survives a site loss but waits for the remote site on every write; a local replica plus a remote observer is fast and risks the last writes.
- Stretched 3-DCThree sites, one controller each: losing one keeps the quorum and the elections.
If you have only two data centers
A stretched cluster then needs a third location running only a KRaft controller, so either data center can go without taking the quorum. Without one, run a cluster in each data center, mirror between them and accept an RPO above zero.
With the third location, choose min.insync.replicas knowing which failure you prefer: writes stopping when a site goes, or writes acked by one site while the other is down. Confluent’s automatic observer promotion is the vendor answer to the first: it adds observers to the ISR so that writes continue.
What to measure: Whether a third location can host one KRaft controller, and which topics stay writable with acks=all when either data center is down.
- Losing a whole DCWith a controller-only third site, losing the leader’s data center keeps the quorum and writes resume in the other.
- 2-DC freezeWithout it, a split between the two sites freezes leader election.
If the sites are far apart
When the round trip is too long to sit in every write, keep each cluster within one site and copy between clusters asynchronously. The RPO is then the mirror’s lag, a number you measure rather than a setting you choose.
What to measure: Mirror lag at peak write load, and how far it grows when the link between sites slows down or drops.
- Active-passive mirrorCut the link between regions and watch the mirror lag grow.
- Failover + RPOFail over with lag outstanding and count the records the standby never got.
If both sites must take writes
Active-active runs both clusters live. Each region writes its own topics and mirrors them to the other, and a consumer that needs every record reads both. Failing over moves the lost region’s clients instead of promoting a standby.
What to measure: Which streams can be split by home region, and which consumers would then have to read two topics per stream.
- Active-active multi-clusterRegion-named topics mirrored both ways; a cut between regions leaves local traffic running.
- Active-active DR drillA region lost and its clients moved to the survivor and back again.
If clusters are mirrored: which tool
The tool decides where a consumer group resumes and whether failback is clean. With every tool that syncs or translates offsets, a group resumes at its last synced or translated position and rereads what it committed after it. Cluster Linking and KIP-1279 keep offsets identical, so the synced position is exact and the topic keeps its name; MirrorMaker 2, Replicator and K2K give the standby its own offsets, so the position is mapped and can land early, and MirrorMaker 2 renames the topic by default.
What to measure: The gap between each group’s last committed offset and its last translated or synced one, at your sync interval and peak consume rate.
- Offset translation across clustersMirrorMaker 2 checkpoints a group’s offset; after failover it resumes at the last checkpoint and rereads the commits since.
- Consumer offset sync across a linkA cluster link syncs the committed offset as it is; MirrorMaker 2 translates it through its offset map.
- kaf-mirror failover: latest skips unread recordskaf-mirror syncs no offset at all: with
latestthe group starts at the end of the copy and skips the records it had not read.
The replication tools compared
Every tool in the table copies asynchronously, so none gets the RPO below the mirror’s lag at the moment of failure: records not yet copied when the primary goes are lost with every one. They differ in where a consumer group resumes on the standby, what has to run to keep the copy going, and what license it needs.
A full mark means strong, a half mark works with caveats and an empty mark is weak, each against the criterion beside its row. The example under the table follows one outage through every tool in the table; the offsets page explains it in full.
| Dimension | MirrorMaker 2 | Confluent Replicator | Lenses K2K | kaf-mirror | Cluster Linking | Cluster Mirroring (KIP-1279) |
|---|---|---|---|---|---|---|
| License / availability | ● Open source Apache Kafka, open-source source: MirrorMaker 2, License / availability | ○ Commercial Confluent (commercial) source: Confluent Replicator, License / availability | ○ Commercial, small free tier Lenses (commercial); without a license key it replicates up to 5 partitions in total per pipeline, and offset mapping needs a license source: Lenses K2K, License / availability | ● Open source Apache 2.0, open source source: kaf-mirror, License / availability | ○ Commercial Confluent (commercial) source: Cluster Linking, License / availability | ◐ Open source, not yet released Apache Kafka, open-source; KIP-1279 is accepted but not yet in a release source: Cluster Mirroring (KIP-1279), License / availability |
| Runs on | ◐ A Connect cluster Kafka Connect cluster source: MirrorMaker 2, Runs on | ◐ A Connect cluster Kafka Connect cluster source: Confluent Replicator, Runs on | ◐ Its own apps, no Connect Its own standalone app (Docker image or Helm chart), no Connect cluster; consumer groups need a second app, the offset mapper source: Lenses K2K, Runs on | ◐ Its own app, no Connect One server binary with a dashboard (run directly, in Docker or with its Helm chart), with its jobs in a SQLite database; no Connect cluster source: kaf-mirror, Runs on | ● The brokers Broker-native - no Connect cluster source: Cluster Linking, Runs on | ● The brokers Broker-native - no Connect cluster source: Cluster Mirroring (KIP-1279), Runs on |
| Consumer offsets | ◐ Translated, approximate Translated via an offset-sync topic (approximate) source: MirrorMaker 2, Consumer offsets | ◐ Translated Translated (offset-translation / interceptors) source: Confluent Replicator, Consumer offsets | ◐ Translated, continuously Translated: the replicator records offset mappings and the offset mapper commits translated group offsets on the target every few seconds source: Lenses K2K, Consumer offsets | ○ Not translated Not translated: the target assigns its own offsets and no consumer group offsets are synced source: kaf-mirror, Consumer offsets | ● Identical Preserved exactly - identical offsets on both clusters source: Cluster Linking, Consumer offsets | ● Identical Preserved exactly - the mirror copies the log 1:1 source: Cluster Mirroring (KIP-1279), Consumer offsets |
| Topic names | ◐ Prefixed by default Prefixed with source alias by default (configurable to identity) source: MirrorMaker 2, Topic names | ● Preserved Preserved source: Confluent Replicator, Topic names | ● Your choice per pipeline Chosen per pipeline: keep the source name (topic: source), add a prefix or suffix, or route to a fixed name or by pattern mapping source: Lenses K2K, Topic names | ● Same name by default Same name by default; an exact or regex mapping (with capture groups) renames source: kaf-mirror, Topic names | ● Preserved, read-only until promoted Preserved; destination mirror topics are read-only until promoted source: Cluster Linking, Topic names | ● Preserved, read-only until stopped Preserved; the same-name mirror is read-only until the mirror is stopped source: Cluster Mirroring (KIP-1279), Topic names |
| Failover experience | ◐ Translated resume Resume using translated offsets source: MirrorMaker 2, Failover experience | ◐ Translated resume Resume using translated offsets source: Confluent Replicator, Failover experience | ◐ Translated resume, recent Resume using translated offsets, as fresh as the offset mapper’s last commit source: Lenses K2K, Failover experience | ○ auto.offset.reset A group starts at its auto.offset.reset on the standby: earliest reads everything again, latest skips what it had not read source: kaf-mirror, Failover experience | ● Same offsets, last sync Offsets identical; a group resumes at its last offset sync, clamped to the mirror’s end source: Cluster Linking, Failover experience | ● Same offsets, delta failback Offsets identical; a group resumes at its last offset sync, clamped to the mirror’s end; fail back truncates to the last mirror epoch and copies only the delta source: Cluster Mirroring (KIP-1279), Failover experience |
| Operational overhead | ○ Higher Higher (run + scale Connect) source: MirrorMaker 2, Operational overhead | ○ Higher Higher (run + scale Connect) source: Confluent Replicator, Operational overhead | ◐ Medium Medium (run + scale the replicator and the offset mapper, no Connect) source: Lenses K2K, Operational overhead | ● Low Low (one service; jobs, users and audit trail in its SQLite database) source: kaf-mirror, Operational overhead | ● Lowest Lowest (built into the broker) source: Cluster Linking, Operational overhead | ● Lowest Lowest (built into the broker) source: Cluster Mirroring (KIP-1279), Operational overhead |
| Best fit | Any Kafka, cross-vendor Any Kafka / cross-vendor, OSS source: MirrorMaker 2, Best fit | Confluent, Cluster Linking preferred Confluent Platform; Confluent recommends Cluster Linking for most use cases source: Confluent Replicator, Best fit | Any Kafka API cluster Any Kafka API-compatible cluster source: Lenses K2K, Best fit | Any Kafka API cluster Any Kafka API-compatible cluster, KafScale v2.1.0 and later included; standbys and backups where consumers can restart from a reset policy source: kaf-mirror, Best fit | Confluent DR, simplest ops Confluent Platform / Cloud DR with simplest ops source: Cluster Linking, Best fit | OSS Kafka DR, once released Open-source Apache Kafka DR, once released; no same-topic active-active for now source: Cluster Mirroring (KIP-1279), Best fit |
What each row judges
- License / availability
- Whether you can run it without a commercial license.
- Runs on
- Whether it needs a separate Kafka Connect cluster, or runs inside the brokers.
- Consumer offsets
- Whether a committed offset names the same record on the standby, or has to be translated.
- Topic names
- Whether the topic keeps its name on the standby, so clients need no change.
- Failover experience
- How exactly a consumer group resumes on the standby after a failover.
- Operational overhead
- How much infrastructure you run and scale to keep the copy going.
- Best fit
- This row is a description, not a verdict: where each tool is the natural choice.
Sources for the table
- Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring)
- Confluent Platform docs, Replicator overview
- Lenses K2K docs, licenses
- kaf-mirror v2.0.0 README
- Confluent Platform docs, Cluster Linking overview
- KIP-1279: Cluster Mirroring (status Accepted)
- KIP-382: MirrorMaker 2.0
- Lenses K2K docs, deployment
- Confluent Platform docs, Replicator failover and consumer offset translation
- Lenses K2K docs, offset mapping reference
- kaf-mirror v2.0.0 docs, What a copied record keeps ("Offsets are not kept")
- Confluent Platform docs, Cluster Linking mirror topics
- Apache Kafka 4.3 Javadoc, IdentityReplicationPolicy
- Lenses K2K docs, topic selection and data routing
- kaf-mirror v2.0.0 source, internal/kafka/kaf-mirror.go
- Lenses K2K docs, architecture
- Lenses K2K docs, releases and compatibility
One outage, six tools
| Tool | Standby topic | Group resumes at | Rereads | Lost |
|---|---|---|---|---|
| MirrorMaker 2 | primary.orders | 1240 (offset 240 on the standby) | 4 records | 6 records |
| Confluent Replicator | orders | 1241 (offset 241 on the standby) | 3 records | 6 records |
| Lenses K2K | orders | 1242 (offset 242 on the standby) | 2 records | 6 records |
| kaf-mirror | orders | 1000 (offset 0 on the standby, from the log start) | 244 records | 6 records |
| Cluster Linking | orders (mirror) | 1244 | 0 records | 6 records |
| Cluster Mirroring (KIP-1279) | orders (mirror) | 1244 | 0 records | 6 records |
- MirrorMaker 2
- Offsets on the standby are its own numbers. A checkpoint translated the group to 1240 before the outage, so it resumes there.
- Confluent Replicator
- Offsets are translated too (by timestamp), so the group resumes near, not at, where it stopped.
- Lenses K2K
- Offsets on the standby are its own numbers. The offset mapper had last committed the group at 1242, the position its last poll translated, so it resumes close to, not at, where it stopped.
- kaf-mirror
- No offsets are translated. With auto.offset.reset=earliest the group starts at the standby’s first record and reads everything again; with latest it starts at the end and skips what it had not read.
- Cluster Linking
- The mirror topic keeps the same offsets. On failover the synced offset is clamped to the mirror’s end, so the group resumes at the first record written on the standby after failover.
- Cluster Mirroring (KIP-1279)
- Stopping the mirror makes the same-name topic writable with the same offsets. The synced offset is clamped to the mirror’s end, so the group resumes at the first record written on the standby after failover.
The simulator models three kinds of mirror from this table: an async mirror that translates committed offsets through checkpoints (MirrorMaker 2, or Lenses K2K with its exact offset mapping), Cluster Linking mirror topics that keep offsets identical, and kaf-mirror, which copies under the same name but translates no offsets. The example above is illustrative.
Test it before you need it
- Partial failures first. Kill one broker, then one controller, under production-like load. Check that
acks=allwrites continue while the ISR stays at or abovemin.insync.replicas, and that leadership moves without an operator. - Then the links between sites. Cut or slow the network between sites and stop the replication process. Watch the mirror lag grow, which is the RPO you would have at that moment, and see how producers and the controller quorum behave on each side.
- Then a whole site. Take a full site out, fail over, run on the survivor and fail back. Time each step from the first alert to the last consumer group reading again.
What to measure
- Actual RPO: the records the primary acked that the survivor never got, per partition.
- Actual RTO, split into detection, decision and moving clients.
- Client redirection: what points producers and consumers at the other cluster, and how long it takes.
- Where each consumer group resumed against its last committed offset on the primary: records read twice and records skipped.
- Failback: what happened to the records the old primary held but never copied.
Pages in this area
- Kafka consumer offsets in failover and failback
- Kafka stretched cluster across three data centers
- Kafka 2.5-DC stretched cluster: two sites and a tiebreaker
- Kafka cluster failover: active-passive, step by step
- Kafka active-active: two live clusters, mirrored both ways
- kaf-mirror: Kafka mirroring without offset translation
Sources
- Apache Kafka 4.3 docs, Design: Replication
- Apache Kafka 4.3 docs, topic config min.insync.replicas
- Apache Kafka 4.3 docs, topic config unclean.leader.election.enable
- Apache Kafka 4.3 docs, Balancing replicas across racks
- Apache Kafka 4.3 docs, KRaft: deploying considerations
- Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring)
- KIP-382: MirrorMaker 2.0
- KIP-1279: Cluster Mirroring (status Accepted)
- Confluent Platform docs, Configure Multi-Region Clusters
- Confluent Platform docs, Cluster Linking mirror topics
- Confluent Cloud docs, Cluster Linking disaster recovery and failover
- Confluent Platform docs, Replicator failover and consumer offset translation
- Lenses K2K docs, offset mapping reference
- Michał Matłoka, Guide to Apache Kafka Disaster Recovery and Multi-Region Architectures (SoftwareMill, 31 March 2026)
Changes to this page
- The copy names no fixed number of replication tools, and a group resumes at its last synced or translated position only with a tool that syncs or translates offsets.
- First published: the architecture table, the decision outline, the replication tools compared and the test ladder.