Security for Apache Kafkas
Kafka security and tuning means protecting a cluster and getting predictable performance from it. Security uses TLS for encryption, SASL or mutual TLS for authentication, and ACLs for authorisation, while tuning adjusts batching, compression, partition counts and consumer settings to balance throughput and latency.
Stage: Operations · Part of the Apache Kafka roadmap · Last reviewed 19 November 2026
What to learn in Security
- Enable TLS encryption between clients and brokers
- Choose an authentication mechanism such as SASL SCRAM or mutual TLS
- Grant a user read or write access to a topic using ACLs
- Tune batch size, linger time and compression on a producer
- Estimate a sensible partition count for target throughput
Security interview questions
How do you restrict who can read a Kafka topic?
Enable an authorizer on the brokers, authenticate clients with SASL or mutual TLS, then create ACLs granting a principal the Read operation on that topic and on its consumer group. Without an authorizer and authentication, any client that can reach the broker can read.
How does linger.ms affect producer performance?
linger.ms makes the producer wait briefly so that more records can be grouped into one batch before sending. A larger value increases throughput and compression efficiency but adds latency to each message. Together with batch.size it is the first setting to tune for throughput.
Where Security fits in the Apache Kafka roadmap
Security belongs to the Operations stage (advanced level). Run it.
Other units in this stage
Back to the full Apache Kafka roadmap