Scrivio Interview library
DesignAdvanced6 min read · updated 13 November 2026

One shared Kafka cluster holds 9,000 topics for 70 teams in four business domains. Teams read each other's internal topics, so any schema change in one domain breaks consumers in others, and one domain's load test slowed the whole company.

Design an event architecture with clear domain boundaries, and explain what each team gains and pays.

Split events into private topics, internal to one domain and free to change, and public topics, published domain events with versioned contracts, compatibility checks and named owners. Give each domain its own cluster or isolated tenancy for private topics, expose public topics on a shared layer fed by replication or direct production, and enforce with ACLs that other domains read only public topics and translate them at their own boundary. Name public topics <domain>.<entity>.<event>.v<n> and list each in a catalogue; teams pay with replication latency, more clusters and design work for public events, and gain changes and load tests that no longer spread across the company.

Why this question is asked

A single shared Kafka cluster is how most companies start, and for a while it works well: any team can read any topic, and integration is fast. At 9,000 topics and 70 teams, that openness has become the problem. Internal topics have turned into accidental public APIs, and the cluster has become a shared failure domain. Interviewers ask this design question to see whether we can apply domain boundaries, a concept from domain-driven design, to event infrastructure, and whether we are honest about what the change costs. In this answer, we will recap the idea of a bounded context, split topics into private and public, design the cluster layout, enforce the boundary, set up naming and a catalogue, and weigh the gains and costs.

1A Quick Recap: Domains and Contracts

A domain, or bounded context, is a part of the business with its own model and language: orders, payments, logistics, customer. Inside a domain, teams change their model freely as they learn. Between domains, they agree on a smaller, stable contract. The trouble in this company is that there is no line between the two. When the logistics domain reads the orders domain's internal topic order-state-machine-transitions, every internal change in orders becomes a breaking change for logistics.

The second problem is shared fate. One cluster means one set of brokers, disks and network links, so a load test in one domain filled request queues and slowed produce latency for everyone. The design must fix both: contracts between domains and isolation of their load.

2Private and Public Topics

The core idea is to classify every topic. A private topic is internal to one domain: its schema can change whenever the owning teams agree, it may carry internal states and technical fields, and nobody outside the domain reads it. A public topic carries published domain events, facts that the domain promises to others, such as orders.order.placed.v1. A public topic has a versioned schema registered with a compatibility mode such as BACKWARD or FULL, a named owning team, a documented meaning and an SLO for availability and latency.

A domain publishes a public event by translating from its private model, often in a small service or Kafka Streams application that reads private topics and writes public ones. That translation layer is where the domain absorbs its own internal changes, so consumers never see them. Most of the 9,000 topics will turn out to be private; the public set is typically a few hundred.

3Cluster Layout

Each domain gets its own cluster for private topics, or, where running many clusters is too costly, isolated tenancy on a shared cluster with quotas per domain. A dedicated cluster gives the strongest isolation: the logistics load test now only affects logistics brokers.

Public topics live on a shared layer that every domain can read. There are two ways to fill it. The domain can replicate its public topics from its own cluster with MirrorMaker 2 or a vendor's cluster linking feature, which keeps the domain's producers local but adds replication lag. Or the domain's translation service can produce directly to the shared layer, which avoids replication but makes the domain depend on the shared cluster for publishing. Many companies use replication for high-volume topics and direct production for the rest.

Step throughEvent architecture with domain boundaries
  1. Consuming domainsread only public topics, translate at their boundary
  2. Shared public layerdomain.entity.event.vN topics, ACL-protected
  3. Replication or direct productionMirrorMaker 2, cluster linking, or translation service
  4. Domain translation servicesprivate model -> public contract
  5. Domain clustersprivate topics, free to change, own load

5 layers, from the top down. Step through them one at a time.

Each domain keeps its internal topics and load to itself and publishes a deliberate contract.

4Enforcing the Boundary

A boundary that is only documented will erode, so we enforce it with ACLs. Principals from outside a domain receive read access only to public topics, and only through a request that registers the consumer in the catalogue. Private topics grant access only to the domain's own principals.

