Apache Kafka Tutorial 0/111 lessons ~6 min read Lesson 72
Multi-Cluster Kafka
What is Multi-Cluster Kafka?
Course progress0%
Focus
9 guided sections
Practice signal
Examples included
Career prep
Foundation builder
Introduction
What is Multi-Cluster Kafka? Multi-cluster Kafka improves resilience, geography, migration safety, and tenant isolation, but adds replication and consistency complexity.
Understanding the topic
What happens — Multi-Cluster Kafka:
- Define RPO/RTO and data sovereignty.
- Replicate selected topics cross-cluster.
- Plan failover and conflict handling.
- Capacity-plan for peak + replay.
| Term | Description |
|---|---|
| MirrorMaker 2 | Cluster-to-cluster replication. |
| RPO/RTO | Recovery point/time objectives. |
| Event sourcing | State from event replay. |
| CQRS | Separate write and read models. |
Visual explanation
Pipeline view:
text
Topic partitions↓replicas across brokers↓ISR health↓disk + network + controller↓SLO dashboards
Step-by-step explanation
- Design — Clusters, topics, mapping.
- Replicate — MM2 or cluster link.
- Failover — Test DR runbooks.
- Govern — Schema and ownership.
Informative example
Example:
bash
kafka-topics --bootstrap-server localhost:9092 --create --topic multi-cluster-kafka --partitions 6 --replication-factor 3kafka-console-producer --bootstrap-server localhost:9092 --topic multi-cluster-kafkakafka-console-consumer --bootstrap-server localhost:9092 --topic multi-cluster-kafka --from-beginningkafka-consumer-groups --bootstrap-server localhost:9092 --describe --group multi-cluster-kafka-service
Execution workflow
1Multi-Cluster Kafka workflow
1 / 4Design
Clusters, topics, mapping.
Best practices
- Use replication factor 3 for critical topics.
- Set min.insync.replicas with acks=all.
- Alert on under-replicated partitions, offline partitions, disk usage, and lag.
- Document topic ownership and cleanup policy.
Common mistakes
- Changing partitions without understanding ordering impact.
- Ignoring hot partitions caused by skewed keys.
- Letting retention grow until disks become the outage.
Summary
Multi-Cluster Kafka — Operate Kafka through SLOs: durability, availability, latency, lag, disk headroom, and recovery time.
Ready to mark this lesson complete?Track your journey across the entire course.