分区是Kafka设计的中心——它们启用并行性和可扩展性(分散数据和消费),同时在每个分区内提供排序保证。理解分区是理解Kafka如何扩展和排序事件的关键。
分区启用并行性和扩展
A topic is split into multiple PARTITIONS, distributed across brokers:
→ data is spread across partitions → distribute storage and load
→ CONSUMER PARALLELISM → each partition consumed by one consumer in a group →
more partitions = more parallel consumers = higher throughput
→ scale a topic by adding partitions (and consumers)
→ partitions are the unit of PARALLELISM and horizontal scaling in Kafka
