
Geo-Replication and Disaster Recovery with IBM Event Streams
A Kafka cluster with three replicas survives the loss of a broker. It does not survive the loss of a whole data center or cloud region. When your business depends on event streams, you need a plan for that case too. IBM Event Streams offers geo-replication, which copies topics from one cluster to another. This article explains how it works, what it does not do, and how to build a disaster recovery plan around it.
How Geo-Replication Works
Geo-replication in Event Streams is based on Kafka MirrorMaker 2. You choose an origin cluster and a destination cluster, and you select the topics to replicate. The replicator reads messages from the origin and writes them to the destination. It also copies topic configuration and translates consumer group offsets, so that a consumer can continue on the destination cluster close to where it stopped. Replication is asynchronous, which means the destination is always a little behind the origin.
Understand Your Recovery Point
Because replication is asynchronous, a sudden failure of the origin can lose the messages that were not yet copied. This is your recovery point objective. In normal conditions, the delay is often seconds, but it grows when the network between sites is slow or the replicator is overloaded. Monitor the replication lag in the same way you monitor consumer lag, and agree with the business how much loss is acceptable. If the answer is zero, asynchronous replication alone is not enough, and you need a design where producers confirm writes in both sites.
Active-Passive Is the Simple Choice
In an active-passive setup, all producers and consumers use the primary cluster, and the secondary cluster only receives replicated data. During a disaster, you move applications to the secondary cluster. This is the easiest model to understand and to test. Active-active setups, where both clusters receive writes, are possible but much harder, because you must avoid loops and handle the same event arriving in both places. Start with active-passive unless you have a strong reason not to.
Prepare the Applications
Replication is only half of the plan. Applications must be able to switch clusters. Keep the bootstrap address, credentials and certificates in configuration, not in code, and have the values for the secondary cluster ready. Make consumers idempotent, because after a failover they may read some messages again. Make sure the secondary cluster has the same users and access rules, ideally managed from the same git repository. Without these steps, failover becomes a long manual job during the worst possible moment.
Test the Plan
A disaster recovery plan that has never been tested is only a hope. Run a failover test at least twice a year. Stop traffic to the primary, switch one or two applications to the secondary, check that they continue with the right offsets, and measure how long it takes. Then plan and test the way back, which is often forgotten. Write down every manual step you needed, and automate the ones that took the most time.