0
0
Kafkadevops~5 mins

Retention policies (time-based, size-based) in Kafka - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a time-based retention policy in Kafka?
A time-based retention policy in Kafka deletes messages older than a specified time limit, such as 7 days, to free up storage space.
Click to reveal answer
beginner
What does a size-based retention policy control in Kafka?
A size-based retention policy deletes the oldest messages when the total size of the log exceeds a set limit, like 1 GB, to manage disk usage.
Click to reveal answer
intermediate
How do time-based and size-based retention policies work together in Kafka?
Kafka applies both policies simultaneously: messages are deleted if they are older than the time limit or if the log size exceeds the size limit, whichever condition is met first.
Click to reveal answer
beginner
Which Kafka configuration controls the time-based retention?
The configuration 'retention.ms' sets the maximum time in milliseconds that Kafka retains a message before deleting it.
Click to reveal answer
beginner
Which Kafka configuration controls the size-based retention?
The configuration 'retention.bytes' sets the maximum size in bytes for the log before Kafka deletes older messages.
Click to reveal answer
What happens when a Kafka topic reaches its size-based retention limit?
AOldest messages are deleted to reduce log size
BNew messages are rejected
CKafka stops producing messages
DAll messages are deleted immediately
Which configuration sets the time limit for message retention in Kafka?
Aretention.bytes
Bretention.ms
Clog.segment.bytes
Dlog.retention.check.interval.ms
If both time-based and size-based retention policies are set, when are messages deleted?
AOnly when size limit is reached
BOnly when time limit is reached
CWhen either time or size limit is reached
DMessages are never deleted
What is the default behavior if no retention policy is set in Kafka?
AKafka throws an error
BMessages are deleted immediately
CMessages are deleted after 1 hour
DMessages are retained for 7 days
Which retention policy helps control disk space usage in Kafka?
ASize-based retention
BTime-based retention
CReplication factor
DPartition count
Explain how Kafka uses time-based and size-based retention policies to manage message storage.
Think about how Kafka decides when to remove old messages.
You got /3 concepts.
    Describe the Kafka configurations that control retention policies and their effects.
    Focus on the key configuration names and what they do.
    You got /3 concepts.