What a Python process with embedded serving does differently from featuremeshd, capability by capability, and what to do about it. Everything not listed here behaves as the featuremeshd reference says.
featuremeshd is a service: it consumes streams, keeps a clock, syncs its registry and reports. The library runs when your process calls it, and leaves those jobs to the process it runs in. The limits of hooks and views in featuremeshd apply to it too ( Precomputing features , Materialized views ).
The stream
Capability
featuremeshd
Python
Consequence or workaround
Consuming
consumes each event hook's topic, with a consumer group, partition ownership and rebalances ( Configure featuremeshd )
never connects to Kafka. run_event_hook takes the records your consumer polled
Run your own consumer. Several Python consumers in one group share its partitions as Kafka assigns them
Connection
the stream's WITH properties: SECURITY_PROTOCOL, SASL_MECHANISM, USERNAME, PASSWORD, SSL_* ( Connections )
not read
Configure your consumer. With confluent_kafka: security.protocol, sasl.mechanism, sasl.username, sasl.password, ssl.ca.location
Consumer group
the hook's name, behind kafka_group_prefix when it is set ( Consumer groups )
your consumer's group.id. The library never sets it, and kafka_group_prefix does not apply
To share or take over featuremeshd's group, use its name, prefix included
Offsets
committed per batch, after the batch is written
yours to commit
Commit, per partition, the offset after the batch's last record, once run_event_hook has returned
START
applied to each partition without a committed offset when the hook first subscribes; a partition added later is read from its beginning
not read
'earliest' and 'latest' are your consumer's auto.offset.reset. For an interval, before subscribing, commit for each partition without a committed offset (consumer.committed) the offset offsets_for_times gives for now minus the interval, or the partition's end (get_watermark_offsets) when it has none. Keep auto.offset.reset at earliest for partitions added later
retried with backoff, from 200 ms to 30 seconds, until its stores answer; the hook is STALLED meanwhile ( Failures in a batch )
run_event_hook tries once. A source, sink or queue that does not answer raises RuntimeError
Retrying is delivery, so it is yours: hand the same records in again, with your own backoff, or stop. The sinks the failed attempt wrote are written again
Poison isolation in a batch
calls still failing on a source after poison_after (2 minutes), while others succeed, become data errors
none for an event batch: each call of run_event_hook is a new attempt. A source that keeps failing for one key fails the batch every time
Set that record aside after your own number of attempts, and commit past it
Poison isolation in a drain
as for a batch, counted from the drain's first failed attempt
the same, while your tick keeps calling run_due_hooks()
None needed
The clock
Capability
featuremeshd
Python
Consequence or workaround
Drains
every EVERY of the hook
when you call run_due_hooks(). A hook's EVERY is not read
Your tick's period is the drain period. When you call decides each drain's REQUEST_TIME() and which entries have passed their EXPIRE
Views
each slot of the SCHEDULE, retried until it lands or the next slot is due ( Runs )
when you call run_due_materialized_views(); a failed slot is run again by the next call
Call it from your tick, or from your scheduler. Keep the tick's period plus its longest run well under the shortest EXPIRE, or run views in a thread of their own
Retention sweep
deletes table rows past their RETENTION every minute ( Retention )
no sweep. Redis values and indexes expire on their own
Delete old table rows yourself, or keep the data in Redis
RECOMPUTE MATERIALIZED VIEW
a statement sent to featuremeshd
refused by client.query() (UE/MATERIALIZED-VIEW-RECOMPUTE-SERVING-ONLY)
Call recompute_materialized_view(view)
Test controls
TEST SERVING … and a call's request_time, with serving.test_controls ( Test commands )
refused: TEST SERVING is not a command here, and request_time raises ValueError
Drive time by when you call. Test time-dependent behavior on featuremeshd
Definitions
Capability
featuremeshd
Python
Consequence or workaround
Registry
the registry it syncs from, every 60 seconds by default
the local registry file only. A remote registry with embedded serving is refused when the client is built
Register the definitions in each process's local registry, from the same FeatureQL files
Sync
at each sync, and at RECOMPILE SERVING
when the client is created, and at each RECOMPILE SERVING. Never on its own
Each process runs its own RECOMPILE SERVING after a change
A password in clear
refused by the hosted registry (SOURCE-INLINE-PASSWORD)
stored by the local registry with a warning
Use SECRET() all the same, so the definitions move to the hosted registry unchanged ( No password in clear )
Status and metrics
Capability
featuremeshd
Python
Consequence or workaround
Status
SHOW SERVING STATUS per replica
SHOW SERVING STATUS through client.query(), and hooks_status(), for this process
Read them in the process that runs the hooks
Recent writes
SHOW SERVING WRITES
refused
Read the counts and the errors sample of each report
Export the reports' counts with your own metrics, and alert on them
Usage
counted and reported to the registry at each sync, never a key or a value ( Status and writes )
stays in your process: nothing is sent to FeatureMesh
Counts are in hooks_status()
Logging
Capability
featuremeshd
Python
Consequence or workaround
Delivery
after the response, through a bounded queue ( Delivery )
synchronous, in the caller's thread, before the call returns
A slow handler slows every call: enqueue in the handler, ship from another thread ( Logging from Python )
Sinks
Parquet and JSON lines, to files, object stores and stdout://
without a log_handler, JSON lines only, to stdout:// and to file:// sinks with FORMAT = 'jsonl'. A logger to any other sink, a file:// sink left to the Parquet default included, is ERROR
Write file:// sinks WITH (FORMAT = 'jsonl'), or give the client a log_handler: every sink is then a routing key
One runner per hook
featuremeshd replicas share a hook: the consumer group splits its partitions, and a lease in the queue's store gives each drain one holder. A Python process and featuremeshd must not both run the same hook. Each would consume with its own offsets and write the same keys.
featuremeshd to Python. Drop the hook from featuremeshd's registry, or turn its hooks off (serving.hooks.enabled). Once its consumer has left the group, start yours with group.id set to the hook's name, prefix included. It resumes from the offsets featuremeshd committed.
Python to featuremeshd. Stop your consumer and your tick. Once your consumer has left the group, create the hook in featuremeshd's registry and run RECOMPILE SERVING. featuremeshd's consumer resumes from your group's offsets when your group.id was the hook's name, prefix included, and applies START otherwise.
Queues. A drain's lease is kept in the queue's own store. Several processes can tick one queue: one drains it at a time.
Views. A view's lease is in the registry that runs it. Processes that run views share one registry file. featuremeshd keeps its leases in the registry it syncs from, so a view run by both would run each slot twice: run each view in one place. A run's number always starts above the run its sinks published, so a view moved between the two is never fenced out of its sinks.
Platforms
featuremesh[serving] installs featuremesh-serving-runtime, a native wheel:
Python
Linux x86_64
Linux aarch64
macOS arm64 (11 or later)
3.12
yes
yes
no
3.13
yes
yes
yes
3.14
yes
yes
no
The Linux wheels need glibc 2.17 or later (manylinux2014). Elsewhere, pip install featuremesh still gives batch analytics, and a client asking for embedded serving raises ImportError.
The process
Capability
featuremeshd
Python
Consequence or workaround
Calls
HTTP (port 10090) and gRPC, from any client
in-process calls only, from the process that created the client
Expose your own API, or run featuremeshd
Forks
not applicable
a client used after a fork raises RuntimeError
Create the client in each worker process, after the fork
Memory
FEATUREMESHD_MEMORY_LIMIT_MB, 1 GiB by default
set_default("serving.memory_limit_bytes", …), in bytes, 1 GiB by default, before the client is created
One limit per client, shared by its calls and view runs