DBRaven
Full ReviewModerate Readinessdraft

Architecture Review: ML Feature Serving Platform

A low-latency feature serving platform for ML model inference, providing both batch (offline) and real-time (online) feature access with strict training-serving consistency. Redis serves the hot feature cache with p99 latency targets below 5ms for online inference requests; PostgreSQL provides point-in-time feature lookups for offline training jobs with temporal consistency guarantees; Cassandra stores high-cardinality feature entities at write scale beyond PostgreSQL's single-primary ceiling; Kafka streams feature computation events from online feature pipelines to update the cache; Qdrant stores vector features for embedding-based model inputs and similarity lookups; ClickHouse serves feature analytics and drift monitoring across training dataset populations. Feature versioning is first-class: every feature value is tagged with a pipeline_version and computed_at timestamp to support model reproducibility and training-serving skew diagnosis.

Evidence Confidence

Moderate

strong

Executive Summary

ML Feature Serving Platform: moderate operational readiness (82% evidence confidence). 0 architectural strengths identified, 6 operational risks to manage. Primary concern: Cache Stampede (Dog-Pile). Requires Advanced operational maturity.

Readiness Rationale

Overall moderate readiness across 8 dimensions. Limited: team maturity. Strong: migration, observability, failure recovery.

Key Concerns

  • !Cache Stampede (Dog-Pile)
  • !Embedding Drift

Key Strengths

  • +Architecture is well-defined for the ai rag application problem profile

8

Assessments

3

Tradeoffs

6

Sections

11

Recommendations

Readiness Assessments

8

Architectural Tradeoffs

3

Recommendations

11
High

Monitor: Embedding Drift

risk_monitoring

Vector embeddings become semantically stale when source document content changes but the stored embedding is not regenerated: causing semantic search and RAG retrieval to return outdated, incorrect, or misleading results without any error signal, silently degrading the quality of AI-backed features.

Affects 3 nodes. (AI Embedding Lookup, Qdrant, Vector Similarity Search)

High

Monitor: Cache Stampede (Dog-Pile)

risk_monitoring

When a widely-shared cached value expires or is invalidated, all concurrent requests that miss simultaneously trigger identical expensive database queries, overwhelming the origin store before any single result can be computed and cached: a positive feedback loop that can collapse the database within seconds.

Affects 1 node. (Read-Heavy API Backend)

High

Implement: Monitor generic risk probe signals

observability

Seed 'Embedding Drift Risk Probe' identifies 2 metrics relevant to embedding_drift.

Metrics to instrument: error_rate, p95_latency_ms

Moderate

Features computed inline in the inference service with no shared feature store → Centralized feature store with Redis cache and Cassandra backing store

migration_planning

Trigger: Feature computation logic duplicated across 3+ model serving services with no coordination; training-serving skew discovered after model deployment causing unexplained model performance regression; feature computation latency dominating inference latency for complex features; inability to enforce feature versioning across model versions. Migrate from 'Features computed inline in the inference service with no shared feature store' to 'Centralized feature store with Redis cache and Cassandra backing store'. Identify the 10 most reused features across models and migrate those first. Validate that feature values from the central store match inline-computed values before migrating any model serving path to use the store.

Initial feature store population requires backfilling historical feature values for all entity IDs: backfill jobs must be idempotent and resumable to handle interruptions; Migrating from inline computation to feature store lookups requires model serving code changes across all inference services simultaneously or a dual-lookup period

Moderate

Latest-value-only feature store with no temporal history → Point-in-time feature store with training-time lookup support

migration_planning

Trigger: Regulatory or reproducibility requirement to re-run model predictions at a historical point in time; training data contamination investigation requiring knowledge of what features were available at training label creation time; model backtesting requiring consistent feature snapshots across historical time ranges. Migrate from 'Latest-value-only feature store with no temporal history' to 'Point-in-time feature store with training-time lookup support'. Add computed_at and valid_until columns to the feature store schema first. Start writing temporal feature records in parallel with the existing latest-value records. Migrate training jobs one at a time to use point-in-time lookups, validating that model performance does not change from the temporal semantics change.

Point-in-time storage requires retaining every feature update with its timestamp rather than overwriting the latest value: storage volume increases by the number of feature updates per entity per time window; Existing training pipelines that read "current" feature values must be updated to read "feature value as-of label timestamp": this changes training job semantics and requires validation

Moderate

Prepare runbook for: Burst Traffic Cold Cache Stampede

simulation_preparedness

