-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding stream ingestion alpha documentation (#2005)
* GitBook: [#332] Updating roadmap and adding stream push API docs * GitBook: [#334] Fix typo in stream ingestion docs and update other references to streaming
- Loading branch information
Showing
7 changed files
with
102 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
docs/getting-started/architecture-and-components/overview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
# Overview | ||
|
||
![Feast Architecture Diagram](../../.gitbook/assets/image%20%284%29.png) | ||
![Feast Architecture Diagram](<../../.gitbook/assets/image (4).png>) | ||
|
||
## Functionality | ||
|
||
* **Create Batch Features:** ELT/ETL systems like Spark and SQL are used to transform data in the batch store. | ||
* **Feast Apply:** The user \(or CI\) publishes versioned controlled feature definitions using `feast apply`. This CLI command updates infrastructure and persists definitions in the object store registry. | ||
* **Feast Materialize:** The user \(or scheduler\) executes `feast materialize` which loads features from the offline store into the online store. | ||
* **Feast Apply:** The user (or CI) publishes versioned controlled feature definitions using `feast apply`. This CLI command updates infrastructure and persists definitions in the object store registry. | ||
* **Feast Materialize:** The user (or scheduler) executes `feast materialize` which loads features from the offline store into the online store. | ||
* **Model Training:** A model training pipeline is launched. It uses the Feast Python SDK to retrieve a training dataset and trains a model. | ||
* **Get Historical Features:** Feast exports a point-in-time correct training dataset based on the list of features and entity dataframe provided by the model training pipeline. | ||
* **Deploy Model:** The trained model binary \(and list of features\) are deployed into a model serving system. This step is not executed by Feast. | ||
* **Deploy Model:** The trained model binary (and list of features) are deployed into a model serving system. This step is not executed by Feast. | ||
* **Prediction:** A backend system makes a request for a prediction from the model serving service. | ||
* **Get Online Features:** The model serving service makes a request to the Feast Online Serving service for online features using a Feast SDK. | ||
|
||
## Components | ||
|
||
A complete Feast deployment contains the following components: | ||
|
||
* **Feast Registry**: An object store \(GCS, S3\) based registry used to persist feature definitions that are registered with the feature store. Systems can discover feature data by interacting with the registry through the Feast SDK. | ||
* **Feast Registry**: An object store (GCS, S3) based registry used to persist feature definitions that are registered with the feature store. Systems can discover feature data by interacting with the registry through the Feast SDK. | ||
* **Feast Python SDK/CLI:** The primary user facing SDK. Used to: | ||
* Manage version controlled feature definitions. | ||
* Materialize \(load\) feature values into the online store. | ||
* Materialize (load) feature values into the online store. | ||
* Build and retrieve training datasets from the offline store. | ||
* Retrieve online features. | ||
* **Online Store:** The online store is a database that stores only the latest feature values for each entity. The online store is populated by materialization jobs. | ||
* **Online Store:** The online store is a database that stores only the latest feature values for each entity. The online store is populated by materialization jobs and from [stream ingestion](../../reference/alpha-stream-ingestion.md). | ||
* **Offline Store:** The offline store persists batch data that has been ingested into Feast. This data is used for producing training datasets. Feast does not manage the offline store directly, but runs queries against it. | ||
|
||
{% hint style="info" %} | ||
Java and Go Clients are also available for online feature retrieval. | ||
{% endhint %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# \[Alpha] Stream ingestion | ||
|
||
**Warning**: This is an _experimental_ feature. It's intended for early testing and feedback, and could change without warnings in future releases. | ||
|
||
{% hint style="info" %} | ||
To enable this feature, run **`feast alpha enable direct_ingest_to_online_store`** | ||
{% endhint %} | ||
|
||
## Overview | ||
|
||
Streaming data sources are important sources of feature values. A typical setup with streaming data looks like: | ||
|
||
1. Raw events come in (stream 1) | ||
2. Streaming transformations applied (e.g. `last_N_purchased_categories`) (stream 2) | ||
3. Write stream 2 values to an offline store as a historical log for training | ||
4. Write stream 2 values to an online store for low latency feature serving | ||
5. Periodically materialize feature values from the offline store into the online store for improved correctness | ||
|
||
Feast now allows users to push features previously registered in a feature view to the online store. This most commonly would be done from a stream processing job (e.g. a Beam or Spark Streaming job). Future versions of Feast will allow writing features directly to the offline store as well. | ||
|
||
## Example | ||
|
||
See [https://github.com/feast-dev/feast-demo](https://github.com/feast-dev/on-demand-feature-views-demo) for an example on how to ingest stream data into Feast. | ||
|
||
We register a feature view as normal, and during stream processing (e.g. Kafka consumers), now we push a dataframe matching the feature view schema: | ||
|
||
```python | ||
event_df = pd.DataFrame.from_dict( | ||
{ | ||
"driver_id": [1001], | ||
"event_timestamp": [ | ||
datetime(2021, 5, 13, 10, 59, 42), | ||
], | ||
"created": [ | ||
datetime(2021, 5, 13, 10, 59, 42), | ||
], | ||
"conv_rate": [1.0], | ||
"acc_rate": [1.0], | ||
"avg_daily_trips": [1000], | ||
} | ||
) | ||
store.write_to_online_store("driver_hourly_stats", event_df) | ||
``` | ||
|
||
Feast will coordinate between pushed stream data and regular materialization jobs to ensure only the latest feature values are written to the online store. This ensures correctness in served features for model inference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters