Quick revision
The short answer
We run a standby Kafka in the second region and replicate the important topics to it with MirrorMaker 2, measuring replication lag continuously because that lag is the real data loss. We also replicate everything clients need besides records: consumer group offsets, topic configs, ACLs, quotas, schemas, Connect configurations and their secrets. Streams applications rebuild their state from replicated inputs or run warm in the second region; clients fail over through DNS or service discovery switched by a runbook; and we prove the design with scheduled failover exercises that measure RPO and RTO.
What to remember
In this answer, we turned five minutes of data loss and one hour of downtime into a design: tiered topics replicated with MirrorMaker 2 to a standby cluster, with replication lag monitored as the real RPO; offsets, configs, ACLs, quotas, schemas, Connect configs and secrets copied alongside; Streams state rebuilt from inputs or kept warm; clients switched by DNS through a scripted runbook with idempotent consumers; and the whole thing proven by regular exercises that measure RPO and RTO and track every gap.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We run a standby Kafka in the second region and replicate the important topics to it with MirrorMaker 2, measuring replication lag continuously because that lag is the real data loss. We also replicate everything clients need besides records: consumer group offsets, topic configs, ACLs, quotas, schemas, Connect configurations and their secrets. Streams applications rebuild their state from replicated inputs or run warm in the second region; clients fail over through DNS or service discovery switched by a runbook; and we prove the design with scheduled failover exercises that measure RPO and RTO.
Why this question is asked
A design question like this one is less about Kafka features and more about thinking through everything that has to be in the other region at the moment we need it. Teams often replicate the records and discover during the first real outage that the schemas, the credentials or the consumer positions were missing. Interviewers ask it at senior level to see whether we can turn two numbers, one hour of downtime and five minutes of data loss, into a concrete design and a way to prove it. In this answer, we will translate the requirements, size the replication, list what else must be copied, handle stateful applications, design client failover, and plan the tests.
1Turning the Requirement Into RPO and RTO
Two terms carry the whole design. RPO, the recovery point objective, is how much data we may lose, measured in time; here it is five minutes. RTO, the recovery time objective, is how long we may be down; here it is one hour. Every choice below should be checked against these numbers.
Not all 300 topics deserve the same treatment, so we start by sorting them into tiers with their owners. Tier 1 might be orders, payments and inventory events that must meet five minutes and one hour. Tier 2 might accept an hour of loss and a few hours of downtime. Tier 3, such as clickstream for analytics, might be rebuilt from an archive or simply restarted empty. Tiering keeps cross-region traffic, which is billed per gigabyte, proportional to value.
2Replicating the Data, and Watching the Lag
Asynchronous replication with MirrorMaker 2, or a provider's equivalent such as cluster linking on a managed service, copies records from each primary cluster to a standby cluster in region B. MirrorMaker 2 runs as Kafka Connect connectors, ideally in region B so it pulls across the region boundary. Its source connector copies records and topic configs, its checkpoint connector copies consumer group offsets translated to the target's offsets, and its heartbeat connector lets us measure that the flow is alive.
Because replication is asynchronous, whatever has not crossed when region A dies is lost. That makes replication lag our actual RPO, and it must stay well below five minutes at peak, not on average. If replication normally runs 10 seconds behind but falls 8 minutes behind during the evening peak or after a burst of reprocessing, an outage at that moment breaks the requirement. So we alert on lag per tier-1 topic with a threshold around one minute, and size the replication workers and the cross-region link for peak throughput plus catch-up headroom.
- Client endpointsbootstrap DNS names, service discovery entries
- ApplicationsStreams apps warm or rebuildable, sink connectors paused
- Kafka Connectconnector configs and secrets in region B's vault
- Schema registryschemas replicated, same ids
- Standby Kafka clustertiered topics, translated offsets, configs, ACLs, quotas
- MirrorMaker 2 in region Brecords, checkpoints, heartbeats; lag is the RPO
6 layers, from the top down. Step through them one at a time.
Records are the bottom layer. Every layer above must also exist in region B before failover.
3Replicating More Than Records
Clients cannot use the standby cluster unless the surrounding metadata is there too. Consumer group offsets come from MirrorMaker 2 checkpoints; without them consumers would start from the beginning or the end. Topic configurations such as partitions, retention and compaction must match. ACLs and quotas must exist, or every client is refused or unlimited on arrival.
Schemas matter just as much. If producers serialize with a schema registry, a record carries a schema id, and the standby registry must return the same schema for that id. We either replicate the registry's _schemas topic so a registry in region B reads the same content, or use the registry product's own replication. Kafka Connect configurations, stored in its config topic, and the secrets they reference, such as database passwords in a vault, need a copy in region B. A connector that starts without its credentials is not recovered.
4Stateful Kafka Streams Applications
Kafka Streams keeps state, for example running totals per customer, in local stores backed by changelog topics. Replicating changelogs looks attractive, but after failover the topic names and offsets differ, since MirrorMaker 2's default policy prefixes names with the source cluster alias, and changelogs must line up exactly with the input offsets. That makes restoring state from a mirrored changelog fragile.
The reliable options are two. We can rebuild state in region B from the replicated input topics, which works when inputs are retained long enough and rebuilding fits inside the hour; a store of 200 GB rebuilt at 100 MB/s takes about 35 minutes. Or, for the most important applications, we run warm standby instances in region B that consume the replicated inputs all the time, so their state is already built and failover only switches their output on.
5Failing Clients Over
Clients find Kafka through bootstrap addresses, so we put those behind DNS names or service discovery that the runbook switches from region A to region B. The runbook order matters. First we make sure producers in region A are stopped, if anything there still runs, so no records land in a cluster that consumers have left. Then we promote the standby: stop the MirrorMaker 2 flow and enable writes. Consumers start in region B from translated offsets; since translation is approximate and replication is async, they will see some duplicates, so consumer processing must be idempotent. Then producers start writing to region B.
Sink connectors that write into databases or search indexes need a check against their targets, because they may resume slightly before or after the last record they wrote. The order and the commands should be scripted, since a one-hour RTO leaves little room for improvisation.
6Proving It Works
A DR design that has never been exercised is a hope. We schedule failover exercises, at first in a staging environment with production-like traffic and then for real tiers in production, and we measure actual RPO, from the last record replicated, and actual RTO, from the start of the outage to the moment tier-1 flows are processing again. Each exercise produces a list of gaps, a missing ACL or a connector without its secret, and each gap gets an owner and a date.
We also document failback. After region A returns, data written in region B must be replicated back before clients move home, which is a second planned migration. Running exercises every quarter keeps the runbook honest as the platform changes.
7Follow-up questions
Why not use active-active across regions to reduce RTO further?
Active-active means producers write in both regions and each region mirrors the other, which needs topic naming that keeps origins apart and consumers that merge both. It brings RTO close to zero for writes, but it adds complexity in ordering and duplicates and roughly doubles cost. For a one-hour RTO, active-passive with a warm standby is usually enough; active-active is for the few flows that cannot stop.
Which MirrorMaker 2 replication policy should we use?
The default policy prefixes replicated topics with the source alias, such as primary.orders, which avoids loops in two-way setups but means consumers must subscribe to new names after failover. IdentityReplicationPolicy keeps names unchanged, which simplifies one-way DR. The choice should be made once and the runbook written for it.
8Conclusion
In this answer, we turned five minutes of data loss and one hour of downtime into a design: tiered topics replicated with MirrorMaker 2 to a standby cluster, with replication lag monitored as the real RPO; offsets, configs, ACLs, quotas, schemas, Connect configs and secrets copied alongside; Streams state rebuilt from inputs or kept warm; clients switched by DNS through a scripted runbook with idempotent consumers; and the whole thing proven by regular exercises that measure RPO and RTO and track every gap.
Open with
I would start by tiering the 300 topics with their owners, because only some flows need the five-minute and one-hour targets. For those, I would run a standby cluster in the second region and replicate with MirrorMaker 2 running in that region.
Then, if they want more
Since replication is asynchronous, the replication lag is my real RPO, so I would monitor it per topic at peak and alert well below five minutes.
Then I would replicate everything clients need besides records: consumer offsets through the checkpoint connector, topic configs, ACLs and quotas, the schema registry's schemas so ids match, and Connect configurations plus the secrets they reference.
For Kafka Streams I would not rely on mirrored changelogs, because names and offsets differ; I would either rebuild state from replicated inputs within the hour or run warm standby instances.
For client failover I would put bootstrap servers behind DNS or service discovery and script the runbook: stop producers in the failed region, promote the standby, start consumers from translated offsets with idempotent processing, check sink connectors against their targets, then move producers.
Finally I would prove it with scheduled failover exercises that measure RPO and RTO per tier, plus a documented failback, and track every gap to closure.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Design disaster recovery for an event platform that runs in one cloud region: two Kafka...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-operations/85c55802d3/