0
0
Kafkadevops~10 mins

Active-passive vs active-active in Kafka - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Process Flow - Active-passive vs active-active
Start
Check Setup Type
Primary Active Node
Processes Messages
Backup Passive Node
Stays Idle Until Failover
Multiple Active Nodes
All Process Messages
Coordinate to Avoid Conflicts
Continue Processing
The flow checks if the system is active-passive or active-active. Active-passive has one active node and one passive standby. Active-active has multiple active nodes working together.
Execution Sample
Kafka
Node1 = 'Active'
Node2 = 'Passive'
if Node1 == 'Active':
    process_messages()
else:
    standby()
This code shows a simple active-passive setup where Node1 processes messages if active, else Node2 stands by.
Process Table
StepNode1 StateNode2 StateConditionActionOutput
1ActivePassiveNode1 == 'Active'Node1 processes messagesMessages processed by Node1
2Failover: Node1 downPassiveNode1 != 'Active'Node2 becomes active and processes messagesMessages processed by Node2
3Both Active (Active-Active)ActiveMultiple active nodesBoth nodes process messages concurrentlyMessages processed by Node1 and Node2
4Conflict checkConflict checkCoordinate to avoid conflictsSynchronize message processingNo duplicate processing
5System runningSystem runningNormal operationContinue processingHigh availability and load balancing
💡 Execution stops when system is running with either active-passive failover or active-active coordination.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Node1 StateActiveActiveDown (failover)ActiveActive
Node2 StatePassivePassiveActive (failover)ActiveActive
Processing NodeNoneNode1Node2Node1 & Node2Node1 & Node2
Key Moments - 3 Insights
Why does Node2 stay idle in active-passive mode?
Node2 is passive and only becomes active if Node1 fails, as shown in execution_table step 2 where Node2 processes messages after failover.
How do active-active nodes avoid processing the same message twice?
They coordinate and synchronize message processing to avoid conflicts, as shown in execution_table step 4.
What happens if both nodes are active but not coordinated?
This can cause duplicate processing or conflicts, which active-active setups prevent by coordination (step 4).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does Node2 become active in active-passive mode?
AStep 2
BStep 1
CStep 3
DStep 4
💡 Hint
Check the 'Node2 State' and 'Action' columns in execution_table row for Step 2.
In variable_tracker, what is the processing node after Step 3?
ANode1 only
BNode1 and Node2
CNode2 only
DNone
💡 Hint
Look at 'Processing Node' row under 'After Step 3' column in variable_tracker.
If Node1 fails in active-passive, what changes in the system state?
ANode1 continues processing
BBoth nodes stop processing
CNode2 becomes active and processes messages
DSystem shuts down
💡 Hint
Refer to execution_table Step 2 showing failover behavior.
Concept Snapshot
Active-passive: One node active, one standby; standby takes over if active fails.
Active-active: Multiple nodes active, processing together.
Active-passive ensures failover; active-active ensures load balancing and high availability.
Coordination is key in active-active to avoid duplicate processing.
Used in Kafka for message processing resilience.
Full Transcript
This visual execution compares active-passive and active-active setups in Kafka. Active-passive has one active node processing messages and a passive node waiting to take over if the active fails. Active-active has multiple nodes processing messages simultaneously with coordination to avoid conflicts. The execution table shows steps where Node1 is active and Node2 is passive, then failover happens making Node2 active. It also shows both nodes active in active-active mode coordinating message processing. The variable tracker follows node states and which node processes messages at each step. Key moments clarify why passive nodes wait and how active nodes coordinate. The quiz tests understanding of failover steps and processing nodes. The snapshot summarizes the main differences and usage in Kafka for reliability and load balancing.