What is a Kafka Partition?

Answer

A Partition is the unit of parallelism in Kafka. Each topic is divided into one or more ordered, immutable sequences of messages. Key properties: Ordering: messages within a partition are strictly ordered by offset. Parallelism: different partitions can be read/written by different consumers simultaneously — more partitions = higher throughput. Scalability: partitions are distributed across brokers in the cluster. Assignment: each partition is assigned to one broker as the leader (handles all reads/writes) and replicated to other brokers as followers. Choosing the right number of partitions involves trade-offs: more partitions allow higher throughput but increase end-to-end latency, memory usage, and failover time. You cannot decrease the number of partitions after creation.