Skip to content
Kafka Is Fun

Lesson 4 of 6

Topic Design Best Practices

1 min read

Overview

Choose a naming convention early. Kafka cannot rename a topic (kafka-topics.sh --alter changes partitions and replica assignment), so a new name means creating a new topic and migrating producers and consumers. Topic names may use letters, digits, '.', '_' and '-', up to 249 characters. Use either '.' or '_' as a separator, not both: because of limitations in metric names, two topics whose names differ only by '.' versus '_' (such as a.b and a_b) can collide on one metric name, and kafka-topics.sh --create prints a warning for any name containing either character. ACLs can match topics by prefix (--resource-pattern-type prefixed), so a name prefix is one way to organise access per team. Compacted topics keep at least the latest value for each key, which suits lookup data. Naming patterns such as {domain}.{entity}.{event-type}, one topic per event type, and the use of a schema registry are team conventions, not Apache Kafka features, and Schema Registry is not part of Apache Kafka.

Production tip

Check yourself

Two topics are named a.b and a_b. What can happen?

Sources

Checked against Kafka 4.2 documentation on Oct 2026. Draft: not yet reviewed by a Kafka specialist. Releases move on, so confirm against the current documentation before you act on a number.

Try it in the simulator

Guided scenarios for this module — the simulator opens with the exercise already running.

Prefer a picture? Open the live cluster in 3D and watch records move between producer, brokers and consumers.

Browse all troubleshooting entries