Feature Development Lifecycle¶
The Snowflake Feature Store supports a declarative, code-first workflow for developing,
testing, and deploying features to production. Instead of writing imperative Python scripts
that create objects one at a time, you describe your entire feature store (entities, data
sources, and feature views) as YAML files in a project directory, preview the changes with
snow feature plan, and apply them with snow feature apply.
This approach brings the same benefits that infrastructure-as-code tooling provides for infrastructure: version control, code reviews, repeatable deployments, and safe rollbacks. Because feature definitions are plain files in a project directory, you can integrate them into CI/CD pipelines to automatically validate, test, and promote features across development, staging, and production environments. A typical development cycle looks like this:
- Define features as YAML and Python in a local project directory.
- Plan changes to preview what would be created, updated, or deleted.
- Apply the plan to deploy features to a Snowflake target environment.
- Test by ingesting events and querying the online store.
- Iterate by editing definitions and repeating the plan-apply loop.
Prerequisites¶
Note
During preview, the CLI is distributed as a private wheel and isn’t yet on PyPI. Contact your Snowflake account team to request access.
The snow feature CLI is built on top of Snowflake CLI. Install the declarative authoring
library and the CLI build that ships the snow feature plugin:
1. Initialize a project¶
A feature store project is a directory that contains a manifest.yml and a sources/ tree.
Each entity, data source, and feature view gets its own YAML file (and optionally a .py
file for transformation logic). This structure keeps definitions modular, reviewable, and
easy to manage in version control.
Scaffold a new project from a template:
This creates the following layout:
Configure deployment targets¶
A deployment target is the Snowflake environment where your feature store resources
should be created: the account, database, schema, and role. Define multiple targets in
manifest.yml to represent different stages of your workflow, such as dev, staging, prod. Switch
between them with the --target flag when running snow feature plan or
snow feature apply.
Source files under sources/ can omit the database and schema keys. The planner
injects the resolved target into any spec that doesn’t carry them, so the same files
work against any target listed in manifest.yml.
2. Define features¶
Edit the YAML files under sources/ to describe your entities, data sources, and feature
views. Each file is a self-contained definition that maps to a single Snowflake object.
For feature views that require transformation logic (for example, aggregations or derived columns), place a Python file alongside the YAML file with the same base name. The YAML file declares the metadata (entity, schedule, online config), while the Python file contains the transformation function.
3. Plan changes¶
Before modifying anything in Snowflake, preview exactly what would happen:
The planner compares your local project definitions against the deployed state in the
target environment and shows a diff of what would be created, updated, or deleted. Nothing
is applied until you explicitly run snow feature apply. This is the same plan-then-deploy
model used by Snowflake’s broader infrastructure-as-code tooling.
4. Apply changes¶
Once you’re satisfied with the plan, deploy your changes:
This creates or updates all entities, data sources, and feature views in the target environment. The CLI reports progress and confirms what was applied.
5. Test and iterate¶
After applying, you can validate your deployment by ingesting test events and querying the online store directly from the CLI:
Use snow feature describe to inspect the deployed state of any object:
When you need to make changes, edit the YAML or Python files and repeat the plan-apply loop. The planner detects only the differences and applies incremental updates.
Command reference¶
| Command | Description |
|---|---|
snow feature init | Scaffold a new feature store project from a template. |
snow feature plan | Preview the changes that would be applied to the target, without modifying Snowflake. |
snow feature apply | Apply pending changes (entities, sources, feature views) to the target. |
snow feature describe | Show the deployed state of an entity, source, or feature view. |
snow feature ingest | Push events to a streaming source registered in the project. |
snow feature query | Read features for a given set of entity keys from the online store. |
snow feature online-service | Create or manage the online service that backs the project. |