Establishing Kafka platform governance

Written by:

Björn Löfroth

Solution Architect
Technologies mentioned in this article
  • Apache Kafka
  • Git

When you build a data platform on Kafka, you collect data scattered across files, databases, APIs and services, and you make it available at scale so the rest of the organization can build on top: mobile apps, microservices, AI use cases, and whatever comes next. When done right, you have event-driven architecture (EDA), ready to tap into.

However, there is a paradox in the value proposition: the more data you put into Kafka, the more valuable the platform gets, but the complexity grows with it. Kafka famously scales horizontally, but the question is: does your organization scales horizontally with it?

This post is about exploring the structures that will let you scale.


How complexity actually creeps in

The simple case is easy., you might have only one topic with one producer and one consumer. You ship it day one, and it works.

Then you add a second consumer, and get reuse for your data stream, which is excellent. Then a third consumer, a topic that consumes from another topic, and maybe a format transformation in there too. Everything is still fine because someone is keeping the whole picture in their head.

 

But what happens if that someone leaves, or possibly switches teams, or just simply forgets the details of a flow they set up two years ago. Now nobody can answer the basic questions: where do I find customer events? Which schema should I use? Is this topic deprecated? Is it still used or actually empty?

This is the moment when the absence of governance starts costing you.


What governance actually means

I think about governance as the set of mechanisms that lets you quickly answer the questions your stakeholders will ask.

  • Developer: wants to know how to create a topic and how to find data already on the platform.
  • Infrastructure: wants to know how to plan capacity for disk, memory and CPU
  • Operations: wants to know the blast radius if a flow goes down, including the systems three steps downstream that quietly depend on it.
  • Security: want to know how sensitive information flows, who has access, who requested it, who approved it.

If you cannot answer those quickly, you do not have governance, but more of folklore traditions passed down by word of mouth.


Why bother: the time-per-flow curve

The case for governance is easiest to make if you think about how long it takes to add a flow over time.

In a low-governance setup, the first few flows are cheap. By flow fifty or so, things slow down. Ops might be firefighting incidents with no map. Developers do not know whether they are duplicating an existing flow or consuming the wrong one. Nobody dares change a schema because they cannot trace the consumers. The platform flatlines and you are not getting the value you signed up for.

The right level of governance flips the curve. Early flows take a little longer because you are also writing documentation, publishing schemas, defining alerts. But the structure compounds and you stop being one resignation away from losing institutional memory.

The analogy I like is a race car. It does not go full speed all the time, but stops for a pit stop some times. The governance upholding activities is the pit stop in this analogy.


Architectural governance

The two main architectural governance aspects in my experience are: how model your data and to uphold best practices.

Data modelling

Ideally you design with re-usability in mind. For example, when planning a data flow, you probably have one or two consumers in mind but you should design as if more could follow.

Keep events detailed enough that another consumer can act on them, but general and abstracted enough that they do not depend on a particular system’s internal data model. Too thin and consumers cannot do anything without extra lookups. Too thick and you have coupled half your organization to the internals of one source system, while also spreading sensitive data further than you needed to.

Be clear about intent for each topic. Are you transferring state? Modeling that an event happened? Sending a command? Treat that as part of the design, not an afterthought.

Best practices

Idempotent consumers. They should be able to process the same message repeatedly without changing their interpretation or state. This buys you robustness against duplicates and lets you use replay, which is one of Kafka’s main selling points.

Ordering through keys. Same key, same partition, ordered consumption. If ordering matters for your flow, design the key intentionally.

Topic naming conventions

This is where opinions can vary, so I will lay out some principles to start from.

Use components in the topic name that are likely to stay the same over time and that describe the data. Avoid fields that change such as  team names or system names since systems can get replaced and teams change over time. The whole point of decoupling through Kafka is that e.g. a new invoicing system can take over and the ten downstream consumers ideally do not need to know.

Avoid describing sender and receiver in the topic name. Sender, because the system might be replaced. Receiver, because the entire promise of the platform is that more consumers can show up later.

Do not over-engineer it either, with say ten mandatory components you will spend a week negotiating the first topic name.

