The Go feature server is an HTTP/gRPC endpoint that serves features. It is written in Go, and is therefore significantly faster than the Python feature server. See this blog post for more details on the comparison between Python and Go. In general, we recommend the Go feature server for all production use cases that require extremely low-latency feature serving. Currently only the Redis and SQLite online stores are supported.
CLI
By default, the Go feature server is turned off. To turn it on you can add go_feature_serving: True to your feature_store.yaml:
Then the feast serve CLI command will start the Go feature server. As with Python, the Go feature server uses port 6566 by default; the port be overridden with a --port flag. Moreover, the server uses HTTP by default, but can be set to use gRPC with --type=grpc.
Alternatively, if you wish to experiment with the Go feature server instead of permanently turning it on, you can just run feast serve --go.
Installation
The Go component comes pre-compiled when you install Feast with Python versions 3.8-3.10 on macOS or Linux (on x86). In order to install the additional Python dependencies, you should install Feast with
You must also install the Apache Arrow C++ libraries. This is because the Go feature server uses the cgo memory allocator from the Apache Arrow C++ library for interoperability between Go and Python, to prevent memory from being accidentally garbage collected when executing on-demand feature views. You can read more about the usage of the cgo memory allocator 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.
Alpha features
Feature logging
The 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.
Python SDK retrieval
The logic for the Go feature server can also be used to retrieve features during a Python get_online_features call. To enable this behavior, you must add go_feature_retrieval: True to your feature_store.yaml. You must also have all the dependencies installed as detailed above.
The Offline feature server is an Apache Arrow Flight Server that uses the gRPC communication protocol to exchange data. This server wraps calls to existing offline store implementations and exposes interfaces as Arrow Flight endpoints.
How to configure the server
CLI
There is a CLI command that starts the Offline feature server: feast serve_offline. By default, remote offline server uses port 8815, the port can be overridden with a --port flag.
Deploying as a service on Kubernetes
The Offline feature server can be deployed using helm chart see this .
User need to set feast_mode=offline, when installing Offline feature server as shown in the helm command below:
Server Example
The complete example can be found under
How to configure the client
Please see the detail how to configure offline store client
Functionality Matrix
The set of functionalities supported by remote offline stores is the same as those supported by offline stores with the SDK, which are described in detail .
Offline Feature Server Permissions and Access Control
API Endpoints and Permissions
Endpoint
Resource Type
Permission
Description
How to configure Authentication and Authorization ?
Please refer the for more details on how to configure authentication and authorization.
The Python feature server is an HTTP endpoint that serves features with JSON I/O. This enables users to write and read features from the online store using any programming language that can make HTTP requests.
CLI
There is a CLI command that starts the server: feast serve. By default, Feast uses port 6566; the port be overridden with a --port flag.
Deploying as a service
One can deploy a feature server by building a docker image that bundles in the project's feature_store.yaml. See this for an example on how to run Feast on Kubernetes.
Example
Initializing a feature server
Here's an example of how to start the Python feature server with a local feature repo:
Retrieving features
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:
Pushing features to the online and offline stores
The Python feature server also exposes an endpoint for . This endpoint allows you to push data to the online and/or offline store.
The request definition for PushMode is a string parameter to where the options are: ["online", "offline", "online_and_offline"].
Note: timestamps need to be strings, and might need to be timezone aware (matching the schema of the offline store)
or equivalently from Python:
Starting the feature server in TLS(SSL) mode
Enabling TLS mode ensures that data between the Feast client and server is transmitted securely. For an ideal production environment, it is recommended to start the feature server in TLS mode.
Obtaining a self-signed TLS certificate and key
In development mode we can generate a self-signed certificate for testing. In an actual production environment it is always recommended to get it from a trusted TLS certificate provider.
The above command will generate two files
key.pem : certificate private key
cert.pem: certificate public key
Starting the Online Server in TLS(SSL) Mode
To start the feature server in TLS mode, you need to provide the private and public keys using the --key and --cert arguments with the feast serve command.
Online Feature Server Permissions and Access Control
API Endpoints and Permissions
Endpoint
Resource Type
Permission
Description
How to configure Authentication and Authorization ?
Please refer the for more details on how to configure authentication and authorization.
/materialize
FeatureView
Write Online
Materialize features within a specified time range
/materialize-incremental
FeatureView
Write Online
Incrementally materialize features up to a specified timestamp
/get-online-features
FeatureView,OnDemandFeatureView
Read Online
Get online features from the feature store
/push
FeatureView
Write Online, Write Offline, Write Online and Offline
Push features to the feature store (online, offline, or both)
$ feast init feature_repo
Creating a new Feast repository in /home/tsotne/feast/feature_repo.
$ cd feature_repo
$ feast apply
Created entity driver
Created feature view driver_hourly_stats
Created feature service driver_activity
Created sqlite table feature_repo_driver_hourly_stats
$ feast materialize-incremental $(date +%Y-%m-%d)
Materializing 1 feature views to 2021-09-09 17:00:00-07:00 into the sqlite online store.
driver_hourly_stats from 2021-09-09 16:51:08-07:00 to 2021-09-09 17:00:00-07:00:
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 5/5 [00:00<00:00, 295.24it/s]
$ feast serve
09/10/2021 10:42:11 AM INFO:Started server process [8889]
INFO: Waiting for application startup.
09/10/2021 10:42:11 AM INFO:Waiting for application startup.
INFO: Application startup complete.
09/10/2021 10:42:11 AM INFO:Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:6566 (Press CTRL+C to quit)
09/10/2021 10:42:11 AM INFO:Uvicorn running on http://127.0.0.1:6566 (Press CTRL+C to quit)