0
0
Kafkadevops~20 mins

Geo-replication strategies in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Geo-Replication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of Kafka MirrorMaker 2 configuration
Given the following MirrorMaker 2 configuration snippet, what will be the output in the target cluster after replication?
Kafka
clusters = {
  "source": {"bootstrap.servers": "source.kafka:9092"},
  "target": {"bootstrap.servers": "target.kafka:9092"}
}
tasks.max = 2

replication.policy.class = "org.apache.kafka.connect.mirror.DefaultReplicationPolicy"

# Topics to replicate
replication.topics = "topicA,topicB"

# MirrorMaker 2 replicates topicA and topicB from source to target

# Assume topicA has 3 partitions with messages 1 to 3, topicB has 2 partitions with messages 10 to 11

# What messages will appear in target cluster topics after MirrorMaker 2 runs?
AtopicA with partitions 0-2 containing messages 10 to 11, topicB with partitions 0-1 containing messages 1 to 3
BtopicA with partitions 0-2 containing messages 1 to 3, topicB with partitions 0-1 containing messages 10 to 11
CtopicA and topicB will be empty in target cluster
DOnly topicA will be replicated with messages 1 to 3; topicB will not be replicated
Attempts:
2 left
💡 Hint
MirrorMaker 2 replicates specified topics with their partitions and messages from source to target.
🧠 Conceptual
intermediate
1:30remaining
Understanding active-active geo-replication
Which statement best describes active-active geo-replication in Kafka?
AReplication happens only during off-peak hours to reduce network load.
BData is replicated only from one primary cluster to multiple secondary clusters without writes on secondaries.
CMultiple clusters can accept writes and replicate data to each other, enabling multi-region active writes.
DData is replicated from secondary clusters back to the primary cluster only.
Attempts:
2 left
💡 Hint
Active-active means all clusters can write data and replicate.
🔧 Debug
advanced
2:00remaining
Identify the error in MirrorMaker 2 replication config
What error will occur when running MirrorMaker 2 with this configuration snippet? replication.policy.class = "org.apache.kafka.connect.mirror.NonExistentPolicy" clusters = { "source": {"bootstrap.servers": "source.kafka:9092"}, "target": {"bootstrap.servers": "target.kafka:9092"} } replication.topics = "topicX"
AClassNotFoundException for org.apache.kafka.connect.mirror.NonExistentPolicy
BNo error, MirrorMaker 2 will replicate topicX correctly
CTimeout error connecting to source.kafka:9092
DSyntaxError in configuration file
Attempts:
2 left
💡 Hint
Check if the replication policy class exists in Kafka MirrorMaker 2.
📝 Syntax
advanced
1:30remaining
Correct syntax for MirrorMaker 2 topic whitelist
Which option correctly sets MirrorMaker 2 to replicate only topics starting with 'logs-'?
Areplication.topics.regex = "logs-.*"
Breplication.topics = "logs-*"
Creplication.topics = logs-*
Dreplication.topics.regex = logs-*
Attempts:
2 left
💡 Hint
MirrorMaker 2 uses regex property for pattern matching topics.
🚀 Application
expert
3:00remaining
Designing a geo-replication strategy for low latency writes
You have two Kafka clusters in different continents. You want to allow applications in both regions to write data with minimal latency and keep data synchronized. Which geo-replication strategy should you choose?
AActive-passive replication with MirrorMaker 2 replicating from primary to secondary cluster only
BNo replication, rely on manual data export/import between clusters
CSingle cluster with global clients connecting remotely
DActive-active replication with multi-master clusters replicating data bidirectionally
Attempts:
2 left
💡 Hint
Consider latency and write availability in multiple regions.