Two conventions that tend to hold up:

  • <message_type>.<dataset>.<data> (for example, event.finance.invoice). Easy for developers to reason about on their own. Message type covers events, state, CDC updates, logs, and so on. Dataset and data map roughly to database and table.
  • <domain>.<subdomain>.<event>. More involved. Requires some enterprise architecture work to define domains, but pays off if you are committed to a domain-driven approach.

Version numbers in topic names are usually a mistake. The schema registry already tracks that, and keeping the topic name stable across schema changes lets you preserve ordering guarantees without copying data around. If you actually need to maintain two formats in parallel during a migration with some cliens not supporting one or the other – use two topics. Otherwise design consumers to handle major version changes on the same topic.


Governance and developer experience

Governance puts demands on developers, there is no getting around that. The question is whether the tooling makes those demands cheap or expensive.

The typical developer journey for a new flow looks something like this:

  1. Design the flow and pick a topic name.
  2. Provision the topic in the right environment, ideally through automation. GitOps repo, pull request, approval.
  3. Onboard producer and consumer with the right access.
  4. Publish the schema to a registry.
  5. Document the flow: business context, impact, alerting, capacity, peak load estimates.
  6. Define alerts.
  7. Promote the same configuration across environments.

If a consumer wants access to a sensitive topic, you want tooling to handle the request and the right person in the loop to approve it.

There is a phrase worth keeping close: governance without automation is just bureaucracy. The two have to go together. You establish the principles and you build the automation that makes following them the path of least resistance.

A quick note on AI agents, since they are all the rage now: the structures that make agents effective also make humans effective. Good schemas, good documentation, good provisioning automation: an agent can use them, and so can the developer who inherits the flow in 2030. Even if every agent product or startup went out of business tomorrow, the work would still be worth doing.


The ops perspective

Operations cares about the same things, viewed from the other side of an incident.

Alerts should be defined per flow, ideally by whoever owns it, with some mandatory baseline so you do not end up with fifty topics and no idea what normal traffic looks like.

Dashboards should let on-call answer “what is going on” without turning every incident into an archaeology project.

Flow visualization matters more than it gets credit for. Most organizations want a way to see how everything connects, not just inside Kafka but across APIs and services. Some buy a product, some build something custom, some get a long way with tracing. Whatever you choose, the absence of this is felt during every incident.

Capacity planning wants a process and some tooling. Start with an estimate written down somewhere. Add soft limits as alerts when the estimate is exceeded. Add hard limits (quotas) where uptime guarantees demand them, or where misbehaving flows would otherwise take down the platform.

Deployment should follow a clear process, automated in the background. GitOps, infrastructure as code, pipelines. Tie it into your change management if that is how your organization works.


The governance ladder

Here is the question that actually matters: how much of this should you do?

And the answer of often: not all of it, and probably not even most of it. The right level depends on the size of your organization, the sensitivity of your data, your audit requirements, and how much churn you have.

Roughly, there is a ladder:

1. Ad hoc. No real governance. Manual topic creation, no documentation. This is everyone’s day one in the first test environment. Some organizations stay here forever all the way to production, and for niche use cases (one log topic, one tight team, no turnover) that can be fine.

2. Semi-manual. Templates for how you order, how you document flows, manal approval checkpoints. This is governance but without the conveniences. For low-churn setups it might be enough.

3. Dev automation. Git as the source of truth for topic configuration, access, alerting levels, and structured documentation. Pull request approvals give you audit. Automation is easy to layer on top. This is the sweet spot for most organizations in my experience.

Custom portal. When Git is not enough this allows you to build in custom logic, such as two-level approvals, tighter integration with internal systems (AD, change tracking), domain-specific workflows. Custom build it or use third-party tool like ServiceNow.

Developer portal. Something much bigger in scope than just Kafka, like Backstage or something similar. Golden paths, templates, scaffolding. Worth it only at significant scale and uptake.

You probably do not start at the top of this ladder, and you probably should not. Pick the level that matches your needs today and revisit it as the platform grows.


The pit stop

A quick summary to leave you with:

  • Slow down to speed up.
  • Invest in structure before complexity forces you to.
  • Find the right level of governance for your organization, not the maximum level.
  • Automate the right path so that doing the right thing is also the easy thing.

The platform you want in five years is built on the structure and governance you put in today.

Björn Löfroth is a Solution Architect at Irori, where he works on event-driven architecture, Kafka, and platform integration. This post is based on a talk given at an Irori meetup.