When a domain needs another's data, it reads the public event and translates it into its own model at its edge, an anti-corruption layer in domain-driven design terms. Logistics, for example, reads orders.order.placed.v1 and builds its own Shipment request from it, rather than spreading the orders schema through its code. If logistics needs something the public event does not contain, it asks the orders domain to add it to the contract, which turns an accidental dependency into a deliberate one.

5Naming and the Catalogue

Public topics follow one pattern, <domain>.<entity>.<event>.v<n>, for example payments.payment.captured.v2. The version changes only for a breaking change, which is published as a new topic alongside the old one, with a deprecation date for the old version. Private topics use a different prefix, such as orders.internal.*, so tools and people can tell them apart at a glance.

Each public topic is listed in a catalogue with its owner, schema link, meaning, SLO and known consumers. AsyncAPI documents are a common format for this. The known-consumer list comes from ACL grants and consumer group metadata, so it stays accurate.

Private against public topics
PropertyPrivate topicPublic topic
Who readsOwning domain onlyAny domain, via ACL request
Schema changesWhenever the domain agreesCompatible, or new version
Owner and SLODomain teamsNamed team, published SLO
Nameorders.internal.*orders.order.placed.v1
WhereDomain clusterShared public layer

6What Each Team Gains and Pays

Teams gain the ability to change their internal models without coordinating with the whole company, and protection from other domains' load: a load test or a runaway producer now hurts only its own domain. Consumers gain stable, documented contracts with an owner to call.

They pay, too. Public topics that are replicated cost extra storage and add replication lag, typically seconds; consumers that needed sub-second freshness from another domain must either accept that or use direct production. The platform runs four or five clusters instead of one, with more monitoring and upgrades. And domains must spend design effort on public events, which is real work: deciding what to promise is harder than exposing whatever exists. A migration also takes time; we would move the most-read internal topics first, publishing public versions and moving consumers to them with a deadline before closing private access.

7Follow-up questions

Should every domain get its own cluster?

Not necessarily. Large or noisy domains benefit most from their own cluster. Small domains can share one with quotas per principal and separate prefixes, and move out later if their load grows. The boundary is logical first; physical isolation is applied where load or risk justifies it.

How do you migrate consumers off internal topics?

Inventory who reads each internal topic, publish a public event that covers their needs, help them move, and set a date after which ACLs for the internal topic are removed. Start with the topics that cause the most breakage.

What compatibility mode would you choose for public topics?

BACKWARD at minimum, so new consumers can read old data and producers can add optional fields; FULL or FULL_TRANSITIVE when consumers upgrade on their own schedule and old records stay in the topic for a long time.

8Conclusion

In this answer, we split topics into private ones, free to change inside a domain, and public ones, versioned contracts with owners, SLOs and compatibility checks. We gave each domain its own cluster or tenancy for private topics, a shared public layer filled by replication or direct production, ACLs that keep other domains on public topics, translation at each boundary, and a naming pattern with a catalogue. The cost is replication latency, more clusters and design work for public events; the gain is that one domain's changes and load no longer break or slow the others.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start by splitting events into two kinds. Private topics are internal to one domain and free to change. Public topics carry published domain events with versioned schemas, compatibility checks, a named owner and an SLO.

Then, if they want more

Most of the 9,000 topics will be private. Then I would give each domain its own cluster, or isolated tenancy with quotas for smaller domains, so a load test only hurts its own domain.

Public topics go to a shared layer, either replicated from the domain cluster with MirrorMaker 2 or a vendor's linking feature, or produced there directly by the domain's translation service.

ACLs enforce the boundary: other domains can read only public topics, and a domain that needs another's data translates it into its own model at its edge instead of depending on internal shapes. Public topics follow a name like domain.entity.event.v1, and each is in a catalogue with owner, schema, SLO and known consumers taken from ACLs and group metadata.

Teams pay with replication latency and storage for public topics, more clusters to run, and real design work deciding what to promise. In return, a domain can change its internals and run load tests without breaking or slowing everybody else.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Kafka documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Design an event architecture with clear domain boundaries, and explain what each team...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-design/ac07fe876a/