0
0
Kafkadevops~5 mins

Compression (gzip, snappy, lz4) in Kafka - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of compression in Kafka?
Compression reduces the size of messages sent over the network and stored on disk, improving throughput and saving storage space.
Click to reveal answer
beginner
Name three compression codecs supported by Kafka.
Kafka supports gzip, snappy, and lz4 compression codecs.
Click to reveal answer
intermediate
How does gzip compression compare to snappy in Kafka?
Gzip offers higher compression ratio but is slower, while snappy is faster but compresses less effectively.
Click to reveal answer
intermediate
What is a key advantage of lz4 compression in Kafka?
Lz4 provides a good balance of fast compression and decompression speed with reasonable compression ratio, making it suitable for real-time data streams.
Click to reveal answer
beginner
How do you enable compression for Kafka producers?
Set the producer configuration property 'compression.type' to 'gzip', 'snappy', or 'lz4' to enable compression.
Click to reveal answer
Which Kafka compression codec typically offers the fastest compression speed?
Asnappy
Bgzip
Cnone
Dlz4
What is the default compression type in Kafka if none is specified?
Agzip
Bnone
Clz4
Dsnappy
Which compression codec is best when you want the smallest message size regardless of speed?
Agzip
Bsnappy
Clz4
Dnone
How does compression affect Kafka network usage?
ADecreases network usage
BIncreases network usage
CNo effect on network usage
DDepends on message size only
Which Kafka compression codec is recommended for real-time streaming with low latency?
Agzip
Bsnappy
Clz4
Dnone
Explain the differences between gzip, snappy, and lz4 compression codecs in Kafka.
Think about speed versus compression size trade-offs.
You got /3 concepts.
    Describe how to enable compression on a Kafka producer and why you might want to do it.
    Consider configuration and benefits.
    You got /4 concepts.