Video in progress
Dozens of teams use a single Kafka cluster. How do you manage topic naming, ownership, permissions, quotas and capacity?
Topics are self-service but created as code (GitOps): the naming rule, owner, retention and partition count go through review. Permissions are ACLs so each service gets only the topics it needs, and quotas keep one team from hogging the cluster. Capacity and cost are visible per owner.
📖 Answer
The uncontrolled situation is familiar: 900 topics like test, orders-new, orders_v2_final, half of them with an unknown owner, a new topic appearing under a mistyped name because of auto.create.topics.enable=true, and one team's replay eating the whole cluster's disk I/O.
This is the setup I put in place.
Naming: <domain>.<context>.<event-name>.v<version>, for example payments.billing.invoice-issued.v1. Internal topics are separated from public topics that other teams subscribe to. A public topic is a contract: its schema and compatibility mode in Schema Registry are mandatory.
Creation as code:
# kafka-topics/payments/invoice-issued.yaml
name: payments.billing.invoice-issued.v1
owner: team-billing
partitions: 12
replicationFactor: 3
config:
retention.ms: 1209600000 # 14 days
min.insync.replicas: 2
consumers: [team-ledger, team-notifications]
PR → review (the platform rules are checked automatically) → applied through Terraform or a Strimzi KafkaTopic resource. auto.create.topics.enable=false.
Permissions: each service has its own identity (an mTLS certificate or a SASL user). By ACL, a producer writes only to its own topic, and a consumer reads only what it is allowed and only with its own group.id prefix. Another team can't accidentally write to your topic.
Quotas: produce/fetch rate and request percentage by client ID or user. One team's replay or a buggy producer doesn't slow down the others, because the broker throttles it.
Capacity and cost: each topic's size, throughput and retention are on a dashboard by owner. When teams see the cost of their own topics, the urge to "keep everything for a year" fades.
Hygiene: a list of topics nobody wrote to or read from in 30 days goes to the owner, and topics with no owner go into a deletion queue.
When one cluster isn't enough: if a critical payment flow and heavy analytics sit on one cluster, their load and failure profiles interfere with each other. In that case, separate clusters with MirrorMaker 2 or Cluster Linking between them.
Sign up to mark studied questions and save your progress.