Simulation demonstrates critical degradation of redis, postgresql

Without a runbook, recovery from this failure mode will be ad-hoc

burst-traffic-cold-cache-stampede
Moderate

Prepare runbook for: Connection Pool Exhaustion with Horizontal User Scale

simulation_preparedness

Simulation demonstrates critical degradation of postgresql

Without a runbook, recovery from this failure mode will be ad-hoc

connection-pool-growth-with-user-scale
Moderate

Plan evolution: OLTP Analytics Queries → OLTP + OLAP Separation

evolution_planning

Evolution from Unified OLTP + Analytics on PostgreSQL → Separated OLTP (PostgreSQL) + OLAP (ClickHouse/Snowflake)

Migration complexity: medium. Rollback: always.

oltp-analytics-to-separated
Moderate

Plan evolution: Single Cache Layer → Distributed Cache

evolution_planning

Evolution from Single Redis Node / Sentinel Cluster → Distributed Redis Cluster (Consistent Hash Ring)

Migration complexity: medium. Rollback: complex.

single-cache-to-distributed
Low

Monitor threshold: Tier 1: Cache Cold Start Latency Spike

scaling_monitoring

Signal: Feature store p99 rising from < 5ms to > 50ms immediately following a model deployment or pod scaling event; Cassandra or PostgreSQL feature store read QPS spiking 10–100x simultaneously with serving fleet restart; feature store connection pool exhaustion visible in application logs during the cold start window; Redis cache hit rate dropping to < 10% for the first 60 seconds after deployment

Bottleneck: Simultaneous cache cold start across all serving pods after deployment, converting sequential feature requests into a thundering herd against the backing feature store. Evolution: Implement pre-warming: before a new model version receives traffic, a warm-up job runs inference requests for a representative sample of entity IDs, populating the Redis cache before the pod enters the serving fleet. Use probabilistic early cache refresh (fetch from backing store before TTL expiry when remaining TTL < 20% under high request rate) to prevent simultaneous TTL expiry on hot features. Stagger deployment rollout: deploy 10% of pods, wait for cache warm, then proceed to the next 10%.

Low

Monitor threshold: Tier 2: Training-Serving Skew Detection

scaling_monitoring

Signal: Model performance metrics (precision, recall, AUC) degrading without a corresponding input distribution shift; ClickHouse drift dashboard showing feature value distributions served online diverging from training population distributions; explicit skew audit (comparing offline training feature values against replayed online feature values for the same entity at the same timestamp) showing systematic differences in specific features

Bottleneck: Feature computation logic divergence between the offline training pipeline and the online serving pipeline: a feature transformation applied in training is not applied identically in serving. Evolution: Enforce a single feature computation function registered per feature in a shared feature registry, executed by both the online pipeline and the offline training pipeline. The two paths must use the same code, not independently maintained implementations. Implement a skew monitoring job that computes a random sample of features using both paths and alerts on distribution divergence above a threshold.

Scaling Pressure Signals

8

Feature store p99 rising from < 5ms to > 50ms immediately following a model deployment or pod scaling event; Cassandra or PostgreSQL feature store read QPS spiking 10–100x simultaneously with serving fleet restart; feature store connection pool exhaustion visible in application logs during the cold start window; Redis cache hit rate dropping to < 10% for the first 60 seconds after deployment

Threshold

Tier 1: Cache Cold Start Latency Spike

Likely Bottleneck

Simultaneous cache cold start across all serving pods after deployment, converting sequential feature requests into a thundering herd against the backing feature store

Recommended Evolution

Implement pre-warming: before a new model version receives traffic, a warm-up job runs inference requests for a representative sample of entity IDs, populating the Redis cache before the pod enters the serving fleet. Use probabilistic early cache refresh (fetch from backing store before TTL expiry when remaining TTL < 20% under high request rate) to prevent simultaneous TTL expiry on hot features. Stagger deployment rollout: deploy 10% of pods, wait for cache warm, then proceed to the next 10%.

Model performance metrics (precision, recall, AUC) degrading without a corresponding input distribution shift; ClickHouse drift dashboard showing feature value distributions served online diverging from training population distributions; explicit skew audit (comparing offline training feature values against replayed online feature values for the same entity at the same timestamp) showing systematic differences in specific features

Threshold

Tier 2: Training-Serving Skew Detection

Likely Bottleneck

Feature computation logic divergence between the offline training pipeline and the online serving pipeline: a feature transformation applied in training is not applied identically in serving

Recommended Evolution

