Integrating Message Queue: Kafka Flashcards

1
Q

What are the key components of Kafka?

A

The key components of Kafka include:

Producer: Publishes messages to Kafka topics.
Consumer: Subscribes to Kafka topics to receive messages.
Broker: A Kafka server that stores and manages topics and messages.
Topic: A category or feed name to which messages are published.
Partition: Each topic is divided into partitions, which are distributed across Kafka brokers.
ZooKeeper: Manages and coordinates Kafka brokers and provides metadata storage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does Kafka ensure fault tolerance?

A

Kafka replicates messages across multiple brokers to ensure fault tolerance. Each partition has multiple replicas, and if one broker fails, another replica can take over.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the role of ZooKeeper in Kafka?

A

ZooKeeper manages and coordinates Kafka brokers, maintains metadata, and handles distributed synchronization within the Kafka cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does Kafka handle message persistence?

A

Kafka persists messages to disk, allowing messages to be stored for a configurable retention period. This ensures that messages are not lost even if the consumer is unable to process them immediately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some use cases for Kafka as a message queue?

A

Some common use cases for Kafka as a message queue include real-time data processing, event sourcing, log aggregation, stream processing, and microservices communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does Kafka support both batch processing and stream processing?

A

Kafka supports both batch processing and stream processing use cases. It can handle high-throughput, low-latency stream processing with Kafka Streams, as well as batch processing with tools like Apache Spark or Apache Flink.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between Kafka and traditional message queues?

A

Kafka is designed as a distributed streaming platform with support for horizontal scalability, fault tolerance, and persistent message storage. Traditional message queues may prioritize in-memory storage and point-to-point messaging models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Kafka ensure fault tolerance?

A

Kafka replicates messages across multiple brokers, ensuring fault tolerance. Each partition has multiple replicas, and if one broker fails, another replica can take over.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What configuration options are available for Kafka topics?

A

Kafka topics can be configured with settings such as the number of partitions, replication factor, retention policy, cleanup policy, compression settings, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does Kafka internally implement partitions in topics?

A

Internally, each partition is implemented as a segmented log of messages, with messages appended to the end of the log and older segments periodically compacted and archived.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly