Skip to main content
InterviewHubPRO
Section Overview
Q41

Question 41 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

82%
Apache Kafka Streaming (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Exactly-Once Semantics (EOS) in Kafka Streams: Two-phase commit with transaction coordinator and marker messages.

senior LevelSystem DesignDatabases & SQLApache Kafka

In Simple Words: Kafka's "Read-Process-Write" loop achieves transactional Exactly-Once processing across multiple topics and state stores:

  1. Producer Transaction Coordinator: Allocates a unique transactional.id.
  2. Transaction Log (__transaction_state): Records transaction state transitions (Ongoing, PrepareCommit, Committed).
  3. Control Markers: The coordinator writes special commit marker messages directly into target topic partitions.
  4. Consumers set isolation.level=read_committed. They automatically buffer uncommitted records and yield them to the application strictly after the commit marker is observed.