Enforce a single feature computation function registered per feature in a shared feature registry, executed by both the online pipeline and the offline training pipeline. The two paths must use the same code, not independently maintained implementations. Implement a skew monitoring job that computes a random sample of features using both paths and alerts on distribution divergence above a threshold.

Embedding model upgrade planned or in progress; Qdrant query recall metrics below threshold for new-model query vectors; similarity search results visibly degraded for new-model queries against old-model index; full re-indexing job running for hours against Qdrant collection

Threshold

Tier 3: Qdrant Vector Index Rebuild Under Embedding Model Upgrade

Likely Bottleneck

Qdrant collection populated with old-model embeddings is incompatible with new-model query vectors: all indexed vectors must be recomputed and re-inserted

Recommended Evolution

Maintain two Qdrant collections per embedding model version (v1 and v2) simultaneously during embedding model transitions. Serve queries from the new-model collection as soon as re-indexing is complete, then deprecate the old collection. This requires that embedding model version is a first-class routing parameter in the feature serving path, not an implicit global. Re-indexing must be triggered and validated before the model serving path is pointed at the new collection.

Cassandra feature store write p99 > 20ms under online pipeline update rate; Kafka online feature computation consumer consistently lagging behind the event stream; feature freshness SLA violations (features served are older than the required freshness window); Cassandra compaction backlog growing under sustained high-frequency feature updates

Threshold

Tier 4: Feature Store Write Throughput Ceiling for Online Pipeline

Likely Bottleneck

Online feature pipeline writing updates for millions of entities at high frequency saturating Cassandra write throughput through compaction pressure and partition hot spots

Recommended Evolution

Tune Cassandra compaction strategy to TWCS (TimeWindowCompactionStrategy) for time-ordered feature updates: this reduces compaction amplification for append-heavy feature pipelines. Introduce write batching at the feature pipeline layer: group feature updates by partition key and batch-write using logged batches to reduce coordinator round-trips. For the highest-throughput feature types, evaluate ScyllaDB as a drop-in Cassandra replacement with significantly higher write throughput at equivalent hardware.

Evidence:kafka-consumer-lag-cascadepartition-hotspot-amplification

Feature store p99 rising from < 5ms to > 50ms immediately following a model deployment or pod scaling event; Cassandra or PostgreSQL feature store read QPS spiking 10–100x simultaneously with serving fleet restart; feature store connection pool exhaustion visible in application logs during the cold start window; Redis cache hit rate dropping to < 10% for the first 60 seconds after deployment

Threshold

Escalation trigger: Simultaneous cache cold start across all serving pods after deployment, converting sequential feature requests into a thundering herd against the backing feature store

Likely Bottleneck

Tier 1: Cache Cold Start Latency Spike

Recommended Evolution

Monitor: error_rate, p95_latency_ms

Model performance metrics (precision, recall, AUC) degrading without a corresponding input distribution shift; ClickHouse drift dashboard showing feature value distributions served online diverging from training population distributions; explicit skew audit (comparing offline training feature values against replayed online feature values for the same entity at the same timestamp) showing systematic differences in specific features

Threshold

Escalation trigger: Feature computation logic divergence between the offline training pipeline and the online serving pipeline: a feature transformation applied in training is not applied identically in serving

Likely Bottleneck

Tier 2: Training-Serving Skew Detection

Recommended Evolution

Monitor: error_rate, p95_latency_ms

Embedding model upgrade planned or in progress; Qdrant query recall metrics below threshold for new-model query vectors; similarity search results visibly degraded for new-model queries against old-model index; full re-indexing job running for hours against Qdrant collection

Threshold

Escalation trigger: Qdrant collection populated with old-model embeddings is incompatible with new-model query vectors: all indexed vectors must be recomputed and re-inserted

Likely Bottleneck

Tier 3: Qdrant Vector Index Rebuild Under Embedding Model Upgrade

Recommended Evolution

Monitor: error_rate, p95_latency_ms

Cassandra feature store write p99 > 20ms under online pipeline update rate; Kafka online feature computation consumer consistently lagging behind the event stream; feature freshness SLA violations (features served are older than the required freshness window); Cassandra compaction backlog growing under sustained high-frequency feature updates

Threshold

Escalation trigger: Online feature pipeline writing updates for millions of entities at high frequency saturating Cassandra write throughput through compaction pressure and partition hot spots

Likely Bottleneck

Tier 4: Feature Store Write Throughput Ceiling for Online Pipeline

Recommended Evolution

Monitor: error_rate, p95_latency_ms

