Scenario 20.1.3 · Cluster Linking vs MirrorMaker 2: when to use which
Cluster Linking vs MirrorMaker 2 for Kafka replication
Same topology, two replication models side by side: a cluster link mirrors offset-preserving into a read-only mirror (no translation table); MM2 re-produces and maintains a source→target offsetMap.
Run this scenario in the playgroundTwo links, two models. t+0.000s
Same topology, two replication models: orders is mirrored by a CLUSTER LINK (kind 'cluster-link') into a read-only mirror that keeps the source name, orders on dr; payments is mirrored by MIRRORMAKER 2 (the default) into a renamed primary.payments (just mirrored, no promote lifecycle).
Open at this step: step 1, Two links, two modelsBoth mirroring in progress. t+0.500s
The cluster link copies orders OFFSET-PRESERVING (destination offset == source offset, no translation table). MM2 RE-PRODUCES payments and starts building a source→target offsetMap. Both destinations trail the source by the mirror cadence.
Open at this step: step 2, Both mirroring in progressContrast: offsetMap vs none. t+0.900s
Steady state. CLUSTER LINK cl-orders: offsetMap UNDEFINED (offsets preserved), destination orders on dr read-only, same name as the source. MM2 mm-payments: offsetMap {0:{0:0,1:1,2:2}}, the simulator's per-record table (real MM2 keeps sparse offset syncs, so its translation can land a little early), into a renamed, writable primary.payments with no mirror state. Pick Cluster Linking for broker-native offset-preserving DR/migration inside Confluent; pick MM2 to bridge clusters that don't speak the linking protocol.
Open at this step: step 3, Contrast: offsetMap vs noneWhat you start with
This scenario runs the two cross-cluster replication models side by side on the same topology. Cluster Linking mirrors offset-preserving into a read-only mirror with no translation table, while MirrorMaker 2 re-produces records through Connect and maintains a source→target offset map.
Step by step
- Two links, two models t+0.000s Same topology, two replication models: orders is mirrored by a CLUSTER LINK (kind 'cluster-link') into a read-only mirror that keeps the source name, orders on dr; payments is mirrored by MIRRORMAKER 2 (the default) into a renamed primary.payments (just mirrored, no promote lifecycle). Open at this step: step 1, Two links, two models
- Both mirroring in progress t+0.500s The cluster link copies orders OFFSET-PRESERVING (destination offset == source offset, no translation table). MM2 RE-PRODUCES payments and starts building a source→target offsetMap. Both destinations trail the source by the mirror cadence. Open at this step: step 2, Both mirroring in progress
- Contrast: offsetMap vs none t+0.900s Steady state. CLUSTER LINK cl-orders: offsetMap UNDEFINED (offsets preserved), destination orders on dr read-only, same name as the source. MM2 mm-payments: offsetMap {0:{0:0,1:1,2:2}}, the simulator's per-record table (real MM2 keeps sparse offset syncs, so its translation can land a little early), into a renamed, writable primary.payments with no mirror state. Pick Cluster Linking for broker-native offset-preserving DR/migration inside Confluent; pick MM2 to bridge clusters that don't speak the linking protocol. Open at this step: step 3, Contrast: offsetMap vs none
The takeaway
Reach for Cluster Linking when you want identical offsets and a simple managed mirror (DR, migration); reach for MirrorMaker 2 when you need Connect-based flexibility and accept offset translation.
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=20.1.3" title="Kafka Simulator: Cluster Linking vs MirrorMaker 2: when to use which" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/cluster-linking-vs-mm2/">Cluster Linking vs MirrorMaker 2 for Kafka replication</a></p> Further reading
More in Cluster mirroring
- Confluent Cluster Linking: offset-preserving Kafka mirroring
- Kafka mirror topics (Confluent): read-only until promoted
- Kafka consumer offset sync: Cluster Linking vs MirrorMaker 2
- Kafka failover and failback with Confluent Cluster Linking
- Apache Kafka Cluster Mirroring (KIP-1279): stop and failback
- kaf-mirror failover: Kafka consumers re-read from earliest
- kaf-mirror failover: latest skips unread Kafka records
- kaf-mirror vs MirrorMaker 2: Kafka failover resume points