Junior — Middle
What are the consequences of using two partitions and one consumer in Kafka?
sobes.tech AI
Answer from AI
If Kafka has two partitions and only one consumer, then this consumer will read data from both partitions sequentially. This means:
- The consumer will not be able to process data from different partitions in parallel, which may reduce performance.
- The processing stream will be limited to a single thread, even if the partitions allow for scaling.
- If you need to increase processing speed, you should add more consumers to the group so that each can read from a separate partition.
Thus, one consumer for two partitions is a simple but not scalable option.