0
0
Kafkadevops~5 mins

Topic creation in Kafka - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Kafka topic?
A Kafka topic is a category or feed name to which records are published. It acts like a folder where messages are stored and organized.
Click to reveal answer
beginner
How do you create a Kafka topic using the command line?
You use the command kafka-topics.sh --create --topic <topic-name> --bootstrap-server <server> --partitions <num> --replication-factor <num> to create a topic.
Click to reveal answer
intermediate
What does the replication factor mean in Kafka topic creation?
Replication factor is the number of copies of the topic's data across different Kafka brokers. It helps with fault tolerance.
Click to reveal answer
intermediate
Why do you specify the number of partitions when creating a Kafka topic?
Partitions allow Kafka to split data into smaller parts for parallel processing and scalability. More partitions mean better throughput.
Click to reveal answer
beginner
Can Kafka topics be created automatically?
Yes, Kafka can auto-create topics when a producer or consumer tries to use a non-existing topic if the broker is configured to allow it.
Click to reveal answer
Which command option is used to create a Kafka topic?
A--delete
B--create
C--list
D--describe
What does the replication factor control in a Kafka topic?
ANumber of copies of data across brokers
BNumber of topic partitions
CSize of each message
DRetention time of messages
Why are partitions important in Kafka topics?
AThey control message size
BThey encrypt messages
CThey allow parallel processing and scalability
DThey delete old messages
What happens if you try to produce to a non-existing topic and auto-creation is enabled?
ATopic is automatically created
BMessage is rejected
CProducer crashes
DMessage is lost
Which of these is NOT a parameter when creating a Kafka topic?
ATopic name
BNumber of partitions
CReplication factor
DMessage format
Explain how to create a Kafka topic using the command line and why you need to specify partitions and replication factor.
Think about how Kafka handles data distribution and fault tolerance.
You got /3 concepts.
    Describe what happens when Kafka auto-creates a topic and when this feature might be useful or risky.
    Consider convenience versus control.
    You got /3 concepts.