To keep serving pipelines predictable under bursty prompts, <5ms p99), separate the hot Redis serving plane from the immutable Iceberg history plane, connected by a single declarative Flink/Spark registry.
TL;DR30-second simplified summary▾
To serve 100K QPS under 5ms p99, pack feature views into single Protobuf Redis keys, shield hot keys with a 500ms L1 cache, and enforce 3.5ms circuit-breaker timeouts.
Offline, bucketed Iceberg tables enable shuffle-free ASOF joins with bounded lookback windows.
Requirements & Capacity Envelope.
Why this matters: Quantify QPS, payload sizes, Redis RAM footprint, and offline storage growth.
At 100K QPS with 50 features per entity (~400 bytes Protobuf), online egress is 40 MB/s.
Storing 100M active entities requires ~40 GB raw data (~120 GB with Redis Cluster overhead and replication), easily fitting in a 6-shard RAM cluster.
100K QPS Online & PB-Scale Offline Sizing
1.Memory Budget: 100M entities x 400B x 2x replication + 35% overhead = ~100 GB RAM.
2.Workload Isolation: Training scans never touch Redis; they read Zstd-compressed Iceberg.
Back-of-the-envelope sizing confirms 100M active entities fit in a modest 6-shard Redis Cluster.
High-Level Dual-Plane Architecture.
Why this matters: Connect Kafka streams and batch lakes to online Redis and offline Iceberg.
Think of High-Level Dual-Plane Architecture as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Connect Kafka streams and batch lakes to online Redis and offline Iceberg.
Kafka ingests real-time domain events while S3/GCS holds batch tables. Flink runs stateful sliding-window aggregations and writes to a Dual-Sink Materializer: Redis Cluster for real-time inference and Apache Iceberg for point-in-time historical storage.
Dual-Plane Feature Store Architecture
1.Single Compute Path: Flink Kappa-style processing handles both real-time and replay streams.
2.Typed Contracts: Protobuf schemas enforce strict type compatibility across producers and consumers.
A unified Flink materializer feeds both the low-latency Redis online plane and the Iceberg offline plane.
- Problem
- How to implement Design an Enterprise ML Feature Store (100K QPS, <5ms p99) without hitting unbounded tail latency, state divergence, or operational fragility.
- Naive Solution
- Use a single unpartitioned path with unbounded retries and synchronous global coordination.
- Why It Fails
- Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
- Alternatives
- Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
- Engineering Decision
- To keep serving pipelines predictable under bursty prompts, <5ms p99), separate the hot Redis serving plane from the immutable Iceberg history plane, connected by a single declarative Flink/Spark registry.
- Trade-Offs
- Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
When Design an Enterprise ML Feature Store (100K QPS, <5ms p99) experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
Point-in-Time Training Set Generation.
Why this matters: Execute scalable ASOF joins across petabytes of Iceberg snapshots.
Think of Point-in-Time Training Set Generation as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Execute scalable ASOF joins across petabytes of Iceberg snapshots.
Naively joining 100M labels with 50B feature rows causes a massive shuffle. Partitioning both tables by entity_id hash bucket and event date, and performing a Spark sort-merge ASOF join with a bounded 30-day lookback window reduces shuffle I/O by 90%.
Bucketed Sort-Merge ASOF Join in Spark
1.Co-Located Bucketing: Matching Iceberg bucket counts on entity_id eliminates wide Spark shuffles.
2.Bounded Lookback: A 30-day TTL window prevents scanning years of cold partitions.
Bucketed Iceberg tables and bounded lookback windows make petabyte ASOF joins fast and cheap.
Online Serving, Caching & Circuit Breakers.
Why this matters: Guarantee <5ms p99 inference latency even during Redis node failovers.
Think of Online Serving, Caching & Circuit Breakers as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Guarantee <5ms p99 inference latency even during Redis node failovers.
The Real-Time Inference API batches multi-entity lookups into pipelined Redis MGETs with a strict 3.5ms socket timeout. A local Caffeine L1 cache absorbs hot-key spikes (e.g., viral merchants), and a circuit breaker falls back to default feature medians if Redis errors exceed 1%.
Multi-Tier Online Serving with Circuit Breaker
1.Hot-Key Protection: 500ms L1 caching prevents single viral entities from saturating one Redis shard.
2.Fast Failover: 3.5ms timeouts protect upstream checkout/bidding SLAs.
L1 caching and circuit-breaker fallbacks keep online feature reads under 5ms p99.
Flink Stateful Sliding Windows & Late Events.
Why this matters: Handle out-of-order mobile telemetry without corrupting real-time counters.
Think of Flink Stateful Sliding Windows & Late Events as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Handle out-of-order mobile telemetry without corrupting real-time counters.
Mobile events often arrive 30–120 seconds late. Flink uses event-time watermarks with a 2-minute allowed lateness window in RocksDB, emitting updated aggregates to Redis while routing events beyond 2 minutes to a side-output for offline Iceberg correction.
Event-Time Watermarks & Late-Data Side Output
1.RocksDB Spillover: Disk-backed RocksDB state supports 100M+ active window keys without JVM OOM.
2.Side-Output Repair: Ultra-late events still land in Iceberg for accurate offline training.
Event-time watermarks and side-outputs balance real-time accuracy with offline completeness.
Feature Drift Monitoring & Automated Remediation.
Why this matters: Detect distribution shifts and stale pipelines before model accuracy collapses.
Think of Feature Drift Monitoring & Automated Remediation as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Detect distribution shifts and stale pipelines before model accuracy collapses.
A Feature Drift Monitor computes hourly Population Stability Index (PSI) and null-rate checks on 1% sampled serving vectors. If a Flink job lags or a feature's null rate spikes above 5%, automated alerts fire and the Inference API shifts traffic to a fallback baseline model.
Drift Monitor & Automated Model Fallback
1.Multi-Signal Health: Combine PSI drift, null-rate spikes, and Kafka consumer lag.
2.Safe Fallback: Routing to a simpler model without the broken feature preserves revenue.
Automated drift detection pairs statistical PSI checks with instant fallback routing.
Multi-Tenant Isolation & Backfill Throttling.
Why this matters: Prevent massive historical backfills from saturating live online Redis shards.
Think of Multi-Tenant Isolation & Backfill Throttling as the intuition layer for Design an Enterprise ML Feature Store (100K QPS, <5ms p99): Prevent massive historical backfills from saturating live online Redis shards.
When teams backfill 90 days of features into Redis, naive writes can trigger 500K+ write OPS and spike p99 read latency. Token-bucket rate limiters throttle backfill writers based on live Redis CPU/latency headroom, pausing automatically if read p99 crosses 3ms.
Adaptive Backfill Throttling on Live Redis
1.Read-Priority QoS: Live inference reads always preempt background backfill writes.
2.Dedicated Bulk Pipeline: Use Redis RDB/snapshot pre-warming for >100M key initial loads.
Adaptive token-bucket throttling protects live inference SLAs during heavy feature backfills.
Practice: Make the trade-off yourself.
You need to backfill 100M historical user feature vectors into the live Redis Cluster serving 100K QPS at <5ms p99. What is the safest way to avoid degrading live inference?