Chapter 2: Installing Kafka Flashcards
By default, Kafka will automatically create a topic when a producer, consumer, or client attempts to interact with it. T/F
T
A company is going to manage their topic creation using Pulumi. What Kafa configuration needs to be set so that producers, consumers, and clients cannot accidentally create topics without using Pulumi?
auto.create.topics.enable = false
A majority of topics in a cluster will need a retention time of 2 hours. There are two ways of configuring Kafka to achieve this. What are they?
Set the retention time for each topic or set the default topic retention time
A Kafka cluster has automatic topic creation enabled. How can the Kafka cluster be configured so that every topic will have at least 10 partitions?
Set the num.partitions parameter
A Kafka cluster is using the default configuration parameters. A topic is created automatically. How many partitions will this topic have?
One
It is possible to increase the number of partitions in an existing Kafka topic. T/F?
True
It is possible to decrease the number of partitions in an existing Kafka topic. T/F?
False
A Kafka cluster has the num.partitions parameter set to 10. How could I create a topic with only 5 partitions, without changing the num.partitions parameter?
Use manual topic creation
How could I ensure that message load is evenly distributed among brokers?
Set num.partitions to the number of brokers
How does the number of partitions affect throughput?
Throughput is maximized when the number of partitions is >= the number of brokers
How many consumers can read from a particular partition at once ?
Zero or one
Messages are being produced in the “foo” topic at a rate of 30 messages/second. A consumer of the “foo” topic can consume 10 messages per second. There are 5 of these consumers. How many partitions should the “foo” topic have in order to maximize throughput?
At least 3
You are planning out a new topic. The messages in this topic will be partitioned by key. You predict that you will need at least 10 partitions for maximum throughput in the short-term, but future changes could require as much as 100 partitions for maximum throughput. How should you configure the topic? Why?
Set the number of partitions to 100. Increasing the number of partitions later out would be challenging.
What are the negative consequences of using too many partitions?
Increased broker memory consumption. Increased time for leader elections.
What is the runtime software required to run ZooKeeper and Kafka?
Java