The serving backend

The serving backend is the engine that answers real-time calls. This page says what it runs, what it reads and where it runs. Why serving works this way is in Real-time serving .

One language, one more backend

The serving backend is DataFusion, embedded in FeatureMesh's own runtime. For the compiler, it is one more backend next to DuckDB, Trino, PostgreSQL, Snowflake, Databricks, BigQuery and ClickHouse. A feature written for a warehouse compiles for serving without being written again.

It runs the query model of the warehouses, including WHERE, ORDER BY, LIMIT, grouped and window computations, RELATED() and EXTEND(). The shared model is in Query structure . A few functions and forms differ by engine. Same answer across backends lists them for every backend, serving included. Two examples are ST_TRANSFORM(), which serving does not have, and FEATUREQL(...) inside SQL, which only the batch backends run.

What it reads

A warehouse reads its own tables. The serving backend reads live sources instead, by key, while the call runs. FeatureQL has three families of connectors. Each family has one source function and one read function. The connection string's scheme picks the product, so a new database or store joins its family without new syntax.

ConnectorFunctionReads
Key-value (Redis)SOURCE_KV() + EXTERNAL_KV()Keys and hash fields (JSON, MessagePack, float vectors, LZ4); sorted sets over a score range, such as the last 30 days of events
Database (PostgreSQL, MySQL, MariaDB, DynamoDB)SOURCE_DB() + EXTERNAL_COLUMNS(... FROM TABLE(source[table]))PostgreSQL: rows by key, the children of a key, aggregations computed in the database. MySQL and MariaDB: the same, with integer keys and no time window in the database. DynamoDB: rows by key
HTTP SOURCE_HTTP() + EXTERNAL_HTTP()REST APIs, microservices, ML model endpoints, one row or a batch of rows per request

A source is created once and then referenced in feature definitions. One query can read several families ( Combining sources ). Passwords and tokens stay out of the definitions ( Credentials ).

The tables of a database source are ordinary tables. A free-form query can join, group and window them as it would in a warehouse. Persist the rows serving reads in one of these sources: the database or the store keeps them, and every replica reads the same rows.

Inside a feature, a table is always mapped through a source, with FROM TABLE(source[table]). FROM SQL(...) that names a table is refused on serving (UE/SERVING-SQL-WITHOUT-SOURCE).

A /* SQL */ statement can still create a table in the engine itself, such as CREATE TABLE t AS SELECT .... That table lives in the memory of one featuremeshd process:

  • every caller of that process sees it;
  • a restart loses it;
  • other replicas do not have it;
  • the registry does not know it;
  • its rows count against the engine's memory, shared with serving calls and view runs.

Use such tables to explore or test, not to serve.

The batch backends read no live source. A warehouse runs SQL inside its own engine, which cannot call out per row.

How a call reads its sources

A serving call starts from a few keys, such as a customer, an account or a list of candidates. Every source is read by them:

  • A point lookup reads the value of a key: a Redis key built from the customer ID, the row of a table bound to an input (BIND TO).
  • A children lookup reads the rows that point to a key, such as the orders of a customer: a RELATED(aggregate ON ...) whose condition equals a column to the key. See Reading the children of a key .
  • An aggregation over history summarizes those rows over a window ending at the time of the request. PostgreSQL computes it in the database, one row per key back. See Aggregating a key's recent history .

A free-form query may scan a source. A prepared statement that would scan a source, rather than read it by key, is refused when it is created.

The independent reads of one call run concurrently, over connection pools the engine keeps open. When a call passes several keys, a database is read once for all of them, with ANY($1) or IN (...).

Where it runs

The same engine runs in two places:

  • featuremeshd, a server you run in your own infrastructure. It loads its definitions from a registry, the managed one included ( On-prem platform ).
  • A Python process, with the featuremesh[serving] extra. No server is deployed ( Embedded serving in Python ).

What builds on it

The serving backend is what makes real-time serving possible. The next sections build on it:

Streams arrive later, with hooks in Precompute , which read a Kafka topic and write what serving reads back.