Why this matters
- VaultCommerce mirrors
vaultcommerce.orders.*from us-east to eu-west for GDPR-local analytics. - MM2 handles offset mapping, topic naming (
source.cluster.topic), and consumer group offset sync. - DR failover requires runbook for consumer group promotion, not just topic copy.
- Cross-region replication adds latency and cost — replicate only what regions need.
MirrorMaker 2 architecture
Source connector reads from primary cluster; Heartbeat and Checkpoint connectors sync consumer offsets. VaultCommerce prefixes mirrored topics us-east.vaultcommerce.orders.placed.v1 in EU cluster. replication.factor matches target cluster policy.
Key points
- MirrorMaker 2 — Kafka Connect based cross-cluster replication
- Offset sync — checkpoint topic maps source/target offsets
- Topic rename —
sourceAlias.targetTopicconvention - Replication lag — cross-region network bound; alert on MM2 lag
- Active-passive DR — secondary cluster warm standby
Failover planning
Active-passive: EU consumers read mirrored topics; on failover, DNS flips bootstrap servers. Active-active is harder — conflict resolution and cyclic replication need emit.heartbeats tuning. VaultCommerce stays active-passive for orders.
VaultCommerce rollout checklist
Before promoting changes that touch the VaultCommerce order and payment event backbone, run the staging KRaft cluster (Kafka 3.7+, Schema Registry 7.x) through a 10k events/min soak test. Compare producer request latency p99 and consumer lag per group against the pre-deploy baseline. MM2 replicates topics and offset checkpoints. Document the change in the internal topic registry, attach Grafana screenshots to the change ticket, and keep an engineer on lag dashboards for 30 minutes after production rollout — roll back the service release before altering broker-level settings if lag or under-replicated partitions spike.
# VaultCommerce MM2 — mm2.properties excerpt
clusters = us-east, eu-west
us-east.bootstrap.servers = kafka-use1-1:9092,kafka-use1-2:9092
eu-west.bootstrap.servers = kafka-euw1-1:9092,kafka-euw1-2:9092
us-east->eu-west.enabled = true
us-east->eu-west.topics = vaultcommerce.orders\..*, vaultcommerce.payments\..*
replication.policy.class = org.apache.kafka.connect.mirror.DefaultReplicationPolicy
sync.topic.acls.enabled = false
emit.checkpoints.interval.seconds = 60
Quick recall
Everything you need if you only revisit this box.
- MM2 replicates topics and offset checkpoints.
- Replicate minimum topics per region.
- Active-passive simpler than active-active.
Test yourself
Answer these before moving on — recall is what makes it stick.