blog by OSO

How to Migrate Kafka Cluster with Limited Downtime

Sion Smith 18 August 2023

How to Migrate Kafka Cluster with Limited Downtime? Migrating Apache clusters can be complex, especially when moving large amounts of data, we will discuss the process of how to approach this. The process requires planning,  schema translation, replication technologies, compression algorithms, and the length of the project. So let’s dive in!

Migrate Kafka Cluster: Schema translation and replication technologies

When you migrate Kafka cluster, it is important to consider schema translation and replication technologies. Confluent Replicator, for example, has a schema translation functionality that translates schemas as you move from one schema registry cluster to another while replicating the data. This allows you to take care of the schema at the same time as the data replication.

Using schema-aware serialisers can also be beneficial when you migrate Kafka cluster. By using these serialisers, you can register new schemas as the messages are deserialised and then re-serialise them in the new cluster. This approach may introduce some overhead, but it allows you to align the schema IDs between the source and destination clusters, ensuring that the serialisation and deserialisation of messages still work as intended.

However, it’s worth noting that not all schema registries work in the same way. For example, the Cloudera schema registry writes the magic byte in a different way than the Kafka or Confluent schema registry. This means that if you’re moving from Cloudera to Confluent schema registry, you can’t simply mirror the schemas or do a direct import because the magic byte formatting will not align with the schema or serializers in the Confluent cluster.

To overcome this challenge, you may need to write a custom connector or use a custom Single Message Transform (SMT) to reformat the magic byte to align with the format used by the Confluent schema registry. Another option is to write an application that uses the Cloudera serializers and re-serializers with the Kafka serializers to write the data downstream.

It’s important to ensure that the wire format, specifically the magic byte, aligns between the two schema registries when moving between different enterprise schema registries. Failure to do so can lead to issues in lower environments.

Migrate Kafka Cluster: Compression algorithms and topic configuration changes

During the migration process, you have the opportunity to make changes to compression algorithms and configurations. If you’re not using compression in your original cluster but want to compress the messages as they are written downstream, you can do so using tools like Replicator or MirrorMaker2. These tools allow you to compress the messages as they are written to the new cluster.


compression, it’s important to consider the topic level compression and the compression used by the producer. It’s common to compress the messages with the producer and let the topic inherit the compression settings. However, if the producer uses a different compression algorithm than the topic, the messages will need to be decompressed and re-compressed before being written to the Kafka topic, resulting in CPU overhead.

Migrate Kafka Cluster: Planning, estimating the length of a cluster migration

The length of a Kafka cluster migration project can vary depending on various factors. The most important factor is the strategy and planning involved. It’s crucial to have a good understanding of your application interdependencies, data lineage, and data model. Once you have a clear strategy in place, setting up the solution to migrate the data doesn’t take much time.

The time required for the migration also depends on the changes you want to make. For example, creating ACLs in a new cluster or introducing a new topic partitioning scheme can take some time. Performance testing may also be necessary to ensure that reducing partitions doesn’t impact performance.

In general, if you’re not making too many complex changes, setting up the solution and migrating the data can take around a week or two. However, coordinating the migration of applications and working with different teams can add additional time to the project.

The coordination time is highly dependent on the organisation and the level of control you have over the applications. If you have full control and can schedule a short outage, the migration can be done more quickly. However, if you need to work with different teams and departments, the coordination process can take longer.

It’s important to be realistic about the time required for the migration and to communicate effectively with all stakeholders. It’s common for migration projects to take longer than initially anticipated due to various challenges and dependencies.

Migrate Kafka Cluster: Migration warnings

Migrating a Kafka cluster may sound easy, but the complexity lies in the strategy and planning. It’s crucial to have a well-thought-out strategy and understand the tools and changes involved. The migration of data and applications is relatively straightforward once the strategy is in place.

To increase the chances of success, it’s important to plan carefully, measure twice, and cut once. Take the time to read documentation, do some trial and error, or work with someone experienced in Kafka migrations. A good strategy is key to a successful migration.

It’s also important to be aware that the human element can introduce challenges and delays in the migration process. Coordinating with different teams and departments can take time and require negotiation. It’s important to manage expectations and communicate effectively with all stakeholders.

In conclusion, migrating a Kafka cluster requires careful planning, a well-thought-out strategy, and effective coordination. While the implementation itself may be relatively straightforward, the complexity lies in the strategy and ensuring that all necessary changes and considerations are taken into account. With the right approach and a good understanding of the tools and processes involved, a Kafka cluster migration can be successfully executed.

Remember, a successful migration requires a combination of technical expertise, thorough planning, and effective communication. By following best practices and working closely with all stakeholders, you can minimise downtime and ensure a smooth transition to the new Kafka cluster.

So, if you’re considering migrating your Kafka cluster, take the time to plan and strategise, involve the right experts, and communicate effectively with all teams involved. With the right approach, you can successfully migrate your Kafka cluster with minimal downtime and disruption.

If you want to learn more about Kafka and explore topics like mirror maker and cluster linking in more detail, as well as other Kafka-related topics, be sure to check out the OSO content from below. It’s a free resource that offers comprehensive information on Apache Kafka.

Fore more content:

How to take your Kafka projects to the next level with a Confluent preferred partner

Event driven Architecture: A Simple Guide

Watch Our Kafka Summit Talk: Offering Kafka as a Service in Your Organisation

Successfully Reduce AWS Costs: 4 Powerful Ways

Protecting Kafka Cluster

Apache Kafka Common Mistakes

Kafka Cruise Control 101

Kafka performance best practices for monitoring and alerting

How to build a custom Kafka Streams Statestores

Get started with OSO professional services for Apache Kafka

Have a conversation with a Kafka expert to discover how we help your adopt of Apache Kafka in your business.

Contact Us