Data Engineering

Building a Real-Time Feature Store with Kafka, Redis, and Feast

6 min read

A real-time feature store is the difference between batch ML and ML that participates in user experience. Here is a working reference architecture.

  1. 01Define features as code (Feast feature views)

    Source of truth is git, not ad-hoc SQL.

  2. 02Stream features into Redis from Kafka

    Sub-100ms reads with simple infra.

  3. 03Materialize batch features nightly into the same Redis

    Online and offline serve from the same store.

  4. 04Validate read parity between online and offline

    Daily Great Expectations test suite.

  5. 05Wire feature serving into the inference path

    Model gets features by entity ID; never reaches into source systems.

Compliance-Grade RAG PipelineSOC 2 + audit-trail architectureDocuments14K pagesChunkingHierarchicalEmbeddingsVoyage-3pgvectorOn RDSRerankCohere v3Claude 3.7Citation-disciplinedAUDIT TRAIL · Every query → S3 Object Lock · 7-year retentionQuestion · Retrieved chunks (hashed) · Prompt version · Model version · Final answerZero audit findings · Q1 2026 SOC 296.4% answer satisfaction · 2,400+ queries/month · p95 retrieval 180ms
The compliance-grade RAG architecture Ohveda deployed for a regulated FinTech in Q4 2025.

Feast Feature View

from feast import FeatureView, Entity, Field, FileSource
from feast.types import Float32, Int64
from datetime import timedelta

customer = Entity(name="customer_id", join_keys=["customer_id"])

customer_30d_features = FeatureView(
    name="customer_30d_features",
    entities=[customer],
    ttl=timedelta(days=2),
    schema=[
        Field(name="orders_30d",         dtype=Int64),
        Field(name="aov_30d",            dtype=Float32),
        Field(name="returns_rate_30d",   dtype=Float32),
        Field(name="time_since_last_d",  dtype=Float32),
    ],
    online=True,
    source=FileSource(
        path="s3://features/customer_30d.parquet",
        timestamp_field="event_ts",
    ),
)

Ready to optimize your cloud or AI footprint?

Book a free 30-minute architecture review. We will deliver a written cost-and-architecture audit within 48 hours.

Book a free architecture review · sales@ohveda.com

Need help with real-time feature store?

Ohveda runs free 30-minute architecture reviews. We will identify your top opportunities in writing within 48 hours — at no cost.

Book a Free Architecture Review →