Integration / Apache Kafka Interview questions
What is a partition in Kafka?
A partition is an ordered, immutable subdivision of a topic's log — each partition is its own independent sequence of records, and a topic with multiple partitions is really multiple parallel logs sharing one topic name.
Ordering is guaranteed within a partition (records are appended in the order they're written and read back in that same order), but there's no guaranteed ordering across different partitions of the same topic. This is the mechanism that gives Kafka horizontal scalability: partitions can be spread across different brokers, and different consumers in a group can each own a different partition, reading and processing in parallel.
kafka-topics.sh --describe --topic orders --bootstrap-server localhost:9092 # Topic: orders PartitionCount: 3 ReplicationFactor: 2
A record's partition is chosen either explicitly by the producer, or derived from the record's key via a hashing partitioner, which is what guarantees all records sharing the same key land in the same partition and therefore stay ordered relative to each other.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
