|
| 1 | +# \[Alpha\] Feature View Versioning |
| 2 | + |
| 3 | +{% hint style="warning" %} |
| 4 | +**Warning**: This is an _experimental_ feature. It is stable but there are still rough edges. Contributions are welcome! |
| 5 | +{% endhint %} |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Feature view versioning automatically tracks schema and UDF changes to feature views. Every time `feast apply` detects a change, a versioned snapshot is saved to the registry. This enables: |
| 10 | + |
| 11 | +- **Audit trail** — see what a feature view looked like at any point in time |
| 12 | +- **Safe rollback** — pin serving to a prior version with `version="v0"` in your definition |
| 13 | +- **Multi-version serving** — serve both old and new schemas simultaneously using `@v<N>` syntax |
| 14 | +- **Staged publishing** — use `feast apply --no-promote` to publish a new version without making it the default |
| 15 | + |
| 16 | +## Quick Start |
| 17 | + |
| 18 | +Version history tracking is **always active** with no configuration required. Every `feast apply` that changes a feature view automatically records a version snapshot. |
| 19 | + |
| 20 | +### List versions |
| 21 | + |
| 22 | +```bash |
| 23 | +feast version-history driver_stats |
| 24 | +``` |
| 25 | + |
| 26 | +### Pin to a prior version |
| 27 | + |
| 28 | +```python |
| 29 | +driver_stats = FeatureView( |
| 30 | + name="driver_stats", |
| 31 | + version="v0", # Pin to v0 |
| 32 | + ... |
| 33 | +) |
| 34 | +``` |
| 35 | + |
| 36 | +### Staged publishing (no-promote) |
| 37 | + |
| 38 | +```bash |
| 39 | +# Publish v2 without promoting it to active |
| 40 | +feast apply --no-promote |
| 41 | + |
| 42 | +# Populate v2 online table |
| 43 | +feast materialize --views driver_stats --version v2 ... |
| 44 | + |
| 45 | +# Migrate consumers to @v2 refs, then promote |
| 46 | +feast apply |
| 47 | +``` |
| 48 | + |
| 49 | +### Version-qualified online reads |
| 50 | + |
| 51 | +To enable version-qualified reads (e.g., `driver_stats@v2:trips_today`), add the following to your `feature_store.yaml`: |
| 52 | + |
| 53 | +```yaml |
| 54 | +registry: |
| 55 | + path: data/registry.db |
| 56 | + enable_online_feature_view_versioning: true |
| 57 | +``` |
| 58 | +
|
| 59 | +Then query specific versions: |
| 60 | +
|
| 61 | +```python |
| 62 | +features = store.get_online_features( |
| 63 | + features=["driver_stats@v2:trips_today"], |
| 64 | + entity_rows=[{"driver_id": 1001}], |
| 65 | +) |
| 66 | +``` |
| 67 | + |
| 68 | +## Online Store Support |
| 69 | + |
| 70 | +{% hint style="info" %} |
| 71 | +**Currently, version-qualified online reads (`@v<N>`) are only supported with the SQLite online store.** Support for additional online stores (Redis, DynamoDB, Bigtable, Postgres, etc.) will be added based on community priority. |
| 72 | + |
| 73 | +If you need versioned online reads for a specific online store, please [open a GitHub issue](https://github.com/feast-dev/feast/issues/new) describing your use case and which store you need. This helps us prioritize development. |
| 74 | +{% endhint %} |
| 75 | + |
| 76 | +Version history tracking in the registry (listing versions, pinning, `--no-promote`) works with **all** registry backends (file, SQL, Snowflake). |
| 77 | + |
| 78 | +## Full Details |
| 79 | + |
| 80 | +For the complete design, concurrency semantics, and feature service interactions, see the [Feature View Versioning RFC](../rfcs/feature-view-versioning.md). |
| 81 | + |
| 82 | +## Known Limitations |
| 83 | + |
| 84 | +- **Online store coverage** — Version-qualified reads (`@v<N>`) are SQLite-only today. Other online stores are follow-up work. |
| 85 | +- **Offline store versioning** — Versioned historical retrieval is not yet supported. |
| 86 | +- **Version deletion** — There is no mechanism to prune old versions from the registry. |
| 87 | +- **Cross-version joins** — Joining features from different versions of the same feature view in `get_historical_features` is not supported. |
| 88 | +- **Feature services** — Feature services always resolve to the active (promoted) version. `--no-promote` versions are not served until promoted. |
0 commit comments