Feast (Feature Store) Documentation

repository·master·Indexed 27 days ago

https://github.com/feast-dev/feast

An open-source feature store for machine learning designed to manage offline (training) and online (serving) feature data. Feast provides a unified data access layer to prevent data leakage and decouple ML models from data infrastructure. It includes a Python SDK for defining features, a CLI tool, a Web UI, and support for various offline and online stores including Snowflake, BigQuery, Redis, and DynamoDB. The documentation covers core concepts, architecture, the Feast Operator for Kubernetes, and guides for building custom plugins.

Tokens
335.6K
Snippets
900
Records
1.5K
Agent score
91%

What's inside Feast

  1. Overview of Feast capabilities

    master

    Feast is an open-source feature store designed to manage and serve machine learning features for both batch and real-time applications. Key capabilities include:

    • Point-in-time correctness: Prevents data leakage during training by using battle-tested logic for joins.
    • Online feature availability: Manages deployment to online stores (e.g., DynamoDB, Redis, Google Cloud Datastore) to ensure features are available and fresh for real-time inference.
    • Feature and model versioning: Enables discovery and collaboration through a centralized catalog and allows versioning of feature sets via feature services.
    • Unified SDK and Service: Provides a Python SDK for data scientists and an optional hosted feature server for non-Python language integration.
  2. Overview of the Feast Feature Server

    master

    The Feature Server is a core architectural component in Feast that provides low-latency feature retrieval and updates for machine learning applications. It is a stateless REST API server built with FastAPI that serves as an interface between your ML applications and the Feast Online Store and Registry.

    Key capabilities:

    • Serving Features: Real-time retrieval of feature values for specific entities.
    • Data Integration: Pushing feature data into online or offline stores.
    • Scalability: Supports horizontal scaling for high request volumes.
    • Security: Supports TLS (SSL) for production environments.
    • Deployment: Can be run locally, via Docker, or on Kubernetes using Helm charts.
  3. Overview of Feast Feature Store

    master

    Feast (Feature Store) is an open-source feature store designed to help teams manage, validate, and serve features for production AI/ML. It consists of two main components:

    1. Offline Store: Used for historical feature extraction during model training.
    2. Online Store: Used for low-latency feature serving in production applications.

    Feast provides a Python SDK for defining features (entities, sources, transformations) and reading/writing data, an optional feature server for non-Python languages, a Web UI for exploration, and a CLI tool for management. It uses a push model for online serving, where the feature store pushes values to the online store to reduce retrieval latency.

  4. Overview of Feast Production Deployment Topologies

    master

    Feast provides three primary deployment topologies for Kubernetes using the Feast Operator, categorized by organizational maturity and scale:

    1. Minimal Production: Best for small teams, POCs, or low-traffic, non-critical workloads. It uses a single namespace with no high availability (HA) and a simple setup.
    2. Standard Production (Recommended): Designed for most production workloads. It includes HA registry, autoscaling, TLS, and RBAC.
    3. Enterprise Production: Designed for large-scale, multi-tenant organizations. It features namespace isolation, managed stores, and full observability.

    Prerequisites:

  5. Overview of Stream Processors in Feast

    master

    A Stream Processor in Feast consumes data from stream sources (e.g., Kafka, Kinesis) and loads it directly into the online store and, optionally, the offline store. It provides an abstraction over the specific technologies or frameworks used to materialize data.

    Feast currently provides an experimental Spark Processor for Kafka. If the built-in processors do not meet your requirements, you can implement a custom processor.

  6. Overview of the feast Python package subpackages

    master

    The feast Python package is organized into several functional subpackages. Key subpackages include:

    • feast.api: Core API definitions.
    • feast.cli: Command-line interface tools.
    • feast.aggregation: Logic for feature aggregations.
    • feast.transformation: Transformation capabilities.
    • feast.infra: Infrastructure-related components.
    • feast.ui: Web UI components and servers.
    • feast.dqm: Data Quality Management.
    • feast.lineage & feast.openlineage: Data lineage tracking.
    • feast.permissions: Access control and permissions.
    • feast.protos: Protocol Buffer definitions.
    • feast.dbt: Integration with dbt.
    • feast.diff: Tools for comparing feature definitions.
  7. Overview of Feast Java components

    master

    The Feast Java ecosystem consists of two primary components designed for feature serving:

    1. Feast Serving: A gRPC service responsible for serving the latest feature values to machine learning models.
    2. Feast Serving Client: A client used by applications to retrieve features from the Feast Serving service.

    Feast Serving depends on an online store (such as Redis) to retrieve feature values. The data ingestion process into the online store is decoupled from the feature retrieval process.

  8. Overview of streaming features in Feast

    master

    Feast supports building streaming feature pipelines through the following capabilities:

    • Streaming Feature Views: Registering feature views that consume from streaming sources.
    • Streaming Sources: Support for Kafka and Kinesis as streaming data sources.
    • Stream Processor: An interface for stream processing. An example implementation using Kafka/Spark is available in the contrib folder of the repository.

    For a complete end-to-end tutorial on building a versioned streaming pipeline (including registering transformations, features, and data sources), refer to the streaming-tutorial repository.

  9. Understand Feast component stability and support levels

    master

    Feast components are categorized into three stability statuses: Stable, Beta, and Alpha. Each status determines the level of community support and development maturity.

    Component Status Definitions

    • Stable: Deemed stable by the Feast community. Offers long-term support (LTS) and best-effort community support.
    • Beta: Working towards a 1.0 release. Not necessarily unstable, but hasn't met full stability criteria. Supported for at least 2 more minor releases with best-effort community support.
    • Alpha: Early phase of development or integration. Support levels vary based on community size and active development.

    Current Component Matrix

    ComponentStatus
    Feast Python SDKStable
    Feast Go Feature ServerBeta
    Feast Java Feature ServerAlpha

    Community Support Policy

    For Stable and Beta applications, the Feast community offers support on a best-effort basis. The community will help diagnose and address problems if:

    1. The cause is within the technical framework controlled by Feast (e.g., not caused by your internal network configuration).
    2. Community members can reproduce the problem.
    3. The reporter can assist with further diagnosis and troubleshooting.
  10. Understand the roles of Feast, MLflow, and Kubeflow in the ML lifecycle

    master

    Feast, MLflow, and Kubeflow are complementary tools that address different stages of the AI/ML lifecycle. They are not competitors but work together to provide a complete foundation for operationalizing machine learning:

    • Feast: Manages the feature data layer. It is used for defining, transforming, storing, and serving features consistently for both training and inference. It handles feature lineage, point-in-time-correct retrieval, and data quality monitoring.
    • MLflow: Manages the experiment and model layer. It is used for logging runs, metrics, parameters, and artifacts, as well as tracking and comparing model versions via a Model Registry.
    • Kubeflow: Manages the orchestration layer. It is used for running multi-step ML pipelines, distributed training on Kubernetes, and hyperparameter tuning (e.g., via Katib).

    Using Feast alongside these tools prevents training-serving skew by ensuring the same transformation and retrieval logic is used in both training and production environments.

  11. Understand the Feast Permission Model

    master

    Feast uses a Role-Based Access Control (RBAC) model to secure and partition feature store resources. Permissions are defined as Feast objects and registered in the Feast registry using Python code.

    A Permission object consists of three components:

    1. Resource: The Feast object being secured (e.g., Project, Entity). It is identified by type, optional name patterns, and required tags.
    2. Action: The operation performed on the resource. Actions include managing state (CREATE, DESCRIBE, UPDATE, DELETE) or accessing data (READ, WRITE—which are differentiated by ONLINE and OFFLINE store types).
    3. Policy: The rule used to enforce authorization (the default implementation uses role-based policies).

    Supported server types in an authorized environment:

    • Online REST feature server
    • Offline Arrow Flight feature server
    • gRPC Registry server
  12. Understand the structure of a Feast feature repository

    master

    A feature repository is the declarative source of truth for your feature store. It is a directory containing configuration and feature definitions that the Feast CLI uses to manage infrastructure (e.g., via feast apply).

    A standard feature repository includes:

    • feature_store.yaml: Located at the root, containing infrastructural configuration.
    • Python files: Containing feature declarations (e.g., FeatureView, Entity).
    • .feastignore (optional): A file specifying paths to ignore during feast apply.

    Note: Feast reads all Python files recursively when feast apply is run, including those in subdirectories. It is recommended to use .feastignore to exclude imperative scripts or virtual environments.

    $ tree -a
    .
    ├── data
    │   └── driver_stats.parquet
    ├── driver_features.py
    ├── feature_store.yaml
    └── .feastignore
    
    1 directory, 4 files