GrabFabrice HarbulotProblem & solution
Zero traffic cost for Kafka consumers
Summary
Grab's real-time data streaming platform team reduced infrastructure expenses by enabling Kafka consumers to fetch from the closest partition replica instead of partition leaders. The platform previously operated across three AWS Availability Zones with three-way replication, resulting in cross-AZ network fees that constituted half of the Kafka platform's total cost. To address this, the team performed a zero-downtime upgrade to Kafka 3.1, configured a rack-aware replica selector using AWS Availability Zone IDs, and updated consumer SDKs to populate the client rack parameter. The rollout produced a 25% drop in cross-AZ traffic within three months under steady data volumes. However, the change increased end-to-end latency by up to 500ms, created potential CPU load skews across zones, and removed graceful isolation during broker rotation maintenance.
Context
Kafka consumers by default fetch data exclusively from partition leaders, causing roughly two-thirds of consumer traffic to cross Availability Zone boundaries in a multi-AZ AWS setup and generating half of Grab's total Kafka platform costs.
Approach / What changed
Upgraded Kafka clusters to version 3.1 via a zero-downtime phased protocol rollout, configured brokers with the RackAwareReplicaSelector using EC2 AZ IDs, and updated consumer SDKs and connectors to dynamically set client.rack.
Takeaways
Enabling consumers to fetch from local AZ replicas reduced Grab's cross-AZ network traffic by 25% over a three-month period.
Fetching from follower replicas increased end-to-end producer-to-consumer latency by up to 500ms, requiring latency-sensitive workloads to retain the traditional leader-fetching design.
Demoting a broker for maintenance fails to gracefully isolate it from consumers reading follower replicas, requiring consumers to implement connection error handling and retry mechanisms.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.