Home/Labs/Data Tier Composer
All 280 Labs
INTERACTIVE LAB🏗️

Polyglot Persistence Data Tier Lab (Interactive)

Sweep traffic mix and total RPS to compose the optimal six-engine data tier or crash the Postgres monolith. Assign ACID, cache, log, search, wide-column, and blob workloads to their engines, then break the CDC glue to feel eventual consistency.

Polyglot Data Tier Composer

Route a mixed workload to one relational database or six specialized engines and watch capacity math decide.

Checkout / orders → PostgreSQL (ACID)9,000 rps · util 60% · 10.9 ms
Sessions & carts → Redis (in-memory)27,000 rps · util 27% · 0.5 ms
Catalog search → Elasticsearch (inverted)12,000 rps · util 48% · 19.3 ms
Telemetry writes → Cassandra (wide-column)9,000 rps · util 5% · 4.1 ms
Image / video blobs → S3 (object store)3,000 rps · util 10% · 47.7 ms

Blended avg latency

8.7 ms

Infra cost / month

$1,350

right-sized engines

Search freshness (eventual)

~120 ms

Every engine is within capacity. Break the CDC pipeline to see the polyglot tax: search results drift toward eventual consistency until Debezium resumes from its Kafka offset.

Polyglot persistence matches each access pattern to its mathematically optimal engine: ACID rows, O(1) RAM keys, append-only partitioned logs, inverted-index relevance, time-ordered wide columns, immutable blobs — glued by log-based CDC so the application never dual-writes.

How It Works Under the Hood

One storage engine cannot win five access patterns: PostgreSQL guarantees transactions, Redis serves sub-millisecond ephemeral state, Kafka orders append-only streams, Elasticsearch scores relevance from inverted indexes, Cassandra absorbs million-write telemetry floods, and S3 stores immutable blobs cheaply. Polyglot persistence composes them deliberately, gluing tiers together with log-based CDC, Debezium streaming the WAL into Kafka topics that refresh search, cache, and warehouse eventually but durably, while the application commits to exactly one atomic source of truth.

Core Architectural Principles

  • Each tier is provisioned to its access pattern, so saturation is per-engine not system-wide.
  • CDC plus Kafka replaces dual-writes with replayable eventual consistency across copies.
  • Cost falls by right-sizing: RAM only for hot keys, petabytes only in cheap object storage.
Interview Round Script

Close every system design with this blueprint: name each store, justify it against its access pattern, then explain synchronization, single-writer into Postgres, Debezium to Kafka, consumers updating search and cache. Proactively address the tax: cross-store queries need API composition, and consistency windows must be stated, not hidden behind the word eventually.

Key Trade-Offs

Mathematically matched engines and independent scaling versus replication pipelines and the end of single-transaction global consistency.

Related Curriculum Chapter

Polyglot Persistence: Composing the Modern Data Tier

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs