Real-time serving

By defining features on top of operational data sources (Redis, JDBC, REST APIs), FeatureMesh becomes a feature platform for production APIs and online ML inference.

What you get automatically

Millisecond latency: Features execute in memory via DataFusion, a super fast query engine in Rust.

Multi-source federation: Combine Redis, PostgreSQL, external APIs and other data sources in a single query.

Training/serving consistency: Use the exact same feature definitions for batch analytics and real-time serving. Eliminates inconsistencies and go to production faster.

Instant APIs: Pre-compile queries as prepared statements for low latency, high throughput and low resource usage.

How it works

Your data team (or you yourself!) seeds the feature registry with the real-time sources you need.

CREATE FEATURE REDIS_SRC AS SOURCE_REDIS('redis://localhost:6379' WITH (timeout='100ms'));
CREATE FEATURE POSTGRES_SRC AS SOURCE_JDBC('postgresql://db:5432/prod' WITH (tables=ARRAY['customers']));
CREATE FEATURE API_SRC AS SOURCE_HTTP('https://api.risk.com' WITH (timeout='200ms'));

CREATE FEATURES AS
    CUSTOMERS := ENTITY(),
    CUSTOMER_ID := INPUT(BIGINT#CUSTOMERS),

    PROFILE_TIER := EXTERNAL_REDIS(KEY 'customer:' || CUSTOMER_ID::VARCHAR FIELD 'tier' FROM REDIS_SRC),

    CUSTOMER_DATA := EXTERNAL_VIEW(
        'SELECT customer_id, balance FROM %POSTGRES_SRC[customers]'
        ON 'SELF.customer_id=%CUSTOMER_ID'
        AS ROW(customer_id BIGINT, balance DECIMAL)
    ),
    BALANCE := CUSTOMER_DATA[balance],

    CREDIT_SCORE_JSON := EXTERNAL_HTTP(FROM API_SRC WITH (query_params=ROW(CUSTOMER_ID AS id))),
    CREDIT_SCORE := JSON_PARSE_AS(CREDIT_SCORE_JSON, TYPE 'ROW(score INT)')[score]
;
sql

You can then define autonomously the features you need:

CREATE FEATURES AS
    ELIGIBLE_FOR_LOAN := (CREDIT_SCORE > 650) AND (BALANCE > 1000),
    RISK_TIER := CASE WHEN BALANCE < 100 THEN 'high' ELSE 'low' END
;
sql

And now anybody can query the features you defined from anywhere (HTTP API, Python, application code).

And if you want to make it faster, you can create a prepared statement:

CREATE FEATURE CUSTOMER_FEATURES_PS AS
PREPARED_STATEMENT(
    RISK_TIER, ELIGIBLE_FOR_LOAN
    USING INPUTS CUSTOMER_ID
);
sql

That you call from your application:

curl -X POST "http://localhost:10090/api/v1/featureql" \
  -H "Content-Type: application/json" \
  -d '{
    "statement": {
      "id": "CUSTOMER_FEATURES_PS",
      "inputs": {"customer_id": [12345]}
    }
  }'
bash

FeatureMesh evaluates real-time prepared statements with all optimizations provided by DataFusion, a super fast query engine in Rust.

Better than custom microservices

Shared business logic: Define features once, reuse across multiple microservices. Traditional approach duplicates logic or requires shared libraries that still need deployment.

Built-in federation: Microservices require manual integration code to combine Redis, PostgreSQL, and APIs. FeatureMesh queries all sources declaratively.

No deployment cycle: Changing business logic in microservices requires code changes, tests, and deployments. FeatureMesh updates rules instantly.

Last update at: 2025/11/06 07:00:15
Last updated: 2025-11-06 07:00:51