Home/Labs/Federation Blast Radius
All 280 Labs
INTERACTIVE LAB🏛️

Database Federation (Functional Partitioning) Lab (Interactive)

Deploy a runaway analytics report against a monolith versus domain-federated databases and watch who dies. Split Users, Orders, Billing, and Analytics into bounded-context databases, then measure blast radius, join cost, and PCI scope.

Monolith Database vs Federated Domains

Split Users / Orders / Billing / Catalog into domain databases, then detonate a runaway analytics report.

Users DB

2 active conns

Orders DB

12 active conns

Billing DB

4 active conns

Analytics DB

4 active conns

Checkout p99

19 ms

includes +4ms app-level join

Checkout blocked

0%

Blast radius

none

PCI scope

Billing DB only

JOIN FEASIBILITY:SELECT * FROM orders JOIN users — impossible across servers. Router rewrites it as: orders DB lookup → gRPC fan-out to Users service (+4ms) → response merge. Analytics cross-domain reports run in the CDC-synced warehouse instead.

Federation is the first scaling step before sharding: hardware specialization per domain, independent schema evolution, compliance containment, and a bounded blast radius. The price is lost foreign keys and joins — replaced by application-level enrichment, denormalization, and FDW/warehouse sync.

How It Works Under the Hood

Database federation partitions by business domain, each team owning its schema, connection pool, and hardware profile: memory-heavy replicas for catalog reads, NVMe write tuning for orders, columnar stores for analytics. Sharing one monolithic pool couples every workload, so a runaway report can exhaust connections and starve checkout. The cost is relational: foreign keys and cross-domain JOINs vanish, replaced by application-level enrichment calls, denormalized payloads, and CDC-fed warehouses, while compliance shrinks to the billing database alone.

Core Architectural Principles

  • Per-domain connection pools bound failure blast radius to one bounded context.
  • Cross-domain joins become API composition or embedded denormalized copies with measurable added latency.
  • Compliance audits shrink to the PCI-scoped billing cluster instead of the entire fleet.
Interview Round Script

Present federation as the step before sharding: "Before splitting rows across servers, I split tables across domains to isolate blast radius and tune hardware per access pattern." Then show the price honestly: no cross-database joins, so order pages fetch user data via service call or denormalized snapshot, and analytics reads a CDC-synced replica.

Key Trade-Offs

Domain ownership, specialized hardware, and containment versus lost joins, foreign keys, and saga-based distributed transactions.

Related Curriculum Chapter

Database Federation (Functional Partitioning)

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs