Multi-AZ Kafka Architecture

CK CK 3788 
Created at  
142 0 0

Deploying Apache Kafka across multiple Availability Zones (Multi-AZ) ensures high availability, fault tolerance, and disaster recovery. If an entire data center (AZ) goes down, Kafka continues to operate without data loss.

 

1. Architecture Diagram

Below is the conceptual architecture of a 3-way Multi-AZ Kafka deployment using 3 Availability Zones (AZ-A, AZ-B, AZ-C).

Multi-AZ Kafka Architecture

 

 

2. Key Architectural Concepts

1) Odd Number of AZs (Minimum 3)

  • Quorum Requirement: Both ZooKeeper and Kafka KRaft (metadata mode) require a majority quorum to elect a leader.
  • Failure Survival: With 3 AZs, if 1 AZ completely fails, the remaining 2 AZs still hold the majority ($2 > 3/2$), allowing the cluster to elect a new controller/leader and remain operational.

2) Rack Awareness (broker.rack)

  • Kafka uses the concept of "racks" to understand physical infrastructure. In cloud environments, a "rack" maps directly to an Availability Zone.
  • By configuring broker.rack, Kafka guarantees that partition replicas are spread across different AZs rather than being placed on the same physical zone.

 

 

3. Essential Configurations for Multi-AZ

To ensure data safety and high availability across AZs, the following configuration parameters must be set.

 

Broker Configurations (server.properties)

ParameterRecommended ValueDescription
broker.rackus-east-1a (Matches AZ)Identifies the physical location of the broker. Kafka uses this to distribute replicas.
replica.selector.classorg.apache.kafka.common.replica.RackAwareReplicaSelectorAllows consumers to read from the nearest follower (in the same AZ) to reduce cross-AZ data transfer costs.

 

 

Topic Configurations

ParameterRecommended ValueDescription
replication.factor3Ensures there are 3 copies of the data, ideally one in each of the 3 AZs.
min.insync.replicas2Specifies the minimum number of replicas that must acknowledge a write for it to be considered successful when acks=all.

 

 

Client (Producer) Configurations

ParameterRecommended ValueDescription
acksall (or -1)The leader broker will wait for the full set of in-sync replicas (ISR) to acknowledge the record before responding to the client.
retries2147483647 (Max Int)Allows the producer to automatically retry sending messages during transient failures (e.g., AZ failover).

 

 

4. Disaster Recovery & Failover Scenario

When AZ-A Fails (Broker 1 goes offline)

Multi-AZ Kafka Architecture

  1. Detection: ZooKeeper/KRaft detects that Broker 1 in AZ-A is heartbeat-silent.
  2. Leader Election: Since Partition 0's Leader was on Broker 1, Kafka automatically promotes one of the in-sync followers (on Broker 2 or Broker 3) to be the new Leader.
  3. Producer/Consumer Redirection: Kafka clients automatically fetch metadata updates, find the new leader location in AZ-B, and resume read/write operations.
  4. No Data Loss: Since acks=all and min.insync.replicas=2 were configured, the data was already safely replicated to AZ-B and AZ-C before the crash.
