Feast users can choose to retrieve features from a feature server, as opposed to through the Python SDK.
The feature server is an HTTP endpoint that serves features with JSON I/O. This enables users to write + read features from Feast online stores using any programming language that can make HTTP requests.
There is a CLI command that starts the server: feast serve
. By default, Feast uses port 6566; the port be overridden by a --port
flag.
One can also deploy a feature server by building a docker image that bundles in the project's feature_store.yaml
. See helm chart for example.
A remote feature server on AWS Lambda is available. A remote feature server on GCP Cloud Run is currently being developed.
Here's the local feature server usage example with the local template:
After the server starts, we can execute cURL commands from another terminal tab:
It's also possible to specify a feature service name instead of the list of features:
You can push data corresponding to a push source to the online and offline stores (note that timestamps need to be strings):
You can also define a pushmode to push stream or batch data, either to the online store, offline store, or both. The feature server will throw an error if the online/offline store doesn't support the push api functionality.
The request definition for pushmode is a string parameter to
where the options are: ["online", "offline", "online_and_offline"].
or equivalently from Python:
The Go Feature Retrieval component is a Go implementation of the core feature serving logic, embedded in the Python SDK. It supports retrieval of feature references, feature services, and on demand feature views, and can be used either through the Python SDK or the .
Currently, this component only supports online serving and does not have an offline component including APIs to create feast feature repositories or apply configuration to the registry to facilitate online materialization. It also does not expose its own dedicated cli to perform feast actions. Furthermore, this component is only meant to expose an online serving API that can be called through the python SDK to facilitate faster online feature retrieval.
The Go Feature Retrieval component currently only supports Redis and Sqlite as online stores; support for other online stores will be added soon. Initial benchmarks indicate that it is significantly faster than the Python feature server for online feature retrieval. We plan to release a more comprehensive set of benchmarks. For more details, see the .
As long as you are running macOS or linux, on x86, with python version 3.7-3.10, the go component comes pre-compiled when you install feast.
However, some additional dependencies are required for Go <-> Python interoperability. To install these dependencies run the following command in your console:
You will also have to install the apache-arrow c++ libraries, since we use the cgo memory allocator to prevent memory from being incorrectly garbage collected, detailed in these .
For macos, run brew install apache-arrow
. For linux users, you have to install libarrow-dev
.
For developers, if you want to build from source, run make compile-go-lib
to build and compile the go server. In order to build the go binaries, you will need to install the apache-arrow
c++ libraries.
To enable the Go online feature retrieval component, set go_feature_retrieval: True
in your feature_store.yaml
. This will direct all online feature retrieval to Go instead of Python. This flag will be enabled by default in the future.
Go feature server can log all requested entities and served features to a configured destination inside an offline store. This allows users to create new datasets from features served online. Those datasets could be used for future trainings or for feature validations. To enable feature logging we need to edit feature_store.yaml
:
Feature logging configuration in feature_store.yaml
also allows to tweak some low-level parameters to achieve the best performance:
All these parameters are optional.
We also plan on adding support for the Java feature server (e.g. the capability to call into the Go component and execute Java UDFs).
The Go feature retrieval online feature logging for Data Quality Monitoring is currently in development. More information can be found .