Apache Kafka Tutorial 0/111 lessons ~6 min read Lesson 74

    Geo Replication

    What is Geo Replication?

    Course progress0%
    Focus
    9 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    What is Geo Replication? Geo replication moves events across regions for disaster recovery, local reads, compliance, and global products.

    Understanding the topic

    What happens — Geo Replication:

    • Plan partitions and replication factor.
    • Configure retention and compaction.
    • Monitor ISR, lag, disk.
    • Scale brokers and partitions with load.
    TermDescription
    Replication factorCopies per partition.
    ISRIn-sync replica set.
    Retention.msTime to keep records.
    Log compactionKeep latest per key.

    Visual explanation

    Pipeline view:

    text
    Topic partitions
    replicas across brokers
    ISR health
    disk + network + controller
    SLO dashboards

    Step-by-step explanation

    1. Create/configure — kafka-topics or API.
    2. Replicate — Followers stay in ISR.
    3. Observe — Metrics and alerts.
    4. Scale — Brokers/partitions/consumers.

    Informative example

    Example:

    bash
    kafka-topics --bootstrap-server localhost:9092 --create --topic geo-replication --partitions 6 --replication-factor 3
    kafka-console-producer --bootstrap-server localhost:9092 --topic geo-replication
    kafka-console-consumer --bootstrap-server localhost:9092 --topic geo-replication --from-beginning
    kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group geo-replication-service

    Execution workflow

    1Geo Replication workflow
    1 / 4

    Create/configure

    kafka-topics or API.

    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

    Geo Replication — 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.