---
title: "Active-active Kafka with MirrorMaker 2 and region topics"
description: "West and east each own a region-named topic mirrored to the other. A cut stalls both Kafka mirrors, local writes go on, and after the heal nothing is lost."
url: https://monedula.dev/kafka-simulator/scenarios/active-active/
---

# Active-active Kafka with MirrorMaker 2 and region topics

Scenario 09.2.3 · Active-active multi-cluster. Disaster recovery · Advanced · about 3 min · Apache Kafka 4.3.

Each region OWNS a region-named topic (east.orders / west.orders) and mirrors it to the other; both topics live on both sides - local read+write, remote read-only - so there is no same-name ambiguity. An inter-region cut grows lag on both links.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3

## What you start with

An active-active topology: two regions, each owning a region-prefixed topic (east.orders / west.orders) that it reads and writes locally and mirrors read-only into the other region. Namespacing topics by region avoids same-name collisions, and a per-region consumer group subscribed to both topics sees the global stream exactly once. We cut the inter-region link to watch lag grow on both mirror directions, then heal.

## Step by step

1. **Two active regions - west and east each serve a local orders, mirroring to the other** (t+0.000s): west and east are both live clusters. Each owns one topic (west.orders, east.orders) that it writes locally and mirrors to the other region over mm-w2e and mm-e2w, so both regions hold both topics. The mirror keeps the source name (IdentityReplicationPolicy), so there is no east.east.orders - but MM2 cannot detect cycles under that policy, so each link must replicate only its own region's topic. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3&t=0)
2. **Both regions committed one record locally - neither mirrored yet (lag 1 each way)** (t+0.900s): pw wrote Ow1 to west.orders in west and pe wrote Oe1 to east.orders in east (HW 1 each). Each region's consumer group has read its own local record (committed 1), but neither mirrored-in copy has it yet, so each link has lag 1. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3&t=1)
3. **Mirror converged - each region now holds the other region record via its remote topic (lag 0)** (t+1.700s): Both links copied their record at t=1500: west now holds east.orders at HW 1 and east holds west.orders at HW 1. cg-west and cg-east each consumed the mirrored-in record, so each group has seen both orders exactly once, one local and one remote. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3&t=2)
4. **Inter-region link cut - both regions keep accepting local writes; lag grows on both links (lag 1 each)** (t+2.600s): The regions were split at t=2000. Both keep accepting local writes: Ow2 lands in west.orders (HW 2) and Oe2 in east.orders (HW 2), and each group reads its local record. The mirrored-in copies stay at HW 1, so each region is missing the other's latest order. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3&t=3)
5. **Healed - both mirrors caught up, each region holds the full union (lag 0)** (t+3.600s): The network healed at t=3100 and both mirrors copied offset 1 at t=3500. Every copy of both topics is at HW 2, and cg-east and cg-west have each committed 2 on both topics. No write was lost - in active-active a cut only delays cross-region visibility. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=09.2.3&t=4)

## The takeaway

Active-active runs both regions live by namespacing topics per region and mirroring bidirectionally - each side serves its local writes and reads the other’s via the mirror. An inter-region cut only stalls the mirrors; both regions keep serving local traffic.

## Further reading

- [Apache Kafka documentation](https://kafka.apache.org/43/operations/geo-replication-cross-cluster-data-mirroring/)
