What is the purpose of Kafka's MirrorMaker, and how does it work?
Instruction: Explain the use cases for Kafka's MirrorMaker tool and detail how it functions for replicating data across different Kafka clusters.
Updated
Official answer
MirrorMaker 2 replicates selected Kafka data between independent clusters. It is based on Kafka Connect and supports regional data aggregation, migration and disaster-recovery copies. This differs from replicas of a partition inside one cluster.
Its source connector copies records into destination topics, while heartbeat and checkpoint connectors support replication monitoring and consumer-offset translation. Configure cluster aliases, replication flows, topic/group selection, destination naming and the supported configuration/ACL synchronization policy. Source and destination offsets are not interchangeable; checkpointing is not a guarantee that a consumer can resume at exactly the same integer offset.
For an active/passive design, define which source topics are mirrored and measure replication lag and the recoverable cutover point. Promotion requires application routing, credentials, schemas, consumer progress and writer fencing, not merely a healthy MirrorMaker process. An outage can leave recently acknowledged source records absent from the destination.
For bidirectional flows, preserve a naming and ownership policy that prevents replication loops and conflicting writers. Mirroring does not provide a global transaction or conflict-resolution algorithm. Test replay and duplicate handling under the configured delivery guarantees, reconnects and failback.
Scale connector tasks against partition counts and destination capacity; monitor errors, lag and checkpoint freshness. Apply explicit security and data-location policies. Copying records across a border does not automatically satisfy data-residency requirements.