# Feast feature store

Source: https://docs.quake.ai/resources/iac-templates/feast
Markdown: https://docs.quake.ai/resources/iac-templates/feast.md

---

# Feast feature store

This [validated OpenTofu template](/docs/platform/validation#how-infrastructure-templates-are-checked) composes Compute, Network, and Block Storage into a self-hosted ML feature store you run on infrastructure you control.

## What this template does

Provisions a single instance running [Feast](https://feast.dev), an open-source feature store for training and serving ML features:

- Docker stack with a Feast feature server on port 6566, plus bundled Postgres (offline store and SQL registry) and Redis (online store) when `store_mode` is `bundled`
- Default sizing: `s1a.small` (2 vCPU / 2 GiB RAM) and a 30 GiB data volume at `/var/lib/docker` for container layers and database files
- Private network, security group, floating IP; feature server port 6566 restricted to `server_allowed_cidr` by default
- Sample `driver_hourly_stats` feature view and seed rows in Postgres for smoke tests after first boot

Feast keeps offline training data, online serving lookups, and registry metadata in stores you operate. Point `store_mode` at `external` and set `postgres_host` and `redis_host` to wire in [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres) and [Redis cache](/resources/iac-templates/redis-cache) instead of the bundled containers.

No credential ships with this template. cloud-init generates a Postgres password on first boot and writes it to `/opt/feast/.env` on the instance. For external stores, add `FEAST_DB_PASSWORD` there after apply.

## Parameters

| Parameter | Description | Default |
| --- | --- | --- |
| `key_name` | SSH keypair name (must already exist) | No default |
| `flavor_name` | Instance size (bundled Postgres + Redis on 2 vCPU / 2 GiB) | `s1a.small` |
| `image_name` | Operating system image | `Ubuntu-24.04` |
| `app_name` | Display name prefix for resources | `feast` |
| `volume_size` | Block volume size in GiB, mounted at `/var/lib/docker` | `30` |
| `external_network` | External network for floating IP allocation | `PublicStatic` |
| `private_cidr` | CIDR for the private subnet | `10.55.0.0/24` |
| `server_allowed_cidr` | CIDR allowed to reach the feature server on port 6566 | `10.55.0.0/24` |
| `store_mode` | `bundled` (Postgres + Redis on this VM) or `external` | `bundled` |
| `postgres_host` | PostgreSQL host when `store_mode` is `external` | `""` |
| `redis_host` | Redis host when `store_mode` is `external` | `""` |
| `postgres_port` | PostgreSQL port when `store_mode` is `external` | `5432` |
| `postgres_database` | PostgreSQL database when `store_mode` is `external` | `feast` |
| `postgres_user` | PostgreSQL user when `store_mode` is `external` | `feast` |
| `redis_port` | Redis port when `store_mode` is `external` | `6379` |

## Feature server access and security

The Feast feature server listens on port 6566 (gRPC). The security group restricts 6566 to `server_allowed_cidr`, which defaults to the private network only. Reach the server over an SSH tunnel, through a reverse proxy on 443, or by setting `server_allowed_cidr` to `YOUR_IP/32`.

Ports 80 and 443 stay open for a reverse proxy you add in front of the server; they carry no traffic until you configure one.

## Store modes

The `store_mode` parameter selects where Feast keeps data:

- `bundled` (default): Postgres holds the offline store, SQL registry, and sample `driver_stats` table; Redis holds the online store. Both run as containers on the data volume.
- `external`: only the Feast server containers run on this VM. Set `postgres_host` and `redis_host` to private IPs from your Postgres and Redis stacks, create the `feast` database and `driver_stats` table on Postgres, then add `FEAST_DB_PASSWORD` to `/opt/feast/.env` and run `docker compose up -d` in `/opt/feast`.

## When to use this pattern

Run a feature store that serves low-latency online features to inference workloads and materializes historical features from Postgres for training. Feast suits the feature layer in a notebook workbench or pipeline stack alongside experiment tracking and a warehouse.

For the warehouse itself, see [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres). For the online cache layer, see [Redis cache](/resources/iac-templates/redis-cache).

## Estimated cost

<PricingCompanion
  components={[
    { kind: "template", slug: "feast", required: true },
  ]}
/>

## Template source

<TemplateSource slug="feast" />

<TemplateResourceMap template="feast" format="opentofu" />

## Customize this pattern

- [Customize a template's image and flavor](/docs/automation/how-to/customize-template-image-flavor)
- [Add a block volume to a template](/docs/automation/how-to/add-volume-to-template)
- [Parameterize a template with a tfvars file](/docs/automation/how-to/parameterize-template-tfvars)

## See also

- [Deploy Feast](/resources/deployments/deploy-feast-template)
- [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres)
- [Redis cache](/resources/iac-templates/redis-cache)
