Lesson 17 of 17 · Kafka as a platform
Capstone: Kafka as a self-service platform
Bring the whole course together by designing Kafka as a self-service platform capability for many teams: the tenancy model (shared, dedicated or tiered clusters), a naming convention that drives ACLs, topics and identities requested as code through a developer portal and checked by guardrails, schemas and golden-path templates, observability and SLOs per tenant, cost showback, operations and support. You finish with a written architecture decision record.
The brief
A software company has 40 product teams and wants to move to event-driven integration. Some teams already run their own small Kafka clusters; others use direct API calls. You lead the platform team. Design Kafka as a platform capability: teams should get what they need in minutes, without being able to hurt each other, and the company should know what it costs.
Work through the decisions below, then write them up as an architecture decision record (ADR).
1. Tenancy model
| Model | When it fits | Trade-off |
|---|---|---|
| One shared cluster per environment | Most teams, moderate volume | Cheapest; relies on ACLs and quotas for isolation |
| Shared clusters by tier (standard, critical) | Different SLOs or compliance needs | More clusters to run; clear service levels |
| Dedicated cluster per large or regulated tenant | Very high volume, strict isolation, data residency | Highest cost and operational load |
A common answer: shared clusters by tier, with dedicated clusters as an exception that must be justified, and the same automation for all of them. Map it to the cell or region structure if the company uses cells.
2. Naming, ownership and identity
<domain>.<team>.<event>.v<N> orders.checkout.order-placed.v1
consumer groups: <team>.<service> billing.invoice-writer
service identity: User:<team>-<service>
From the name, automation can derive prefix ACLs (a team writes only under its prefix), quotas, owner metadata, dashboards and cost reports. Every topic must have an owning team; topics without an owner are a support and security problem.
3. The self-service flow
Developer portal (template: "New event stream")
│ fills: domain, event name, expected rate, retention, schema, consumers
▼
Pull request in the team's repo: KafkaTopic + KafkaUser (+ schema file)
│ CI: naming, limits, schema compatibility, owner, cost estimate
▼
Review (automatic for standard requests; platform review above limits)
▼
GitOps sync → Topic and User operators (or Terraform for managed Kafka)
▼
Admission policy re-checks guardrails in the cluster
▼
Credentials delivered to the service; topic visible in the portal catalog
Guardrails
| Rule | Why |
|---|---|
replicas: 3, min.insync.replicas: 2 |
Durability (lesson 8) |
| Partitions between 1 and N without review | Partition sprawl hurts the cluster |
| Retention within a range; PII topics capped | Cost and data-protection promises |
| Names match the convention; prefix matches the team | Isolation and ownership |
| Schema registered and compatibility mode set | Contracts (lesson 11) |
auto.create.topics.enable=false; no topic creation outside Git |
Git is the source of truth |
Check them twice: in CI for a fast, friendly error, and at admission (Kyverno or similar) so nothing bypasses them. The hands-on project Kafka as a platform service with Strimzi builds this flow on kind.
Running Kafka for 40 teams is like running a shared allotment garden. Each family gets its own labelled plots (prefixes) and a gate key that only opens its plots (identity and ACLs). There's a rule for how much water each family may use (quotas), a sign-up form at the gate instead of asking the gardener every time (self-service), and a notice board showing who grows what and who pays for what (the catalog and showback).
4. Golden paths
Make the right way the easy way. A template creates a producer or consumer service with:
- the client configured for the cluster (bootstrap, TLS, identity from the platform);
- safe producer defaults (
acks=all, idempotence) and consumer defaults (manual commit after processing, static membership on Kubernetes); - retries, a dead-letter topic and a replay tool (lesson 10);
- the outbox pattern available for services that write to a database;
- schema serializers and a CI compatibility check;
- tracing headers and a dashboard with lag, error rate and throughput.
5. Observability and SLOs
- Platform SLOs: availability of produce and consume per cluster, p99 produce latency, end-to-end latency for canary topics.
- Tenant views: each team sees its topics, throughput, lag, quota throttling and DLQ size in the portal.
- Alerts go to the owner: lag and DLQ to the consuming team; under-replication and disk to the platform team.
6. Cost and showback
Measure per team: bytes in, bytes out, stored bytes (× RF), and partitions. Turn them into a monthly showback report (cost visible) or chargeback (cost billed). Visible cost changes behaviour: teams shorten retention and drop unused topics.
7. Operations and support
- Upgrades on a published schedule; test clusters first; operator and client compatibility checked.
- DR: MirrorMaker 2 for critical tiers, practised failover, RPO and RTO per tier (lesson 16).
- Support model: documentation and templates first, office hours, a clear escalation path; platform on call only for platform-level alerts.
- Lifecycle: topics unused for N days are flagged to owners and removed after confirmation.
8. Build or buy
Decide per environment (lesson 13). Whatever runs the brokers, the self-service layer, guardrails, identities, schemas, templates and showback are the platform team's product.
Deliverable: the ADR
Write one page:
Title: Kafka as a platform capability
Status: Proposed
Context: 40 teams, current state, volumes, compliance needs, clouds
Decision: Tenancy model; managed or self-run; naming; self-service flow; guardrails;
security (identity, ACLs, quotas); schemas; DR tiers; showback
Options considered: one cluster per team; one global cluster; managed only
Consequences: what gets easier, what gets harder, costs, risks, migration plan
Metrics: lead time for a new topic, % topics with owners and schemas,
incidents caused by one tenant, cost per GB, adoption
Try it: present the design
- Fill the ADR for the brief above, with numbers: expected throughput, clusters per environment, broker sizing (lesson 16).
- Draw the self-service flow for your own platform tools (portal, Git, CI, GitOps, operators or Terraform).
- Write the five guardrail checks as CI rules or admission policies.
- Prepare answers for three challenges: "one team floods the cluster", "a schema change broke consumers", "the region is down".
- Present it in ten minutes to a colleague and note their hardest question.
Going deeper
- Migrating existing team-owned clusters: mirror them into the platform clusters with MirrorMaker 2, move consumers first, then producers, then retire the old cluster.
- Measure the platform like a product: time to first event, satisfaction surveys, and how many teams choose it when they have a choice.
- Treat events as data products: owners, contracts, quality checks and discoverability in a catalog.
Recap
- Choose a tenancy model deliberately: shared by tier, dedicated by exception.
- A naming convention drives ACLs, quotas, ownership, dashboards and cost.
- Self-service as code with guardrails checked in CI and at admission.
- Golden paths bake in safe client settings, DLQs, schemas and observability.
- Measure SLOs, show cost per team, plan DR, and write the decisions down in an ADR.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.