# Multi-Tenancy: Cost vs Isolation

Page title: Multi-Tenancy — Isolation vs Cost

> Interactive explorer for multi-tenant CDC: isolation levels, topic strategy, consumer groups, and egress sizing with shareable presets.

Canonical page: <https://sandgraal.github.io/letstalkcdc/multi-tenancy/>

Model isolation levels, topic strategies, and egress math for shared CDC platforms. See how per-tenant choices affect blast radius, spend, and operations.

Start with the Primer Tweak Isolation Controls

## Primer: Why multi-tenancy matters for CDC

Sharing infrastructure saves money but couples tenants together. More isolation (per-tenant topics or clusters) reduces blast radius and gives clearer SLAs, but increases cost and operational load.

- Isolation ladder: shared topics → per-tenant topics → per-tenant clusters.
- Egress (external) ≈ `tenants × change_rate × (payload + envelope + overhead)`. Broker egress adds replication factor: `intra_broker ≈ external × (RF − 1)`.
- Storage at retention ≈ `egress_bytes_per_s × (86400 × days) ÷ compression`.
- Operational heat: total partitions = `topics × partitions_per_topic` (impacts rebalances, ISR, & quotas).
- RBAC/retention easier per-tenant topics; cluster isolation for regulators/VIPs.
- Guardrails: per-tenant *produce/consume* quotas, DLQ policy, retention/compaction per topic, and ACLs scoped by tenant namespace.

****Rule-of-thumb cutovers****

- ↑ tenants & low compliance ⇒ shared topics until ops pain shows.
- ↑ compliance / RBAC / per-tenant SLAs ⇒ per-tenant topics.
- Regulatory isolation / VIPs / heavy tenants ⇒ per-tenant clusters.

Use the controls to explore topic counts, consumer groups, egress, and agent footprint.

### 1. Adjust Your Scenario

## Controls

Tenants 10 Independent customers served. Change rate (events/s/tenant) 100 Avg payload (bytes) 500 Envelope overhead (bytes) ? Headers, schema IDs, metadata. Typical 200–400B for JSON/Avro. 300 Topics per tenant (per service) ? outbox, status, DLQ, metadata… Adjust to your design. 6 Shared topics (if shared mode) 6 Isolation model Shared = cheapest; Topics = simpler RBAC; Clusters = strongest isolation. Replication factor (RF) 3 Partitions per topic 6 Retention (days) 7 Compression ratio 2.0

### 2. See the Impact

### Total Topics

—

Shared: fixed; per-tenant: `tenants × topics_per_tenant`.

### Consumer Groups

—

≈ tenants × `GROUPS_PER_TENANT`.

### Egress (MB/s)

—

Decimal MB (bytes ÷ 1e6).

### Broker Egress (MB/s)

—

≈ external × (RF − 1).

### Egress (GB/month)

—

60×60×24×30 seconds.

### Total Partitions

—

topics × partitions_per_topic.

### Storage @ Retention (TB)

—

egress × days ÷ compression (RF included).

### Connector Footprint

—

Per-cluster ≈ 1:1; others scale with tenants.

This index is a first-order illustration: *egress (MB/s) + connector footprint (+ topic management)*. Tune constants to your platform.

****How we estimate****

- `egress_bytes_per_s` = `tenants × change_rate × (payload + envelope + overhead)`
- `broker_egress_bytes_per_s` ≈ `egress_bytes_per_s × (RF − 1)`
- `consumer_groups` ≈ `tenants × GROUPS_PER_TENANT`
- Topics:
  - *Shared*: `shared_topics`
  - *Per-tenant topics*: `tenants × topics_per_tenant`
  - *Per-tenant clusters*: total topics = `tenants × topics_per_tenant`
- `total_partitions` = `topics × partitions_per_topic`
- `storage_bytes_at_retention` ≈ `(egress_bytes_per_s × RF × 86400 × days) ÷ compression`

****Assumptions & levers****

- Consumer groups factor `GROUPS_PER_TENANT` (default 2).
- Connector footprint: shared/per-topic ≈ tenants × 0.2; per-cluster ≈ 1:1.
- Envelope defaults for JSON/Avro headers (200–400B typical) + small per-message overhead.
- If topics are *compact*, long-term storage is dominated by latest keys; adjust retention math accordingly.
- Per-tenant quotas should scale with `change_rate` and protect shared clusters from spikes.
- RBAC/retention overhead grows with topic count, not egress.

****Decision helper (rule-of-thumb thresholds)****

- *Shared topics* until: topics ≤ ~50, low compliance, dup-tolerant consumers.
- *Per-tenant topics* when: per-tenant RBAC/retention, > ~50 topics total, noisy neighbors.
- *Per-tenant clusters* when: regulated isolation, VIPs, or tenant egress ≥ ~10% of fleet.

Heuristics; validate with SRE/Compliance.

## FAQ — multi-tenant CDC

**Do per-tenant topics improve security?**

Yes—RBAC is simpler and audits map to tenants, but cost/metadata overhead rises. If regulators require isolation, consider cluster boundaries.

**Will per-tenant clusters always cost more?**

Typically yes (1:1 footprint), but noisy tenants stop taxing others and maintenance windows become tenant-scoped.

**Should I use compaction or time retention for per-tenant topics?**

Compaction keeps latest value per key (great for [upsert](https://sandgraal.github.io/letstalkcdc/glossary/#upsert) sinks); time retention keeps history (needed for replays and [backfills](https://sandgraal.github.io/letstalkcdc/glossary/#backfill)). Many teams use *compacted + short retention* together.

**How do I fence noisy tenants?**

Apply per-tenant quotas (produce/consume), isolate DLQs per tenant, and consider per-tenant topics or clusters when a tenant’s egress approaches ~10% of fleet.

### Multi-Tenancy Knowledge Check

Test your understanding of tenant isolation strategies and operational trade-offs.

Q1

#### What is the key trade-off when choosing between shared and dedicated topics per tenant in a CDC platform?

A Shared topics are always faster than dedicated topics

B Shared topics reduce operational complexity but increase blast radius; dedicated topics provide isolation at higher operational cost

C Dedicated topics can't handle high throughput

D Shared topics don't support partitioning

Q2

#### What does 'blast radius' mean in the context of multi-tenant CDC systems?

A The physical distance data travels across networks

B The scope of impact when one tenant's workload or failure affects other tenants

C The size of log files generated

D The number of databases being replicated

Q3

#### Why might you use topic prefixes or namespaces for multi-tenant CDC?

A To make topic names longer and more descriptive

B To organize topics by tenant for easier management, monitoring, and ACL application

C Topic prefixes are required by Kafka

D To avoid using partition keys

Q4

#### What is a common challenge when estimating egress costs in a multi-tenant CDC platform?

A Egress is always free in CDC systems

B Different tenants have varying change volumes and destinations, making cost unpredictable

C Egress only applies to batch systems

D CDC doesn't produce any network egress

Q5

#### What role do Kafka quotas play in multi-tenant CDC platforms?

A Quotas are not supported in Kafka

B Quotas limit per-client throughput or request rates to prevent one tenant from starving others

C Quotas increase throughput for all clients

D Quotas are only used for authentication

**0/5** correct

---

CDC: The Missing Manual by Christopher Ennis (Let's Talk CDC), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attribution is required.
