Apache Kafka mirror maker 2.0

Rakesh singhania
3 min readAug 11, 2023

Apache Kafka MirrorMaker 2 is a tool that enables the replication of data between Kafka clusters. It’s commonly used for scenarios where you need to replicate data across different Kafka clusters, potentially in different data centers or regions. This replication helps with data backup, disaster recovery, data migration, and distribution of data to different environments (e.g., development, testing, production). It’s an improved version of the original MirrorMaker with better performance and reliability.

Use Cases:

  1. Data Replication and Backup: MirrorMaker 2 can be used to replicate data from a primary Kafka cluster to a secondary cluster for backup and data recovery purposes. If the primary cluster goes down, the secondary cluster can take over and continue processing data.
  2. Disaster Recovery: In case of data center failures or other disasters, MirrorMaker 2 can ensure that your data is available in a separate location or cloud region, reducing downtime and data loss.
  3. Data Migration: When you’re transitioning from an older Kafka cluster to a newer one or migrating to a different infrastructure provider, MirrorMaker 2 can help move your data seamlessly.
  4. Geographical Distribution: If you have Kafka clusters in different regions or data centers, you can use MirrorMaker 2 to replicate data across these clusters, ensuring data availability and reducing latency for consumers in different geographic areas.


MirrorMaker 2 is more flexible and efficient than its predecessor. It uses Kafka Connect to manage source and destination connectors, which makes it easier to configure and manage replication tasks. Here’s a high-level overview of the implementation process:

  1. Configure Kafka Connect: Set up Kafka Connect on both the source and target clusters. Kafka Connect is the framework that handles connectors and tasks. You need to configure the appropriate connector plugins for your source and destination Kafka clusters.
  2. Create Connector Configs: Configure connector properties for both…



Rakesh singhania

As a student of technology, each day I take a single step forward on the path of learning.