Tags AWS Kafka Architecture Apache Kafka Apache Kafka Setup High Availability Kafka Kafka Architecture Diagram Kafka Cluster Diagram Kafka Deployment Guide Kafka High Availability Kafka Multi-AZ Multi-AZ Kafka Cluster Multi-Zone Kafka Facebook X
Comments 0
Similar posts
  1. Designing Resilient Infrastructure to Prevent Order Data Loss During Kafka Failures
    151
  2. Enterprise-Scale 100k+ TPS Order Processing System Architecture
    174
  3. Apache Kafka Explained: Powering Netflix, Building with PHP
    489
  4. Java Kafka on CentOS 7: Install, Configure, & Run with Examples
    422
  5. Improving nested_fields data access experience with a persistent user-defined function (aka UDF) in Google Big Query
    1,497
  6. Creating a serverless Apache Kafka publisher using AWS Lambda
    562
  7. Apache Kafka - a distributed, fault-tolerant, high-throughput streaming platform
    613
  8. Real-time Data Streaming Solutions - Kafka vs. Kinesis Comparison
    848
  9. Architectural Diagram Gallery for Amazon MSK
    497
  10. System Requirements and Architecture: Intelligent Priority-Based Scheduler
    161
  1. Why supabase is not safe for the Fintech project?
    854
  2. The Ultimate Data Engineering Roadmap
    1,069
  3. Nine Types of Testing while we develop APIs
    511
  4. Apache Kafka - a distributed, fault-tolerant, high-throughput streaming platform
    613
  5. Comprehensive Software Development Flow : How Companies Ship Code To Production
    2,309
  6. DeepSeek v3 offers of ChatGPT's performance at 1/10 the price!
    633
  7. Difference between CPU and GPU - Why GPU is faster than CPU?
    802
  8. gRPC - Open-source Universal RPC Framework developed by Google
    766
  9. Exploring the Depths of Data Transfer: sendfile vs. kTLS
    1,317
  10. How Netflix Ensures Smooth Streaming with Open Connect CDN
    2,127
  11. Public DNS (Domain Name Service) based on IPv4, IPv6 widely used
    1,240
  12. All Engineering Software Development How can you prioritize software design trade-offs when developing a new product?
    1,339
  13. MR(Mixed Reality) Game Programming based on Unity 3D
    1,353
  14. Temporal Programming Model - Robust, Long-Running, Fault-Tolerant Applications as WorkFlows
    349
  15. Cadence Programming Model - A Distributed, Fault-Tolerant, Stateful Workflow Orchestration Framework
    286
  16. Large-Scale Concurrency Control: Solving the DB Bottleneck from a Flood of “Likes”
    269
  17. Hybrid Methods for Recommendation Service
    213
  18. Model-Based CF: Matrix Factorization for Recommendation Service
    177
  19. Memory-Based Collaborative Filtering for Recommendation Service
    186
  20. Content-Based Filtering for Recommendation Service (aka User-based Model)
    187
  21. Stateful Databases: A Deep Dive with Cassandra & TiDB
    186
  22. Why Kubernetes? Core Features and Microservice Orchestration Strategies
    570
  23. Quiz : Twice counter
    700
  24. Kubernetes, aka K8s, is an open-source container orchestration platform
    539
  25. Architecting for Resilience: AWS High Availability Components Including API Gateway
    133
  26. Is AWS API Gateway Disaster-Proof? DR, Benefits, and Multi-AZ Architecture Explained
    140
  27. FNC(Photo/Video File Name Changer) v1.1 Release - Date Time Bug Fix & Retry Function Added
    703
  28. Smart TV Cycling Apps – TV for Fitness
    807
  29. The public could reduce server cost, and enhance performance for global service distribution
    10,740
  30. Cloud gaming coming to Samsung Smart TVs
    556
Recently updated
  1. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    27
  2. Why SPF and DKIM Are Essential for Linux Email Servers?
    24
  3. How do I create animated background for Google Meet?
    19,734
  4. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    217
  5. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    86
  6. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    153
  7. Array of arguments passed to script in PHP
    85
  8. Invalid Auction Storms in Ad Tech
    93
  9. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    198
  10. The Two Clocks of Ad Server Architecture
    63
  11. Frequency Cap Architecture Overview
    509
  12. Collecting Proof-of-Play from 100,000 Screens
    141
  13. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    280
  14. What is RedisVL?
    105
  15. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    224
  16. TPU & GPU Cluster Management Tools
    234
  17. The Concept of Scaffolding in AI Agents
    222
  18. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    576
  19. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    253
  20. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    328
  21. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    197
  22. Machine Learning: Training vs. Ranking
    213
  23. The Continuous Learning Machine: Designing a Loop That Actually Turns
    217
  24. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    189
  25. Designing a Data Curation System Around a Vector Database
    215
  26. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    229
  27. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    649
  28. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    185
  29. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    207
  30. Understanding Data Lineage
    252