Scenario 20.1.1 · Cluster Linking: byte-for-byte offset-preserving mirror
Confluent Cluster Linking: offset-preserving Kafka mirroring
A cluster link mirrors a topic to another cluster keeping the SAME offsets (no translation) into a read-only mirror you can promote - vs MM2, which re-produces and translates offsets.
Run this scenario in the playgroundTwo links to dr - a cluster link on orders, MM2 on payments. t+0.000s
primary serves orders + payments. cl-orders is a CLUSTER LINK (offset-preserving) with no cluster.link.prefix, the Confluent default: its destination keeps the source name, so orders on dr is a READ-ONLY mirror while orders on primary stays writable. mm-payments is MirrorMaker 2 (the default): it re-produces payments into a renamed primary.payments and translates offsets.
Open at this step: step 1, Two links to dr - a cluster link on orders, MM2 on paymentsOffsets preserved (cluster link) vs translated (MM2). t+0.700s
Both destinations now hold 3 records. The cluster link copied orders byte-for-byte: orders on dr has offsets == source offsets, and the link carries NO offsetMap. MM2 re-produced payments and built an offsetMap translation table on mm-payments - same numbers here, but it is the machinery cluster linking avoids.
Open at this step: step 2, Offsets preserved (cluster link) vs translated (MM2)Consumer offsets synced 1:1 across the cluster link. t+1.100s
g1 read + committed orders on primary. At the t=1000 sync tick the cluster link copied g1's committed offset AS-IS onto cl-orders (no translation) - so a consumer cutting over to the promoted mirror resumes at the exact same offset.
Open at this step: step 3, Consumer offsets synced 1:1 across the cluster linkPromote the mirror - read-only orders becomes writable. t+1.900s
promote_mirror flipped orders on dr from a read-only mirror to a normal writable topic (its state there is now 'promoted') and stopped mirroring it. The simulator drops cl-orders, which carried only this topic; a real cluster link stays up for any other mirror topics. The MM2 payments link is untouched - MM2 has no promote lifecycle.
Open at this step: step 4, Promote the mirror - read-only orders becomes writableWhat you start with
Confluent Cluster Linking mirrors a topic to another cluster while preserving the exact same offsets - no translation table - into a read-only mirror you can later promote. This contrasts with MirrorMaker 2, which re-produces each record and must maintain a source→target offset map.
Step by step
- Two links to dr - a cluster link on orders, MM2 on payments t+0.000s primary serves orders + payments. cl-orders is a CLUSTER LINK (offset-preserving) with no cluster.link.prefix, the Confluent default: its destination keeps the source name, so orders on dr is a READ-ONLY mirror while orders on primary stays writable. mm-payments is MirrorMaker 2 (the default): it re-produces payments into a renamed primary.payments and translates offsets. Open at this step: step 1, Two links to dr - a cluster link on orders, MM2 on payments
- Offsets preserved (cluster link) vs translated (MM2) t+0.700s Both destinations now hold 3 records. The cluster link copied orders byte-for-byte: orders on dr has offsets == source offsets, and the link carries NO offsetMap. MM2 re-produced payments and built an offsetMap translation table on mm-payments - same numbers here, but it is the machinery cluster linking avoids. Open at this step: step 2, Offsets preserved (cluster link) vs translated (MM2)
- Consumer offsets synced 1:1 across the cluster link t+1.100s g1 read + committed orders on primary. At the t=1000 sync tick the cluster link copied g1's committed offset AS-IS onto cl-orders (no translation) - so a consumer cutting over to the promoted mirror resumes at the exact same offset. Open at this step: step 3, Consumer offsets synced 1:1 across the cluster link
- Promote the mirror - read-only orders becomes writable t+1.900s promote_mirror flipped orders on dr from a read-only mirror to a normal writable topic (its state there is now 'promoted') and stopped mirroring it. The simulator drops cl-orders, which carried only this topic; a real cluster link stays up for any other mirror topics. The MM2 payments link is untouched - MM2 has no promote lifecycle. Open at this step: step 4, Promote the mirror - read-only orders becomes writable
The takeaway
Because Cluster Linking copies records byte-for-byte at identical offsets, a consumer can fail over to the mirror and resume at the same positions with no offset remapping.
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.1" title="Kafka Simulator: Cluster Linking: byte-for-byte offset-preserving mirror" 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-offset-preserving/">Confluent Cluster Linking: offset-preserving Kafka mirroring</a></p> Further reading
Kafka proposals behind this scenario
- KIP-382 explained: MirrorMaker 2 for Kafka replication
- KIP-1279 explained: Apache Kafka Cluster Mirroring
More in Cluster mirroring
- Kafka mirror topics (Confluent): read-only until promoted
- Cluster Linking vs MirrorMaker 2 for Kafka replication
- 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