Multi-Tenant Cluster Isolation in Kafka
A complete, plain-English guide to letting many teams share one Kafka cluster without stepping on each other: how to separate data, access, traffic, storage, and blame, and how to know when sharing has stopped being a good idea.
Picture a large apartment building. Fifty families live inside, each with their own front door, their own mailbox, and their own utility bill. They share the roof, the pipes, the electricity supply, and the elevator. Most days nobody notices the sharing. Then one family runs a dozen washing machines at once, the water pressure drops for everyone, and the whole building is suddenly talking about the neighbor upstairs.
A shared Kafka cluster is that building. Many teams, products, or customers, called tenants, send their events through the same set of servers. Sharing saves money and effort, because one well-run platform is cheaper than fifty badly run ones. But sharing only works when every tenant is protected from the others. That protection is called isolation, and it is the subject of this guide.
We start from the basics and build up. Each new word is explained the first time it appears, each big idea comes with an everyday comparison, and every chapter ends with something you can act on. By the end you will know what to lock down, what to limit, what to watch, and when to give a tenant a building of its own.
1Why Share a Cluster at All?
Before learning how to isolate tenants, let us understand why anyone takes on the trouble of sharing.
Apache Kafka is a system that moves streams of events between programs. An event might be a payment, a click, a sensor reading, or a status change. Kafka stores these events in named channels, keeps them safe by copying them across machines, and lets many programs read them at their own pace. It began at LinkedIn and became open source in 2011.
Running Kafka well is real work. Someone must size the machines, upgrade versions, watch disks, tune settings, and answer the phone when something breaks. A company with thirty teams could give each team its own cluster. But that means thirty upgrade schedules, thirty monitoring setups, and thirty sets of idle capacity that nobody can lend to a busier neighbor.
Owning a house means you fix your own roof. Renting in a well-managed building means a professional team fixes the roof for everyone, and you pay a share. Shared Kafka works the same way: one skilled platform team runs the building, and product teams simply move in.
The price of sharing
Sharing has a cost, and the cost is risk. On a shared cluster, one tenant can hurt another in many ways, sometimes by accident and sometimes on purpose. A buggy program can flood the network. A forgotten test can fill the disks. A curious engineer can read data that belongs to someone else. A single mistaken command can delete a topic that another team depends on.
Multi-tenant isolation is the set of walls, meters, and rules that keep those risks small. The goal is simple to state: each tenant should behave as if it had its own cluster, while the company pays for one.
Isolation is never all-or-nothing. It is a dial. More isolation costs more money and effort. Less isolation is cheaper but riskier. The art is choosing the right setting for each tenant.
2Who Is a Tenant? Getting the Vocabulary Right
The word “tenant” means different things in different companies. Agree on a meaning first, because every rule you write will hang on it.
A tenant is any group of users and programs that you want to treat as one unit for isolation, billing, and responsibility. That is deliberately loose. Here are the most common meanings.
A team or department
Payments, Search, and Fraud each get their own area. This is the most common case inside a company.
An application
A single service with its own topics and identity. Several applications may belong to one team.
A customer
A software-as-a-service company gives each paying customer a slice of its Kafka platform.
A stage
Development, testing, and production. Mixing these on one cluster is usually a bad idea, and we will see why.
Kafka pieces you need to know
To talk about isolation, we need a short list of Kafka parts. Each is a place where tenants can collide.
Topic
A named channel for events, like a labeled mailbox. A topic is the main thing a tenant owns.
Partition
A topic is cut into partitions, which are ordered logs spread across servers so work can be shared.
Broker
One Kafka server. It stores partitions and answers requests. Every tenant on the cluster uses the same brokers.
Producer and consumer
Producers write events. Consumers read them, often in cooperating sets called consumer groups.
Controller
The part of the cluster that tracks who owns which partition and handles changes like creating topics.
Principal
The name Kafka uses for a logged-in client, such as User:orders-service.
In our apartment building, topics are the individual rooms, partitions are the closets inside each room, brokers are the floors of the building, and the controller is the building manager holding the master list of who lives where. The principal is the name on the door buzzer.
Every shared thing in the building is a potential collision point: floors (brokers), pipes (network), electricity (CPU), storage lockers (disks), and the manager’s time (controller). Isolation means putting a wall or a meter on each of them.
3Three Ways to Share: The Tenancy Models
There is no single way to be multi-tenant. Most companies end up using a mix of three basic shapes.
flowchart LR
subgraph M1["Model 1: Cluster per tenant"]
TA1["Tenant A"] --> CA["Cluster A"]
TB1["Tenant B"] --> CB["Cluster B"]
TC1["Tenant C"] --> CC["Cluster C"]
end
subgraph M2["Model 2: Shared cluster"]
TA2["Tenant A"] --> SH["Shared Cluster"]
TB2["Tenant B"] --> SH
TC2["Tenant C"] --> SH
end
subgraph M3["Model 3: Hybrid tiers"]
TA3["Tenant A critical"] --> DC["Dedicated Cluster"]
TB3["Tenant B"] --> SC["Shared Cluster"]
TC3["Tenant C"] --> SC
end
Model 1: a cluster per tenant
Every tenant gets its own Kafka cluster. Isolation is as strong as it can be, because nothing is shared except the cloud or data center underneath. A failure, a bad deployment, or a runaway program stays inside one cluster. The downside is cost and work. Each cluster needs its own machines, upgrades, and monitoring, and most of them run mostly idle.
Model 2: one shared cluster
All tenants live together. This is cheapest and easiest to manage, and it makes sharing data between teams easy. But every safeguard must be built inside Kafka itself, using naming rules, access lists, and quotas. One serious failure affects everyone at once.
Model 3: hybrid
Most tenants share a cluster. A few special ones, perhaps those with strict legal needs or huge traffic, get their own. This balances cost and risk and is what many mature platforms settle on.
| Question | Cluster per tenant | Shared cluster | Hybrid |
|---|---|---|---|
| Isolation strength | Very high | Depends on your controls | High for special tenants |
| Cost | Highest | Lowest | Middle |
| Operations effort | Grows with tenant count | Stays roughly constant | Moderate |
| Blast radius of a failure | One tenant | All tenants | Depends on the tier |
| Data sharing between tenants | Needs replication | Simple, by permission | Mixed |
| Best for | Strict legal or performance demands | Many small or medium tenants | Growing platforms |
Design your automation so a tenant can move from the shared cluster to a dedicated one later without changing its own code. If moving is easy, you can start everyone on the cheap option and promote only when needed.
4The Seven Dimensions of Isolation
Isolation is not one thing. It is a stack of separate protections, and a gap in any layer can let trouble through.
flowchart TD
T["Tenant applications"] --> L1["1 Identity: who are you"]
L1 --> L2["2 Access: what may you touch"]
L2 --> L3["3 Naming: where do your things live"]
L3 --> L4["4 Traffic limits: how much may you send"]
L4 --> L5["5 Storage limits: how much may you keep"]
L5 --> L6["6 Placement: which machines hold your data"]
L6 --> L7["7 Visibility: who can see your data and metrics"]
L7 --> B["Shared brokers, disks, network, and controller"]
Identity
Every tenant application logs in with its own name. Without identity, nothing else can be enforced, because Kafka would not know who is asking.
Access
Rules say which names may read, write, or manage which topics and groups. This stops one tenant from reading or damaging another’s data.
Naming
A strict pattern for topic and group names gives each tenant its own private area of the map, and makes rules easy to write.
Traffic limits
Quotas cap how much network bandwidth, processing time, and connection activity one tenant can use, so nobody drowns the rest.
Storage limits
Retention and size rules stop one tenant from filling the disks.
Placement
Choosing where a tenant’s data lives, including giving some tenants their own machines, is the strongest way to separate physical resources.
Visibility
Tenants should see only their own topics, their own metrics, and their own bills, not each other’s.
A building protects its residents in layers: a locked door (identity), a key that opens only your apartment (access), numbered apartments (naming), a water meter and a fuse per apartment (traffic limits), a storage locker of fixed size (storage limits), separate floors for the loudest tenants (placement), and blinds on the windows (visibility). Remove any one and neighbors start to notice each other.
The next chapters take these layers one at a time. As you read, keep asking the same question about each: if this layer fails, what is the worst a neighbor could do?
5Identity, Giving Every Tenant a Name
You cannot limit or protect what you cannot name. Identity comes first, and it must be done carefully.
When a program connects to a broker, Kafka can require it to log in. After login, Kafka labels the connection with a principal, a name such as User:payments-ledger. Every rule that follows, whether an access rule or a quota, attaches to that name. So the quality of your isolation can never be better than the quality of your identities.
How Kafka logs clients in
Kafka supports several login methods. Mutual TLS uses certificates. SCRAM uses salted password proofs stored in the cluster. OAuth uses short-lived signed tokens from an identity provider. Kerberos uses tickets. All of them should run over an encrypted connection, so nobody on the network can copy credentials. Which one you pick matters less than using one, and using it for every tenant.
Think of the buzzer panel at the front of the building. If there are no name labels, or ten families share one label, the doorman cannot tell who is at the door, and cannot apply house rules to one family without affecting the rest.
Rules for tenant identities
One identity per application
Not one per team, and never one per company. Smaller identities mean smaller blast radius and clearer audit trails.
Name identities after the service
Service names outlive the people who created them, and they make logs readable.
Tie every identity to a tenant
Keep a registry that says which tenant owns each identity, so quotas, bills, and access can be found in one place.
Never share credentials across tenants
Shared credentials make every later protection useless.
The anonymous connection trap
If a listener allows connections without login, every client on it arrives with the same anonymous name. Quotas and access rules then treat all anonymous clients as one giant tenant. Make sure every client-facing listener requires login. Also make sure the setting that lets everyone in when no rule exists is turned off, so that missing rules mean no access rather than open access.
Client IDs are labels, not proof
Kafka clients can also announce a client ID, a free-text label. It is handy for metrics and for quotas, but clients choose it themselves, so one tenant could claim another’s label. Use the authenticated principal for anything security-related, and use the client ID only as an extra tag that helps you tell apart the several programs one tenant runs.
Never rely on a client ID, an IP address, or a header to identify a tenant for security purposes. Anything the client can set by itself, a misbehaving client can fake.
6Naming and Namespaces, Your Private Street Addresses
Kafka has no built-in folders for tenants. A good naming pattern acts as a set of folders, and it makes almost every other rule simple.
In Kafka, all topic names live in one flat list for the whole cluster. There are no real sub-areas. So multi-tenant platforms invent them by agreeing on a naming convention: every topic name starts with a fixed prefix that identifies its owner.
A flat list of mailbox labels would be chaos: “orders”, “orders2”, “orders-new”. Street addresses fix that. “12 Maple Street, Apartment 4” tells you exactly who owns the box. A tenant prefix is the street address of a topic.
A pattern that works
A common recipe puts the tenant first, then the domain or application, then the data name, and sometimes a version or environment. For example, a topic name might read like tenant, then team, then dataset, then version, separated by dots. Something like a retail tenant’s fraud team writing a stream of scored transactions could become retail.fraud.scored-transactions.v1.
Simple access rules
One rule can cover every topic that starts with the tenant’s prefix, present and future.
Easy billing and metrics
Group anything by prefix to see one tenant’s size and cost.
Clear ownership
Anyone reading a topic name knows who to contact.
Safer automation
Scripts can refuse to touch names outside the requester’s prefix.
Names beyond topics
Topics are not the only things that need a prefix. Consumer group names, transactional identifiers, and schema subjects are all shared lists too. If one tenant names its group “billing” and another does the same, they could accidentally join each other’s group and split the work between unrelated programs, or read offsets that belong to someone else. Apply the same tenant prefix to groups, transaction IDs, and connector names.
Reserved and shared names
Keep a small set of reserved prefixes for platform-owned topics, such as shared reference data or company-wide event streams. Tenants get read-only access to those. Reserve names for internal Kafka topics too, and make sure no tenant can create or write them.
Choose the convention before the first tenant arrives. Renaming topics later means creating new ones, copying data, and coordinating every reader and writer. That is a painful project.
“A naming convention is enough to isolate tenants.” No. A name is only a label. Without access rules that enforce the prefix, nothing stops one tenant from writing into another tenant’s name.
7Access: ACLs, Prefixes, and the Deny-by-Default Rule
Once Kafka knows who is asking, access rules decide what they may do. This is the wall between your tenants’ data.
An ACL, short for access control list, is a rule such as “this principal may write to this topic”. Kafka checks these rules on every request. If no rule allows the request, Kafka refuses it. Getting these rules right, and keeping them right, is the heart of data isolation.
The parts of a rule
| Part | Meaning | Example in words |
|---|---|---|
| Principal | Who the rule is about | The payments-ledger service |
| Operation | What they want to do | Read, write, create, describe, delete, alter |
| Resource type | What kind of thing | Topic, consumer group, cluster, transactional ID |
| Resource name | Which one | A specific topic, or every name starting with a prefix |
| Permission | Allow or deny | Allow |
| Host | Where the request comes from | Any host, or a specific address |
Prefixed rules: the tenant’s superpower
Kafka lets a rule match a resource name in three ways: an exact name, a wildcard that matches everything, or a prefix that matches every name starting with given text. The prefix style, added in Kafka 2.0, is perfect for tenants. One rule can say “the retail tenant’s service may read and write every topic starting with retail.“. New topics that follow the convention are covered automatically, with no new rules to write.
Giving a tenant a key to “everything on the third floor” is much easier than cutting a new key each time a closet is added on that floor. The prefix is the floor number.
Deny by default
Kafka has a setting that decides what happens when no rule mentions a resource. Leave it at its strict default, so that no rule means no access. If it is flipped to permissive, every missing rule quietly becomes an open door. Check this setting first on any cluster you inherit.
Which resources need protecting?
Topics
Read, write, and describe rights, scoped by prefix. Keep create and delete rights narrow.
Consumer groups
Consumers need group rights to read. Prefix these by tenant, or tenants can hijack each other’s offsets.
Transactional IDs
Programs that use transactions need rights on their transactional ID. Prefix them too.
Cluster
Cluster-level rights such as altering settings or reassigning partitions must stay with the platform team.
Hidden topics
Kafka only reveals a topic in listings to principals allowed to describe it. So when describe rights follow the prefix rule, each tenant sees only its own topics. Nobody can browse a neighbor’s list of topic names, which matters because names alone can leak business secrets, like the codename of an unreleased product.
Deny rules and super users
A deny rule beats an allow rule when both match. That makes deny rules useful as emergency brakes, for example to cut off one identity quickly. Separately, Kafka lets you name super users who skip all checks. Keep this list tiny, give each person their own named identity instead of a shared one, and never place a tenant application on it.
Wildcard rules for “all topics” are the most common isolation failure. They usually start as a shortcut during testing and quietly survive into production. Search for them regularly and treat each one as a defect.
8Security Deep Dive: Who Could Hurt You, and How
A shared cluster has more ways to go wrong than a private one. Walking through the threats one by one shows where each control earns its place.
Security people start with a threat model, which is simply a list of who might cause harm and how. For a multi-tenant Kafka cluster, the interesting threats are not only outside attackers. They include honest mistakes by tenants and curious insiders. Here is a practical list.
| Threat | What could happen | Main defenses |
|---|---|---|
| Stolen tenant credential | Attacker acts as that tenant | Narrow prefix ACLs, quotas, short-lived credentials, fast disable |
| Tenant with a coding bug | Floods or corrupts shared resources | Quotas, topic policies, message size limits |
| Curious tenant engineer | Tries to read a neighbor’s topic | Deny by default, hidden topic names, audit of denials |
| Overpowered shared tool | A console or gateway lets users bypass ACLs | Limited tool identity, per-user checks inside the tool |
| Malicious or careless admin | Reads or deletes tenant data | Tiny super user list, named accounts, logging, client-side encryption |
| Network eavesdropper | Copies credentials or data on the wire | TLS everywhere, network segmentation |
| Connection flood | Exhausts broker connections | Connection limits, firewall rules, listener separation |
| Configuration drift | Someone loosens a rule and forgets | Configuration as code, drift checks, regular ACL reviews |
Separate listeners by audience
Give different audiences different doors. Tenants connect to a client listener. Brokers talk to each other on a separate internal listener with its own login method. Administrative tools use a third listener reachable only from a management network. Even if someone finds a weakness in the tenant-facing door, it does not automatically open the admin door.
A hotel has a guest entrance, a staff entrance, and a delivery dock. Guests never walk through the kitchen, and delivery drivers do not wander into guest rooms. Separate doors mean a mistake at one does not open the others.
Limit what tenants may manage
Tenants often want to create their own topics. You can allow this safely by granting create rights only on their prefix, and backing it with a topic policy that caps size and settings. Do not grant tenants rights over the whole cluster. Altering cluster settings, reassigning partitions, or changing quotas belong to the platform team. Also be careful with the right to read topic settings, since settings can reveal how another team configured its systems.
Keep an audit trail
Kafka’s authorizer can log every allowed and denied request. Send those logs to a central place and search them. A steady trickle of denials from one identity is a useful signal: it may be a bug, a leftover configuration, or someone probing. Also log changes to ACLs, quotas, and topics, with the person and the request that caused them. When something goes wrong, the trail turns guessing into reading.
Review access on a schedule
Access rules tend to grow and never shrink. Every quarter, list each identity and its rules, and ask the owner whether they are still needed. Remove identities of services that no longer exist. Old, unused credentials are the ones attackers love, because nobody notices when they are used.
Delegating too much power to tenants is a quiet way to lose isolation. A tenant who can create ACLs can grant itself, or a friend, access to anything. Keep rule creation in the pipeline.
9Quotas, the Meters on Every Apartment
Access rules stop tenants from reading each other’s data. Quotas stop them from starving each other of resources. Both are needed.
Imagine an apartment with no water meter and no limit. One tenant fills a swimming pool, and the pressure drops for everybody. A quota is a limit on how much of a shared resource a tenant may use per second. Kafka enforces quotas on the brokers, and a tenant that goes past its limit is slowed down instead of being allowed to hurt the others.
The noisy neighbor problem
The classic multi-tenant failure is called the noisy neighbor. One tenant suddenly sends or reads far more than usual, perhaps because of a bug, a replay of old data, or a big batch job. Because brokers share network cards, CPU, and disks, the surge takes capacity away from everyone else. Without quotas, well-behaved tenants see slow responses and failures for reasons that have nothing to do with their own code.
It is a single elevator in a tall building. One family moves house and holds the elevator for an hour. Everybody else waits. A fair-use rule, such as “five minutes per family at busy times”, is what a quota is.
Bandwidth quotas
The most used quotas limit data volume. There are two: a produce rate in bytes per second for writing, and a fetch rate in bytes per second for reading. They are set for a principal, for a client ID, or for a combination of both. The most specific setting wins, and defaults catch everyone with no setting of their own.
Request quotas
Bytes are not the only cost. A tenant sending huge numbers of tiny requests can use up broker processing time even with little data. A request quota limits the share of broker thread time a tenant may consume. It protects against chatty clients, expensive operations, and buggy loops that hammer the brokers.
Controller mutation quotas
Creating and deleting topics and partitions are heavy operations because the controller must update the whole cluster’s map. Kafka 2.7 added a mutation quota that limits how fast one tenant can create or remove topics and partitions. Without it, a script that creates ten thousand topics in a loop can stall the controller for everyone.
Connection quotas
Every connection costs memory and processing time. A program that opens and closes connections in a tight loop can overwhelm a broker with handshakes. Limits on new connections per second, and on total connections per address, cap that damage. Keep in mind that connection limits by address only help when tenants come from separate addresses.
| Quota type | What it limits | Protects against |
|---|---|---|
| Produce rate | Bytes written per second | Write floods, replays |
| Fetch rate | Bytes read per second | Consumer catch-up surges, giant scans |
| Request percentage | Share of broker thread time | Chatty or expensive request patterns |
| Mutation rate | Topic and partition changes per second | Controller overload |
| Connection rate | New connections per second | Connection storms |
Bandwidth quotas are enforced by each broker separately, not as one total for the whole cluster. If a tenant’s partitions are spread across six brokers with a 10 MB per second limit, the tenant may get close to 60 MB per second in total when traffic is evenly spread. Plan limits with that multiplication in mind.
10Internal Working: How a Quota Actually Slows Someone Down
Quotas do not block tenants outright. They slow them just enough to stay under the line. Here is the mechanism, step by step.
sequenceDiagram
autonumber
participant P as Tenant Producer
participant B as Broker
participant Q as Quota Tracker
P->>B: Produce request with data
B->>B: Write data to the log
B->>Q: Record bytes for this principal
Q-->>B: Rate over the limit, delay needed
B-->>P: Response held back for the delay
P->>P: Sees throttle time and slows down
P->>B: Next produce request, later
B->>Q: Record bytes again
Q-->>B: Rate now within limit
B-->>P: Response without delay
Measure, then delay
The broker keeps a running total of how many bytes each principal has sent or fetched over a short sliding window, about a second long. After handling a request, it compares the rate to the tenant’s limit. If the tenant is over, the broker works out how long it should have taken to stay within the limit, and holds the reply back for that extra time.
Because clients wait for replies before sending more, the delay naturally reduces the rate. The broker does not need to drop data or close connections. The client just experiences slowness. Well-written clients also read a “throttle time” value in the reply, and report it in their metrics, so the tenant can see they are being limited.
A toll booth that lets cars through at a steady pace does not shut the road. It simply keeps the barrier down a moment longer when cars arrive too quickly. Nobody is turned away, but the flow evens out.
Which limit applies
A tenant may match several settings: one for the exact principal and client ID pair, one for the principal, one for the client ID, and defaults for each. Kafka picks the most specific match. Platform teams usually set a default per principal and override for tenants that have paid for more, or for the platform’s own tools.
What throttling does not do
It does not stop memory pressure
A huge request still arrives in full before it is measured. Message size limits and request size limits are needed as well.
It does not fix disk fullness
Bandwidth quotas slow writes but do not cap total stored data. That needs storage rules.
It cannot see who is behind a fake identity
If tenants share a principal, they share a quota. Identity design still comes first.
Retries can turn a throttled client into a louder one. A client that treats slow replies as errors and retries instantly makes the load worse. Make sure client timeouts are longer than expected throttle delays, and that retries back off.
11Choosing Quota Numbers: A Worked Calculation
Knowing that quotas exist is easy. Picking the numbers is where teams get stuck. A simple method gets you to sensible starting points.
Let us use a made-up cluster of six brokers. After measuring, the platform team decides each broker can safely handle about 150 MB per second of client writes, once replication traffic and consumer reads are taken into account. Notice that this is a safe working figure, well below the hardware’s raw limit, so that the cluster survives a broker failure and a traffic surge.
Find the safe capacity per broker
Take the peak the hardware can sustain, then leave generous headroom for failures, catch-up reads, and maintenance. In our example, that is 150 MB per second per broker.
Decide the tenant’s total ceiling
Suppose a standard tenant should not exceed 60 MB per second of writes in total across the cluster.
Convert to a per-broker quota
Quotas apply per broker. With six brokers and evenly spread data, 60 divided by 6 gives 10 MB per second per broker.
Count how many tenants fit
If each broker can take 150 and each standard tenant is allowed 10 per broker, then 15 standard tenants fill the plan with no oversubscription.
Choose an oversubscription ratio
Since tenants rarely all peak together, you might sell twice that, so 30 tenants share the cluster. Then watch the real combined usage, and stop adding tenants if the busy hour approaches the safe capacity.
Uneven spread
The division above assumes a tenant’s partitions are spread evenly across all brokers. If a tenant only has partitions on two brokers, its quota on those two is the only cap, and those brokers carry all the tenant’s load. So when a tenant’s data is concentrated, either raise the number of brokers involved, or set its quota with the concentrated brokers in mind.
Reads need their own number
Reads are usually a multiple of writes, because several consumer groups may read the same data. A topic written at 10 MB per second and read by four groups causes 40 MB per second of outgoing traffic. Set fetch quotas with this multiple in mind, and leave room for catch-up after a consumer outage, when a group reads faster than usual.
Start gentle, then tighten
A good practice is to first run quotas in observation mode: set them high, watch the real usage for a few weeks, then bring them down to about one and a half to two times the observed peak. This avoids surprising a tenant on day one, and gives each conversation real numbers to talk about.
Write down how you chose each number. In six months, when a tenant asks why it was limited to 10 MB per second, an answer that begins with real measurements is far more persuasive than “that is the default”.
12Storage Isolation, Lockers of a Fixed Size
Disks are the resource most likely to run out quietly. One tenant filling them takes the whole building down.
Kafka keeps events on disk for as long as the retention rules say. A tenant that keeps data far longer than planned, or writes more than expected, consumes disk space that every other tenant shares. Kafka has no single switch that says “this tenant may use at most 2 terabytes”. Instead, you combine several tools.
Retention rules per topic
Each topic can limit how long data is kept, how large it can grow, or both. Time-based retention says “delete data older than seven days”. Size-based retention says “keep at most this much per partition”. Set sensible defaults for the cluster, and set a ceiling that tenants cannot exceed without asking.
Estimating tenant storage
A quick formula helps with planning. Multiply the average write rate by the retention time, then multiply by the replication factor. For example, a tenant writing 5 MB per second and keeping data for 3 days stores about 5 × 86,400 × 3, roughly 1.3 terabytes of unique data. With three copies, that is about 3.9 terabytes of raw disk. Doing this sum for each tenant at onboarding time shows who will be a big spender.
Guardrails that make limits real
Topic creation policies
Kafka lets you plug in a check that runs whenever someone creates or changes a topic. It can reject topics with too many partitions, too high a retention, or the wrong name.
Central topic creation
Turn off automatic topic creation and let tenants request topics through an approved pipeline that applies the rules.
Message size limits
Cap the biggest message a tenant may send, at the broker and topic level, to protect memory and disks.
Usage alerts
Alert on each tenant’s disk use, with a warning well before the disks fill, since Kafka has no native per-tenant size limit.
Cheaper storage for long retention
Recent Kafka releases support tiered storage, which keeps recent data on fast local disks and moves older data to cheaper remote storage. That lets tenants with long retention needs keep their data without eating premium disk space. If your version supports it, tiered storage turns a scary storage problem into a cost line.
When a broker’s disk fills, it does not just stop one tenant. It can take that broker offline, and every tenant with data on it feels the effect. Treat disk headroom as a shared safety margin, and defend it fiercely.
13Partitions, Metadata, and the Controller’s Workload
Every topic and partition costs the cluster something, even when it sits empty. Without limits, tenants can exhaust the cluster’s bookkeeping.
Each partition takes up open files, memory, and replication work on the brokers that hold it. Each also adds to the map the controller maintains. When a broker fails, the controller has to move leadership of all its partitions elsewhere. The more partitions there are, the longer that recovery takes. A tenant that creates thousands of partitions “just in case” pushes that recovery time up for everyone.
Consider the building manager’s master list. Ten thousand new closets on the list slow every change to it, and if the manager takes a sick day, finding a stand-in takes far longer. Empty closets are not free.
Cost of a partition
Files and memory
Each partition has log files and index files that must be opened and held, using system resources on its broker.
Replication
Every follower copy needs a stream from the leader, adding network and thread work.
Recovery time
After a broker failure, leadership must move for each affected partition. Bigger counts mean longer disruption.
Metadata
Clients and brokers pass around the cluster map. More partitions make that map heavier for all.
Limits that help
Set a sensible cap on partitions per topic and on partitions per tenant, and enforce it through the topic creation policy. Publish a simple guideline to tenants: choose partitions for the throughput you need soon, not the throughput you might dream of. It is easy to add partitions later, but hard to take them away.
Modern Kafka runs its own controller quorum, called KRaft, which handles far larger partition counts than older designs. That is welcome, but it is not a reason to skip limits. Budget partitions per broker as a shared resource, and watch the total.
Example: the topic-per-customer trap
A software company decides to give every customer their own topic with 12 partitions. At 500 customers that is 6,000 partitions before any replication. At 5,000 customers it is 60,000. A design that seemed tidy becomes a heavy load on the controller. A common fix is to keep customers in shared topics with the customer ID inside each message, and give only the largest customers their own topics.
14Stream Processing Apps and Their Hidden Topics
Programs that transform data in Kafka create topics and groups you did not ask for. In a shared cluster, those hidden helpers need fences too.
Kafka Streams is a library for building programs that read topics, process events, and write results. To do its job, it quietly creates extra topics. Some hold intermediate data that must be regrouped, called repartition topics. Others hold the saved state of the program so it can recover after a restart, called changelog topics. Their names start with the program’s application ID, which is also the name of its consumer group.
When you cook a big meal, you also produce bowls of chopped vegetables, half-finished sauces, and a stack of dirty pans. The recipe lists only the final dish, but the kitchen is full of helpers. Streams programs work the same way: the visible result is small, and the supporting topics are plentiful.
What to enforce
Tenant prefix on application IDs
If the application ID starts with the tenant prefix, every helper topic and the group do too, and your prefix ACLs cover them automatically.
Create rights on the prefix
Streams programs usually need to create their helper topics. Allow creation on the tenant’s prefix, and no further.
Partition budgets count helpers
A single program can create dozens of partitions across helper topics. Count them in the tenant’s budget.
Changelog retention
State topics can be large. Apply retention and size rules to them like any other topic, and include them in storage estimates.
Other stream tools
SQL-style tools that sit on top of Kafka, and stream processors run on outside frameworks, follow the same idea. They create groups, internal topics, and sometimes many at once. Ask the tenant how their tool names its internal objects, then check that the names fall inside their prefix. If a tool insists on a fixed name that would clash with others, give that tenant its own cluster or its own dedicated instance of the tool.
Two teams that pick the same application ID by accident will join the same group and share state topics. Their programs will corrupt each other’s results in confusing ways. Enforce the tenant prefix on application IDs at review time, and reject IDs without it.
15Placement, Choosing Which Floor Each Tenant Lives On
Quotas share machines fairly. Placement goes further by deciding which machines a tenant’s data sits on at all.
By default, Kafka spreads new partitions across brokers to balance load. It does not know about tenants. That is convenient, yet it means every tenant is on every broker, so a bad tenant can stress every machine. Placement means steering a tenant’s partitions onto chosen brokers.
Why place tenants deliberately
Protect critical tenants
Keep a business-critical tenant on brokers that noisy tenants never touch.
Contain risky tenants
Put an experimental or unpredictable tenant on a small set of machines, so trouble stays fenced in.
Meet legal rules
Some data must live in a certain region or on certain hardware.
Match hardware to need
Heavy readers may need fast disks and more memory. Others are happy with cheaper machines.
How placement is done
Kafka does not have a simple “pin this tenant to these brokers” switch. Teams get the same result in a few ways. When creating a topic, the platform can supply an explicit list of which brokers should hold each replica. Later, a partition reassignment tool can move data between brokers. Balancing tools such as Cruise Control can automate this and follow rules like “keep this tenant’s topics only on brokers in this group”. Rack awareness lets Kafka keep replicas of a partition in different failure zones, so one lost zone does not lose all copies.
Think of a hotel that reserves the quiet upper floors for guests who need sleep, and the ground floor near the bar for a wedding party. Guests are assigned to floors on purpose, not by luck of the elevator.
The cost of placement
Deliberate placement creates islands of capacity. A broker group reserved for one tenant cannot lend its spare room to another. You give up some of the efficiency that made sharing attractive. Use placement for the tenants that truly need it, and let the rest float on the general pool.
Some platforms create “pools”: a general pool for most tenants, a high-priority pool with lighter load, and a sandbox pool for experiments. A tenant chooses a pool at onboarding, and can be moved as its needs change.
16Consumer Groups, Transactions, Schemas, and Connect in a Shared World
Topics get most of the attention, but tenants share several other things too. Each needs its own fence.
Consumer groups
A consumer group is a team of consumers splitting the work of reading a topic. Each group has a name and a stored position, called its offset. Group names are shared across the cluster, so two tenants using the same name would interfere with each other, joining the wrong team or moving each other’s positions. Enforce tenant prefixes on group names, using the same prefix rule as topics.
Groups also use a broker called the group coordinator to track members. A tenant whose consumers join, leave, and rebalance constantly can overload the coordinator and slow other groups it looks after. Watch for groups that rebalance again and again, and coach the owning team to fix session timeouts and restart patterns.
Transactions
Programs that use Kafka transactions identify themselves with a transactional ID, and Kafka tracks state for each. Apply prefix rules here too, and limit the number of transactional IDs a tenant may hold, since each takes up broker memory and coordinator time.
Schema Registry
Many teams register data formats, called schemas, in a shared registry. Subjects, the names under which schemas are stored, are a shared list. Give tenants their own subject prefixes or separate contexts. Without that, one tenant could register a new version of a shared schema and break another tenant’s readers.
Kafka Connect
Connect moves data in and out of Kafka using ready-made connectors. In a multi-tenant setup, you can run one Connect cluster per tenant for cleaner separation, or a shared one with strict rules. A shared Connect cluster has extra risks: connectors run inside shared processes, and each connector can be configured to use a different Kafka identity. Use per-connector client overrides where your version permits, so a connector uses its tenant’s identity and quotas, not the Connect cluster’s own.
| Shared thing | How tenants collide | Fence |
|---|---|---|
| Consumer groups | Same name, stolen positions, coordinator overload | Prefixed group ACLs; watch rebalance rates |
| Transactional IDs | Same ID, fenced producers | Prefixed ACLs; limit counts |
| Schema subjects | Overwritten or incompatible versions | Subject prefixes or contexts; permissions |
| Connect workers | Shared memory, shared identity | Per-tenant clusters or per-connector overrides |
| Admin operations | Deleting or changing others’ topics | Narrow cluster and topic management rights |
Shared tools running with a powerful identity, such as a web console or a gateway, can undo all your careful ACLs. If a console uses one all-powerful account, every user of the console effectively has that power. Give shared tools a limited identity and enforce per-user rules inside them.
17Visibility and Data Privacy Between Tenants
Isolation is also about what tenants can see and what the platform team can see. Privacy needs its own thought.
What tenants should see
A tenant should be able to view its own topics, groups, and usage numbers, and nothing belonging to others. Access rules already hide other topic names. Metrics need the same care. If your dashboards show every tenant’s traffic to every user, tenants can learn their neighbors’ business volumes. Build per-tenant views that filter by prefix or by identity, and give tenants access only to their own.
What the platform team can see
Brokers store data in a form they can read. Anyone with admin rights over the machines or with super user access to Kafka can read every tenant’s data. For tenants with sensitive data, that may be unacceptable, even when it is the platform team looking.
Encryption at different levels
Encryption in transit
TLS protects data between clients and brokers, and between brokers. Standard for every tenant.
Encryption at rest
Disk or volume encryption protects lost or stolen drives. It usually covers the entire cluster with one key, not each tenant separately.
Client-side encryption
The tenant encrypts message contents before sending, with its own keys. Brokers and the platform team see only scrambled bytes. This gives strong per-tenant privacy.
Field-level protection
Only the sensitive fields, such as card numbers, are encrypted or replaced with tokens, leaving the rest readable for processing.
Disk encryption is like a locked building that the caretaker can open freely. Client-side encryption is like each tenant keeping their valuables in a personal safe inside their apartment. The caretaker can enter the building but cannot open the safe.
The trade-off of client-side encryption
Encrypting on the client gives real privacy but costs features. Brokers cannot inspect or compress the message contents well, and tools that read messages need the keys. Key management becomes the tenant’s job. Choose it for data that truly needs it, and rely on transit and disk encryption for the rest.
Log every administrative read of tenant data, and keep the list of people with broker-level access very short. Trust is stronger when it is checked.
18Noisy Neighbors in Practice: Symptoms, Causes, and Fixes
Every shared cluster meets the same handful of problems. Knowing their fingerprints lets you find the culprit fast.
| What everyone sees | Likely cause | How to confirm | Fix |
|---|---|---|---|
| Slow writes for many tenants | One tenant flooding a broker | Per-principal produce rates and broker network use | Tighten that tenant’s produce quota; check for a replay |
| Slow reads across the board | A consumer catching up on huge backlog | Per-principal fetch rates; disk read load | Fetch quota; schedule big catch-ups off-peak |
| Broker CPU high with little data | Chatty clients or expensive requests | Request quota metrics by principal | Request percentage quota; fix client batching |
| Topic creation hangs | Mass topic or partition creation | Controller activity and mutation quota metrics | Mutation quota; block the script |
| Group rebalances everywhere | Group coordinator overloaded by one busy group | Rebalance counts per group | Fix that team’s timeouts and deployments |
| Broker down, disk full | One tenant retaining too much | Disk use per topic prefix | Lower retention; add disk; tiered storage |
| Connection errors | Connection storm from one client set | New connections per second by address | Connection rate limits; fix reconnect loops |
| Uneven load on one broker | A hot partition from a skewed key | Per-partition traffic | Better key choice; more partitions; rebalance |
A reliable diagnostic routine
Find the resource that is stressed
Network, CPU, disk, or controller. The symptom table above points to the right one.
Break the numbers down by tenant
Because identities and prefixes map to tenants, per-principal and per-prefix metrics reveal who is loudest.
Apply the smallest fix
Throttle that tenant with a quota. Avoid blunt actions that hurt everybody.
Tell the tenant
Send the owner the evidence, so they can fix the root cause.
Update defaults
If the incident showed a gap, such as no request quota, close the gap for all tenants.
Example: the friendly replay
A data science team decides to re-read three months of history from a topic to rebuild a model. Their consumer runs flat out, saturating the network on two brokers. Live tenants on those brokers start timing out. A fetch quota on the data science team’s identity would have slowed the replay to a safe pace. After the incident, the platform team adds a default fetch quota for every new tenant, so it cannot happen again.
19Monitoring, Metrics, and Chargeback
Isolation you cannot see is isolation you cannot trust. Per-tenant measurement is what makes limits, fairness, and billing possible.
Metrics per tenant
Kafka reports many numbers per principal and per client ID, especially for quotas. Tag every graph by tenant by mapping principals or topic prefixes to tenant names. Then you can answer, at any time, the question “who is using what?”
Bytes in and out
Track write and read volume for each tenant, and compare with its quota.
Throttle time
Shows how often and how long a tenant is being slowed. A tenant always at its limit needs a conversation about capacity.
Disk by prefix
Track stored bytes per tenant and the growth trend, and alert before disks reach a dangerous level.
Topic and partition counts
Watch counts against per-tenant budgets to catch runaway creation.
Consumer lag
How far behind each consumer group is, so tenants can see their own health.
Denied requests
A spike in refused actions from one identity may signal a bug or a probing attempt.
Chargeback and showback
Showback means showing each tenant what they use and what it would cost. Chargeback means actually billing them. Both change behavior. A team that sees a monthly cost for a topic nobody reads soon deletes it. Simple cost models multiply traffic, storage, and partition counts by unit prices. Even rough numbers make tenants thoughtful about waste.
Give tenants a window
Provide a self-service dashboard where each tenant sees its own usage, limits, throttling, lag, and costs. It cuts support requests and helps tenants see their own problems before the platform team has to tell them.
Alert the tenant when they reach eighty percent of a quota or a storage budget. A gentle early warning avoids sudden slowdowns and angry messages.
20Governance and Self-Service Onboarding
Rules that depend on people remembering them will fail. Rules built into an automated pipeline hold up.
In a busy multi-tenant platform, dozens of teams need new topics, new identities, and changed limits every week. If the platform team handles each by hand, it becomes a bottleneck and a source of mistakes. The answer is a self-service pipeline: tenants describe what they want in a file, a person reviews it, and automation applies it consistently.
flowchart LR
R["Tenant writes a request file"] --> PR["Review by platform team"]
PR --> V["Automated policy checks"]
V -->|"passes"| A["Apply: identity, ACLs, quotas, topics"]
V -->|"fails"| R
A --> M["Register in tenant catalog"]
M --> D["Dashboard and alerts created"]
D --> N["Tenant notified with connection details"]
What the pipeline enforces
Naming rules
Topic, group, and transactional ID names must carry the tenant’s prefix. Anything else is rejected.
Size limits
Partitions, retention, and message size must fit within the tenant’s plan.
Least-privilege ACLs
Rules are generated from the request, never hand-typed, and never contain wildcards for all topics.
Default quotas
Every new identity gets safe default quotas without anyone remembering to add them.
Ownership records
Every topic and identity is tied to an owner and a contact, so incidents reach a real person.
Configuration as code
Keep the whole desired state, meaning tenants, identities, topics, ACLs, and quotas, in version control. A change request becomes a reviewed change, and the history shows who approved what. If someone edits the cluster by hand, a drift check flags it and puts things back. This turns isolation into something you can audit rather than something you hope for.
Leaving a back door, such as a shared admin account, defeats the whole pipeline. Every manual change made through the back door is a change nobody reviewed and nobody can trace.
21Tenant Tiers and Service Promises
Not every tenant needs the same treatment. Offering a few clear tiers keeps the platform fair and the bills sensible.
A service tier is a package of limits and promises. Instead of negotiating every detail with every team, the platform offers three or four standard packages, and each tenant picks one. The idea is the same as airline seats: economy, business, and first class share one aircraft but get different space, service, and priority.
| Feature | Sandbox | Standard | Premium | Dedicated |
|---|---|---|---|---|
| Cluster | Separate small cluster | Shared pool | Shared, priority brokers | Own cluster |
| Traffic quota | Very low | Moderate default | High, negotiated | Set by tenant capacity |
| Retention ceiling | 1 day | 7 days | Up to 30 days | Custom |
| Partition budget | Small | Moderate | Larger | Custom |
| Availability promise | None | Best effort | Stated target | Stated target, own on-call |
| Support | Community style | Business hours | Priority response | Full engagement |
| Price | Free or minimal | Base rate | Higher rate | Highest |
A shared workspace offers hot desks, dedicated desks, private offices, and whole floors. The internet line is the same building-wide, but the more you pay, the more your space is protected from noise and crowding.
Keep production and non-production apart
Never share a cluster between production workloads and development or testing. Test environments generate strange traffic: replays, load tests, experiments with tiny mistakes. Those are exactly the noisy neighbors you fear. A separate sandbox cluster costs little and prevents a whole family of outages.
Promises must be measurable
Any promise you make, such as availability or delivery latency, must be something you can measure per tenant. If you cannot measure it, you cannot prove you kept it. Define each promise with a number and a way of measuring it, then publish the results to the tenants.
22When to Give a Tenant Its Own Cluster
Sharing is a default, not a religion. Some tenants outgrow it, and knowing the signs saves painful surprises.
flowchart TD
S["New or growing tenant"] --> Q1{"Legal or contract needs its own hardware or region?"}
Q1 -- "Yes" --> D["Dedicated cluster"]
Q1 -- "No" --> Q2{"Traffic near or above a big share of a broker pool?"}
Q2 -- "Yes" --> D
Q2 -- "No" --> Q3{"Needs stricter availability than the shared promise?"}
Q3 -- "Yes" --> D
Q3 -- "No" --> Q4{"Needs special versions, settings, or plugins?"}
Q4 -- "Yes" --> D
Q4 -- "No" --> Q5{"Keeps causing noisy neighbor incidents?"}
Q5 -- "Yes" --> P["Priority pool or dedicated cluster"]
Q5 -- "No" --> SH["Stay on shared cluster"]
Signs a tenant should move out
Rules of law
Regulations require data to live in a specific place, on specific hardware, or apart from other companies’ data.
Size
The tenant’s traffic is so big that it dominates a shared pool and makes capacity planning for others harder.
Strict promises
The tenant needs availability or latency far tighter than the shared pool can honestly promise.
Special needs
It needs a different Kafka version, unusual settings, or custom plugins that would put others at risk.
Repeated incidents
It keeps being the source of noisy neighbor events despite quotas and coaching.
Different risk appetite
It wants to upgrade fast while the others prefer stability, or the other way round.
Making the move painless
Moving a tenant to its own cluster means copying its topics and switching its clients. Replication tools such as MirrorMaker can copy data between clusters while both run. Prepare by making sure tenants use a bootstrap name they can change without code edits, keeping all configuration outside the code, and keeping the topic naming identical on both sides. Then a move becomes a scheduled, reversible operation.
Practice one migration early, with a small, friendly tenant. A rehearsed move is far calmer than the first one done under pressure.
23Performance and Scalability of a Shared Cluster
Multi-tenancy changes how you plan capacity. You are no longer sizing for one workload, but for the sum of many with unpredictable peaks.
Capacity is a portfolio
A single tenant might peak at ten times its average. But tenants rarely peak together, so a shared cluster can be smaller than the sum of every tenant’s worst case. This is the same math that lets airlines sell more seats than one plane could carry if everyone booked the same day. The gain is real, yet so is the risk: if peaks do line up, for example on a sales day, the cluster is caught short.
A city’s electricity grid is built for the moment the whole city switches on air conditioning at once, not for the sum of every house running everything at full power at the same instant. Grid planners study when homes peak, and how likely the peaks are to overlap.
How to plan
Measure each tenant’s average and peak
Use actual traffic graphs, not estimates from a form.
Find the combined peak
Add the tenants together over time, and look at the highest combined point, not the sum of individual highs.
Include replication and reads
Every message written is copied to followers, and often read by several consumers. Network use is a multiple of raw writes.
Keep headroom
Leave room to survive losing a broker. If one machine fails, the rest must carry its load.
Set quotas from the plan
Choose limits so that even if every tenant hit its limit, the cluster would survive.
Quota sum versus capacity
A strict approach is to make the sum of all tenant quotas fit inside cluster capacity, so nobody can overload it. That is safe but wasteful, because tenants rarely use their full limits. A looser approach oversubscribes: quotas add up to more than capacity, betting on staggered peaks. Pick your ratio deliberately, and watch the actual combined usage to see whether the bet is paying off.
Scaling out
When the cluster is full, add brokers. But new brokers start empty; Kafka does not automatically move existing partitions onto them. You must run a rebalance. Rebalancing itself uses network and disk, and can slow tenants while it runs. Throttle the data movement, schedule it for quiet hours, and move a little at a time.
24Availability, Blast Radius, and Failure Scenarios
On a shared cluster, some failures hit everyone at once. Understanding the blast radius helps you decide what to protect first.
The blast radius of a failure is how much of your system it damages. With a cluster per tenant, the blast radius of most failures is one tenant. With a shared cluster, a broker crash, a bad upgrade, or a full disk touches every tenant with data on it. Your isolation design tries to make the radius smaller.
Scenario: a broker runs out of disk
One tenant’s retention was longer than planned. A broker fills up and stops. Every tenant with partitions led from that broker sees failures until leaders move. Prevention: disk alerts with early thresholds, retention ceilings, and a rule to keep headroom. Recovery: free space by lowering retention on the biggest topic, then restore service and tell the affected owners.
Scenario: a poisoned upgrade
A platform upgrade contains a bug that only shows under certain traffic. Because all tenants share the version, all are exposed. Prevention: upgrade a small sandbox first, then a canary group of tolerant tenants, then everyone else in waves. Recovery: keep a proven rollback path.
Scenario: a leaked credential
One tenant’s credential is copied by an attacker. Prevention: short-lived credentials, narrow prefix ACLs, and quotas. With those in place, the attacker reaches only that tenant’s topics, and cannot flood the cluster. Recovery: disable the identity, issue a new one, and review audit logs.
Scenario: a runaway retry loop
A tenant’s bug retries failed writes without pause, producing millions of requests per second. Request and produce quotas throttle the tenant. Other tenants see little effect. The tenant’s own throttle metrics light up, and its owners are alerted.
Shared, tenant-independent protections
Replication
Keep three copies of important data across different failure zones, so one machine or zone loss loses nothing.
Minimum in-sync copies
Require writes to reach more than one copy before acknowledging, so a lone broker crash does not lose acknowledged data.
Staged rollouts
Change things in waves, small groups first, so mistakes stay small.
Runbooks and drills
Practiced responses to disk fill, broker loss, and credential leaks.
25Advantages, Disadvantages, and Trade-offs
A fair look at what sharing gives and what it takes away.
Advantages
- Lower cost through pooled hardware and shared spare capacity
- One platform team, one upgrade path, one monitoring setup
- Fast onboarding for new teams through self-service
- Easy sharing of data between teams, controlled by permissions
- Consistent security and standards across the company
- Better utilization, since tenants peak at different times
Disadvantages
- Noisy neighbors can hurt others without strong limits
- Larger blast radius when the cluster itself fails
- Isolation must be built and maintained by the platform team
- All tenants share upgrade timing and version choices
- Privacy is weaker unless clients encrypt on their own
- Complex governance, billing, and ownership tracking
The main trade-offs
Strict versus flexible quotas
Strict quotas protect neighbors but can slow a tenant during a legitimate spike. Flexible ones do the reverse.
Shared pool versus placement
Pinning tenants to brokers protects them but creates islands of unused capacity.
Convenience versus control
Letting tenants create topics freely is easy, yet loses the guardrails that a reviewed pipeline gives.
Cost versus blast radius
Each dedicated cluster shrinks the radius and raises the bill.
| Control | What it protects | Cost to run | Effort to set up |
|---|---|---|---|
| Naming plus prefixed ACLs | Data access | Very low | Low |
| Quotas | Shared throughput and CPU | Low | Low to medium |
| Topic policies and retention rules | Storage, partition counts | Low | Medium |
| Placement and pools | Physical resources | Medium | Medium to high |
| Client-side encryption | Data privacy | Medium | High |
| Dedicated cluster | Everything | High | Medium |
26Design Patterns and Anti-Patterns
Shapes that work, and shapes that look fine until they fail.
Patterns worth copying
Tenant prefix everywhere
One prefix on topics, groups, transactional IDs, subjects, and connectors, enforced by ACLs and automation.
Default quotas for all
New identities start with safe limits automatically. Raising them is a deliberate step.
Central topic creation
Automatic creation is off. Topics come from the pipeline with policy checks.
Pools by tier
General, priority, and sandbox pools, chosen at onboarding.
Tenant catalog
One place that lists every tenant, owner, identity, quota, and cost center.
Escape hatch
An easy path to move any tenant to a dedicated cluster.
Anti-patterns to avoid
What it looks like
Several teams share one login because it saved time during setup.
Why it hurts
You cannot apply separate quotas or access rules. Any incident is anonymous, and one leak exposes everyone.
Better approach
One identity per application, tied to a tenant in the catalog.
What it looks like
Quotas only on some tenants, or no defaults at all.
Why it hurts
The first unlimited tenant becomes the noisy neighbor, and the ones who got quotas suffer for it.
Better approach
A default quota at the top of the hierarchy so no one is ever unlimited by accident.
What it looks like
Prefix naming without prefix-based ACLs.
Why it hurts
The convention is only a suggestion. Any tenant can read or write any name.
Better approach
Let the ACLs enforce the naming rule, and let the pipeline generate them.
What it looks like
Production and test workloads on the same cluster.
Why it hurts
Load tests, replays, and experiments hit the same machines as customer traffic.
Better approach
A separate sandbox cluster with low limits and no promises.
What it looks like
A topic per customer, with dozens of partitions each, for thousands of customers.
Why it hurts
Partition counts explode, recovery slows, and the controller strains.
Better approach
Shared topics keyed by customer, with dedicated topics only for the largest customers.
27Best Practices and Common Mistakes
A checklist for building a shared cluster, followed by the mistakes that catch most teams the first time.
Before the first tenant arrives
Require login and encryption everywhere
Every client listener needs authentication and TLS. Turn off open access and the permissive no-rule setting.
Decide the naming convention
Cover topics, groups, transactional IDs, schema subjects, and connectors.
Set default quotas
Bandwidth, request, connection, and mutation limits, at the top of the hierarchy.
Turn off auto topic creation
Add topic policies for name, partitions, retention, and size.
Build the pipeline
Requests, reviews, checks, and automatic creation of identities, ACLs, quotas, and dashboards.
Create per-tenant monitoring
Traffic, throttling, storage, lag, and denials, all tagged by tenant.
Write the promises
Publish tiers, limits, support hours, and the process to request more.
Common mistakes
Adding isolation after the crisis
Quotas and naming are far easier to add on day one than after fifty tenants exist.
Forgetting per-broker enforcement
Bandwidth quotas apply per broker, so tenant totals can be a multiple of the number you set.
Ignoring consumer groups
Topics are locked down, yet group names are open, and tenants disturb each other’s reading.
Trusting client IDs
Client-chosen labels used for security are trivially faked.
Never testing the limits
Quotas that were never exercised may not behave as assumed when the real spike arrives.
Hand-edited clusters
Manual changes bypass reviews and drift away from the recorded state.
Onboard a friendly pilot team first. Watch its usage through peaks, deploys, and an incident. Fix what you learn, then open the doors to everyone else.
28Testing Isolation: Prove the Walls Hold
Isolation that has never been tested is a belief, not a fact. Try to break your own walls before someone else does.
| Test | What you do | What you expect |
|---|---|---|
| Cross-read attempt | Tenant A tries to read a topic of tenant B | Authorization error; topic name is hidden from listings |
| Cross-write attempt | Tenant A tries to write into B’s prefix | Authorization error |
| Group hijack | Use another tenant’s group name | Refused |
| Admin overreach | Tenant tries to delete or alter another’s topic | Refused |
| Write flood | Tenant A sends far above its quota | A is throttled; B’s latency stays steady |
| Read flood | Tenant A replays a huge backlog | A is throttled; B’s reads are steady |
| Topic creation storm | Script creates thousands of topics | Mutation quota or policy stops it |
| Storage growth | Fill a test topic past its budget | Alerts fire; policy or cleanup responds |
| Connection storm | Open many connections quickly | Connection limits hold the line |
| Broker loss | Stop one broker during load | All tenants keep working within their promise |
Run the tests as a regular habit
Do the cheap tests, such as access checks, automatically after every configuration change. Do the heavy ones, such as floods and broker loss, in a staging cluster on a schedule, or as planned game days in production for mature platforms. Record the results and keep them as evidence for audits and for tenants who ask, “how do I know I am safe?”
Test with real-looking traffic. A flood of tiny messages behaves differently from a flood of huge ones, and a quota tuned for one may not protect against the other.
29A Worked Example: A Retail Platform Grows Up
A made-up story to tie everything together. The company, Fabrikam Retail, and its teams are fictional.
Fabrikam Retail starts with one Kafka cluster used by a single team. Within a year, eight teams want to use it: orders, payments, inventory, search, fraud, marketing, analytics, and a data science group. Here is how the platform team turns the single cluster into a safe shared platform.
Lock the doors
They require login and encryption for all clients, and turn off the setting that allows access when no rule exists. Each team gets an identity per application. A tenant catalog records every identity and its owner.
Choose the naming
Topic names follow a pattern starting with the team name. Groups and transactional IDs use the same first part.
Write prefix rules
Each team’s identities get allow rules on their own prefix for topics and groups. Cross-team reading is granted by explicit rules on named topics, approved by the owning team.
Set default quotas
Every identity starts with moderate produce, fetch, and request limits, and a low topic-creation rate.
Turn off auto creation
Topics are created only via the pipeline, with a policy capping partitions and retention.
Meet the first incident
The data science team replays six months of orders. Payments sees slow writes. Dashboards show the replay’s fetch rate on two brokers. The platform team lowers the fetch quota for data science, the incident ends in minutes, and a new rule is added: big replays are scheduled and announced.
Create tiers
Payments and orders, whose outages cost real money, move to a priority pool of lightly loaded brokers. Analytics and data science stay in the general pool. A separate sandbox cluster is created for experiments.
Add showback
Monthly reports show each team’s traffic, storage, and partition use. Marketing discovers three unused topics and removes them. Storage growth slows.
Promote a tenant
When Fabrikam opens a new region with a legal need to keep data local, the platform builds a dedicated cluster there. Because clients use a configurable bootstrap address and naming is identical, orders move over with MirrorMaker during a planned window.
What the story teaches
Start with identity and naming
Almost every later control depends on them.
Defaults beat exceptions
Default quotas prevented the second incident, because they applied automatically to new teams.
Visibility changes behavior
Usage reports helped teams tidy up without any new rules.
Keep the escape hatch open
Because moves between clusters were designed in from the start, the legal need was met with a plan, not a panic.
30Real-World Usage Patterns
How organizations of different shapes typically run shared Kafka. These are common industry patterns, described in general terms, not claims about any one company’s private setup.
Internal platform for a large company
A central platform team runs a small number of big shared clusters for the whole company, sometimes one per region or per environment. Product teams are tenants. The platform team provides a self-service portal, standard client libraries, default quotas, and cost reports. Large operators such as LinkedIn, Uber, and Netflix are known to run Kafka at very large scale for many internal teams, and they share a common lesson: automation and defaults matter more than heroics.
Software-as-a-service provider
A company that sells a product to thousands of business customers often keeps customers in shared topics, with a customer ID in each message. Large or regulated customers get dedicated topics, or dedicated clusters. Customers never connect to Kafka directly. Instead, the company’s own services stand between them and Kafka, which keeps identity and limits under the company’s control.
Managed Kafka services
Cloud and managed Kafka offerings typically let you create separate clusters quickly, and some offer ways to group workloads. Their pricing often nudges you toward several smaller clusters instead of one huge one. Many companies mix the two: a managed cluster per environment and per major domain, with multi-tenant controls inside each.
Federation of many clusters
Some large operators put a thin layer in front of many physical clusters, so tenants see one logical service while the platform spreads them across clusters. This lets the platform move tenants between clusters without tenants noticing, and keeps each cluster small enough to manage comfortably.
Data mesh and domain ownership
In a data mesh style, each business domain owns its data as a product and shares it with others through Kafka topics. The tenant model fits naturally: each domain is a tenant that owns a prefix, publishes read-only topics for consumers, and is responsible for quality and cost. Sharing between tenants happens through explicit, reviewed read permissions.
31Quick Glossary
Every important word from this guide in one place.
| Term | Plain meaning |
|---|---|
| ACL | A rule saying which principal may do which action on which resource |
| Blast radius | How much a failure damages |
| Broker | A Kafka server that stores and serves events |
| Chargeback | Billing tenants for what they use |
| Client ID | A free-text label a client announces about itself |
| Consumer group | A team of consumers sharing the reading of a topic |
| Controller | The part of the cluster that tracks partition ownership and handles changes |
| Isolation | Keeping one tenant from affecting or seeing another |
| KRaft | Kafka’s built-in controller quorum, replacing an external coordination service |
| Mutation quota | A limit on how fast topics and partitions may be created or removed |
| Noisy neighbor | A tenant whose heavy use harms others |
| Offset | A consumer group’s saved position in a partition |
| Partition | An ordered log that holds part of a topic |
| Placement | Choosing which brokers hold a tenant’s data |
| Prefix rule | An access rule that matches every name starting with given text |
| Principal | The name Kafka uses for an authenticated client |
| Quota | A per-second limit on a shared resource |
| Replication factor | How many copies of each partition exist |
| Retention | How long or how much data a topic keeps |
| Showback | Showing tenants what they use and what it costs |
| Super user | An identity that skips all access checks |
| Tenant | A group treated as one unit for isolation, billing, and ownership |
| Throttle time | How long a broker delayed a reply because a client was over quota |
| Tiered storage | Keeping older data on cheaper remote storage |
| Topic | A named channel for events |
32Frequently Asked Questions
Short, direct answers to questions people ask most often.
33Summary and Key Takeaways
You now have the full picture of running many tenants on one Kafka cluster without letting them hurt each other.
Sharing a Kafka cluster saves money and effort, but only if each tenant is protected from the others. Protection comes in layers: identity, access, naming, traffic limits, storage limits, placement, and visibility. Each layer covers a gap the others leave open. Automation applies them consistently, monitoring proves they work, and an easy path to a dedicated cluster handles the tenants who outgrow sharing.
Key Takeaways
- Isolation is a stack of layers. Identity, access, naming, quotas, storage rules, placement, and visibility each close a different gap.
- Start with identity and naming. One login per application and a tenant prefix on everything make every other control simple.
- Enforce naming with prefix ACLs and keep the default of no access when no rule exists.
- Set default quotas for everyone. Bandwidth, request, connection, and mutation limits stop noisy neighbors, and remember they apply per broker.
- Guard storage and partitions with retention ceilings, topic policies, and alerts, because Kafka has no simple per-tenant disk cap.
- Automate and measure. A self-service pipeline, configuration in version control, and per-tenant dashboards keep isolation real and auditable.
- Plan the escape hatch. Tiers, pools, and easy moves to a dedicated cluster let the platform stay fair as tenants grow.