QuestionQ50

VerifiedMonitoring, Scaling, and Operations

Universal Containers (UC) uses Apache Kafka on Heroku to stream shipment-inventory data in real time worldwide. A Kafka topic sends messages containing updates to shipping-container GPS coordinates while they are in transit. UC uses a Heroku Kafka basic-0 plan. The topic was provisioned with 8 partitions, 1 week of retention, and no compaction. Heroku Kafka assigns the event keys, so they are randomly distributed across the partitions.

UC has a single-dyno consumer application that persists the data to its Enterprise Data Warehouse (EDW). Recently, UC has noticed data loss in the EDW.

What should an Architect with Kafka experience recommend?

Explanation

A consumer group can process a topic in parallel up to its partition count; matching eight consumer processes to eight partitions removes the single-consumer throughput bottleneck that can leave offsets behind retained messages. Kafka provides at-least-once delivery, so consumers that write to an EDW must make writes idempotent or track unique message receipts to suppress duplicates. Heroku specifically recommends idempotency or duplicate-message tracking for Kafka consumers. Kafka Event Stream Modeling and Robust Usage of Apache Kafka on Heroku.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!