In Kafka, distributed architecture is key to reliability. Which reason best explains why?
Think about what happens if one part of the system stops working.
Distributed architecture stores copies of data on multiple brokers. This means if one broker fails, others can continue serving data, ensuring reliability.
Given a Kafka topic with 3 partitions and 2 consumers in a group, what happens to message consumption if one consumer fails?
Consumer group with 2 consumers consuming from 3 partitions. One consumer stops working unexpectedly. Which statement is true?
Think about how Kafka balances load among consumers.
Kafka automatically reassigns partitions from the failed consumer to the remaining consumer, ensuring continuous processing.
Consider a Kafka cluster with replication factor 3. A topic has min.insync.replicas set to 2. If a producer sends data with acks=all but data is lost after a broker failure, what is the likely cause?
Producer config: acks=all Topic config: replication.factor=3, min.insync.replicas=2 Broker failure occurs Data loss observed
Check if the producer waited for enough replicas to confirm the write.
If the producer sends data when fewer than the minimum required replicas are in sync, Kafka may accept the write but data can be lost if a broker fails.
Choose the correct Kafka producer configuration snippet that guarantees no data loss in case of broker failure.
KafkaProducer<String, String> producer = new KafkaProducer<>(props);
Think about settings that prevent duplicate messages and ensure all replicas confirm writes.
Setting acks to all, enabling idempotence, and allowing infinite retries ensures the producer waits for all replicas and avoids duplicates, maximizing reliability.
You must design a Kafka system that ensures no data loss and continuous availability even if multiple brokers fail. Which combination of features is essential?
Consider how replication and acknowledgments work together to prevent data loss.
High replication factor with minimum in-sync replicas and full acknowledgments combined with idempotence ensures data is safely stored and no duplicates occur, even if brokers fail.