Cross-Cluster Replication
5. Cross-Cluster Replication
a. MirrorMaker 2 Overview
MirrorMaker 2 is Kafka’s built-in tool for replicating data between clusters. It is commonly used for disaster recovery, data migration, and multi-region streaming architectures. Its job is to copy topics and offsets from one Kafka cluster to another.
This is useful when you want a secondary cluster to have the same event stream as the primary cluster. For the bookstore, one region might write order events while another region keeps a replicated copy for resilience or analytics. MirrorMaker 2 makes that possible without rewriting application logic.
The main advantage is decoupling between clusters. The source cluster continues serving local workloads, while the target cluster receives replicated data. That gives you flexibility in region design and recovery planning.
b. Disaster Recovery Strategies
Cross-cluster replication is a core part of disaster recovery. If a primary region goes down, a replicated Kafka cluster in another region can continue processing events. The idea is to reduce downtime and data loss during major failures.
A good disaster recovery plan defines recovery point objective and recovery time objective. The recovery point objective describes how much data loss is acceptable, while the recovery time objective describes how long recovery can take. Kafka replication strategy should be designed around those business targets.
The more frequently data is replicated, the lower the risk of loss. But replication across regions adds latency and cost, so there is always a tradeoff. Disaster recovery is therefore not just a technical choice; it is a business continuity decision.
c. Multi-Region Kafka Deployments
Multi-region Kafka deployments are often used by organizations with globally distributed users. Each region may have local producers and consumers, while events are replicated to one or more other regions. This improves resilience and may also reduce latency for local applications.
The challenge is keeping the architecture simple enough to operate. Cross-region replication adds network complexity, potential duplication issues, and failover planning. Still, when designed well, it gives Kafka strong availability characteristics across geographic boundaries.
For the bookstore, a multi-region setup could let East and West regions process local traffic while sharing a common event history. That supports regional failover and easier analytics aggregation. Multi-region design is one of Kafka’s strongest advanced use cases.
Comparison: Replication Use Cases
Use Case | Main Goal | Typical Pattern |
| Disaster recovery | Continuity during outages | Primary + secondary cluster |
| Data migration | Move topics between clusters | One-time replication |
| Multi-region deployment | Local resilience and latency reduction | Active-active or active-passive |










