Best practices for deploying Kafka (KRaft mode) in production for a small enterprise

Hello everyone,

We are a small enterprise and recently deployed a microservice-based application that uses Apache Kafka. We are now preparing to move it into production, and I have a few questions about how we should properly deploy Kafka in KRaft mode:

  1. Initial setup:

    • Should we start with a single node (controller + broker) for production, or is it better to set up multiple nodes from the beginning? in case we do this how to scale up kafka when there is a lot of load
  2. Multiple brokers on one server:

    • Is it a good practice to run multiple brokers on a single server (with different ports) and assign multiple partitions this way, or should each broker always run on a separate machine/VM?

I’d really appreciate best practices or lessons learned from others who have deployed Kafka in production under similar constraints.

Thanks in advance!

Hey @ZakariaYakoub

from a performance and resilience perspective it’s better to have at least 3 brokers and controllers

I would highly recommend to have each broker on a separate machine/VM

you could think about having controller and brokers on the same machine for the beginning, though as said keep the brokers on separate nodes.

and not to forget: moving controller and/or brokers to other nodes during the workload needs to be planned carefully to keep the downtime small (or omit completly)

thanks for you answer
we don’t have that much of resource
can we have three node each act as broker and controller?

should be fine for the start :slight_smile:

do you have any good article to set up kafka kraft cluster
thanks in advance

the link above is good point to start with

here are some follow ups:

are you going to use OSS kafka ?

thanks a lot
is 6GB good for the vms
are you going to use OSS kafka ?

yes

for production?
I would recommend 32GB per machine

we are small company so there will not be a lot of users that using the application
B2B solution
we dont have a lot of resources

I see, understood

you could start with 8GB and see if you need more ressources.

are you hosting on prem?

yes, we have a proxmox node but the resource is limited

first give it 8GB and other two 6GB is that good

as said I would go for 8GB each