Migration Readiness

12

Migration Stages

3
Stage

Features computed inline in the inference service with no shared feature store → Centralized feature store with Redis cache and Cassandra backing store

info

Migration trigger: Feature computation logic duplicated across 3+ model serving services with no coordination; training-serving skew discovered after model deployment causing unexplained model performance regression; feature computation latency dominating inference latency for complex features; inability to enforce feature versioning across model versions

Stage

Latest-value-only feature store with no temporal history → Point-in-time feature store with training-time lookup support

info

Migration trigger: Regulatory or reproducibility requirement to re-run model predictions at a historical point in time; training data contamination investigation requiring knowledge of what features were available at training label creation time; model backtesting requiring consistent feature snapshots across historical time ranges

Stage

Text similarity search via PostgreSQL full-text tsvector → Qdrant vector similarity search with pre-computed embeddings

info

Migration trigger: Semantic similarity search recall insufficient from BM25 full-text scoring; user query matching requiring understanding of synonyms, paraphrases, or cross-language similarity; feature retrieval for embedding-based ranking models requiring approximate nearest-neighbor search with p99 < 10ms

!

Risks

9
Risk

Initial feature store population requires backfilling histor

warning

Initial feature store population requires backfilling historical feature values for all entity IDs: backfill jobs must be idempotent and resumable to handle interruptions

Risk

Migrating from inline computation to feature store lookups r

warning

Migrating from inline computation to feature store lookups requires model serving code changes across all inference services simultaneously or a dual-lookup period

Risk

Point-in-time storage requires retaining every feature updat

warning

Point-in-time storage requires retaining every feature update with its timestamp rather than overwriting the latest value: storage volume increases by the number of feature updates per entity per time window

Risk

Existing training pipelines that read "current" feature valu

warning

Existing training pipelines that read "current" feature values must be updated to read "feature value as-of label timestamp": this changes training job semantics and requires validation

Risk

Qdrant approximate nearest-neighbor recall depends on index

warning

Qdrant approximate nearest-neighbor recall depends on index parameters (ef_construction, m) tuned during index build: incorrect parameters produce fast but low-recall results with no error signal

Risk

Embedding model must be fixed at index build time; changing

warning

Embedding model must be fixed at index build time; changing the model requires full re-indexing; this must be planned as a first-class operational procedure

Risk

Projection lag creates a read-after-write window where users

critical

Projection lag creates a read-after-write window where users see stale data after their own writes. Mitigation: Route immediate post-write reads to the write store (session-scoped write token); accept eventual consistency only for non-user-initiated reads

direct-db-to-cqrs

Risk

Projection rebuild after schema change can take hours or day

critical

Projection rebuild after schema change can take hours or days on large datasets. Mitigation: Design blue/green projection deployment: build new projection in parallel before switching traffic; test rebuild time in staging

direct-db-to-cqrs

Risk

Cross-service workflows that previously used database transa

critical

Cross-service workflows that previously used database transactions now require Saga orchestration. Mitigation: Design idempotent event handlers; implement compensating transactions for every multi-step workflow; test failure injection in staging

modular-monolith-to-event-driven

Review Sections

6

Referenced Intelligence

cassandraclickhousekafkapostgresqlqdrantredisburst-traffic-cold-cache-stampedeconnection-pool-growth-with-user-scalecqrs-projection-lag-expansioncross-region-stale-read-windowdistributed-cache-invalidation-failureevent-replay-storm-recoverykafka-consumer-lag-cascademulti-tenant-noisy-neighborpartition-hotspot-amplificationpostgresql-replication-lag-surgequery-cost-without-indexesread-amplification-n-plus-one-queriesredis-cache-collapse-stampederetry-storm-amplificationsplit-brain-during-network-partitionstorage-bloat-without-archivingstorage-cost-compounding-without-retentionwrite-heavy-bulk-import-saturationdirect-db-to-cqrsmodular-monolith-to-event-drivenoltp-analytics-to-separatedpostgresql-to-partitionedrabbitmq-to-kafkasingle-cache-to-distributedsingle-region-to-multi-regionarchitecture-evolutionauditabilitybtree-indexingcache-invalidationcap-theoremconsistency-modelscqrs-operationalevent-sourcingeventual-consistencykafka-consumer-lagmulti-tenancynormalizationoltp-vs-olappartition-hotspotsquery-planningqueue-backlogreplication-lagvector-databaseswrite-amplification
Architecture Review: ML Feature Serving Platform: DBRaven