Effective Design Patterns for a Kafka Cluster

A guide to implement effective Kafka Clusters Design Strategies using Partitioning and Replication

Manoj Kukreja
Nov 9 · 3 min read
Image for post
Image for post
Image by Tumisu from Pixabay

At the lowest denomination level may be created with a single broker instance. Using a Kafka Producer Data Stream can be sent in form of messages to the Kafka Broker. These messages stay on the Kafka Broker for a configurable period of time until a Kafka Consumer can retrieve and process them.

Image for post
Image for post
Image by Author

Looks like a pretty simple design…but has a few drawbacks

Image for post
Image for post
Image by Author

The solution is simple, break your Kafka Topic into multiple Partitions, configure multiple Brokers and save each partition on a separate Broker. Therefore instead of one broker taking the entire load you now have many of them sharing the load. The question is how many partitions are optimal? For a successful Leader election by Zookeeper you need to go with a ODD value i.e. 3,5,7.

Image for post
Image for post
Image by Author

Above design surely does take care of the the high traffic demands…but is it the best design for High Availability.

What if the Kafka Broker suffers a failure, it’s hardware after all…therefore one day it will

Image for post
Image for post
Image by Author

What are the implications? Do I hear DATA LOSS.

Image for post
Image for post
Image by Author

I hope this article was helpful. The topic of Apache Kafka is covered in greater detail as part of the Big Data Hadoop, Spark & Kafka course offered by Datafence Cloud Academy.

The Innovation

A place for variety of stories from different backgrounds

Sign up for The Innovation Digest

By The Innovation

Official newsletter of The Innovation Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Manoj Kukreja

Written by

Big Data Engineering, Data Science, Data Lakes, Cloud Computing and IT security specialist.

The Innovation

A place for a variety of stories from different backgrounds

Manoj Kukreja

Written by

Big Data Engineering, Data Science, Data Lakes, Cloud Computing and IT security specialist.

The Innovation

A place for a variety of stories from different backgrounds

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store