docker.recipes

Feast Feature Store + Redis

advanced

ready feature store for ML with Redis online store.

Overview

Feast (Feature Store) is an open-source operational data system for managing and serving machine learning features to both training and serving workloads. Originally developed at Gojek and later open-sourced, Feast addresses the critical challenge of feature engineering consistency across ML pipelines by providing a centralized registry and serving layer for features. This eliminates the common problem where features computed differently between training and inference lead to model performance degradation in production. This stack combines Feast's feature server with Redis as the online store for low-latency feature retrieval, PostgreSQL for offline feature storage and metadata management, and the Feast UI for feature discovery and monitoring. Redis serves as the high-performance online store, enabling sub-millisecond feature lookups during model inference, while PostgreSQL handles the offline store responsibilities including feature materialization jobs and historical feature queries for training datasets. The combination provides both the speed required for real-time ML serving and the reliability needed for batch feature engineering workflows. This configuration is ideal for ML teams building production-grade feature infrastructure who need to serve features with consistent low latency while maintaining a robust offline pipeline for feature development and model training. The setup particularly benefits organizations transitioning from ad-hoc feature engineering to a more systematic MLOps approach, providing the foundation for feature reusability across multiple models and teams.

Key Features

  • Redis-backed online feature store with sub-millisecond feature retrieval for real-time inference
  • PostgreSQL offline store for historical feature queries and point-in-time correct training data generation
  • Feast feature server providing gRPC and HTTP APIs for feature retrieval with automatic serialization
  • Feature registry with versioning and lineage tracking stored as protocol buffer format
  • Web-based UI for feature discovery, monitoring, and validation with real-time feature statistics
  • Automatic feature materialization from offline to online stores with configurable batch jobs
  • Point-in-time correct joins for training data generation preventing data leakage
  • Feature transformation engine supporting Python-based feature definitions and computations

Common Use Cases

  • 1Real-time recommendation systems requiring low-latency user and item feature lookups
  • 2Fraud detection models needing immediate access to user behavior and transaction features
  • 3ML model serving pipelines requiring consistent feature computation between training and inference
  • 4A/B testing frameworks where different model variants need access to the same feature definitions
  • 5Multi-team ML organizations sharing features across recommendation, search, and personalization models
  • 6Financial services applications serving credit scoring features with strict latency requirements
  • 7E-commerce platforms providing personalized pricing and inventory features to multiple services

Prerequisites

  • Minimum 2GB RAM (1GB for PostgreSQL, 512MB for Redis, remainder for Feast services)
  • Available ports 5432, 6379, 6566, and 8888 for database, cache, feature server, and UI respectively
  • Environment variables POSTGRES_USER and POSTGRES_PASSWORD configured in .env file
  • Understanding of feature engineering concepts and ML model serving architecture
  • Python knowledge for defining feature transformations and data sources
  • Basic familiarity with protocol buffers for feature registry configuration

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 feast:
3 image: feastdev/feature-server:latest
4 environment:
5 - FEAST_OFFLINE_STORE_TYPE=file
6 - FEAST_ONLINE_STORE_TYPE=redis
7 - FEAST_REDIS_HOST=redis
8 - FEAST_REDIS_PORT=6379
9 - FEAST_REGISTRY_PATH=/feast/registry.pb
10 volumes:
11 - feast-data:/feast
12 ports:
13 - "6566:6566"
14 depends_on:
15 - redis
16 networks:
17 - feast-network
18 restart: unless-stopped
19
20 redis:
21 image: redis:alpine
22 command: redis-server --appendonly yes
23 volumes:
24 - redis-data:/data
25 ports:
26 - "6379:6379"
27 networks:
28 - feast-network
29 restart: unless-stopped
30
31 postgres:
32 image: postgres:15
33 environment:
34 - POSTGRES_USER=${POSTGRES_USER}
35 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
36 - POSTGRES_DB=feast
37 volumes:
38 - postgres-data:/var/lib/postgresql/data
39 ports:
40 - "5432:5432"
41 networks:
42 - feast-network
43 restart: unless-stopped
44
45 feast-ui:
46 image: feastdev/feast-ui:latest
47 environment:
48 - FEAST_FEATURE_SERVER_URL=http://feast:6566
49 ports:
50 - "8888:8888"
51 depends_on:
52 - feast
53 networks:
54 - feast-network
55 restart: unless-stopped
56
57volumes:
58 feast-data:
59 redis-data:
60 postgres-data:
61
62networks:
63 feast-network:
64 driver: bridge

.env Template

.env
1# Feast Feature Store
2POSTGRES_USER=feast
3POSTGRES_PASSWORD=secure_postgres_password
4
5# Redis as online store
6# PostgreSQL as offline store

Usage Notes

  1. 1Feature server at http://localhost:6566
  2. 2Feast UI at http://localhost:8888
  3. 3Redis for online serving
  4. 4PostgreSQL for offline storage
  5. 5Initialize with feast init

Individual Services(4 services)

Copy individual services to mix and match with your existing compose files.

feast
feast:
  image: feastdev/feature-server:latest
  environment:
    - FEAST_OFFLINE_STORE_TYPE=file
    - FEAST_ONLINE_STORE_TYPE=redis
    - FEAST_REDIS_HOST=redis
    - FEAST_REDIS_PORT=6379
    - FEAST_REGISTRY_PATH=/feast/registry.pb
  volumes:
    - feast-data:/feast
  ports:
    - "6566:6566"
  depends_on:
    - redis
  networks:
    - feast-network
  restart: unless-stopped
redis
redis:
  image: redis:alpine
  command: redis-server --appendonly yes
  volumes:
    - redis-data:/data
  ports:
    - "6379:6379"
  networks:
    - feast-network
  restart: unless-stopped
postgres
postgres:
  image: postgres:15
  environment:
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=feast
  volumes:
    - postgres-data:/var/lib/postgresql/data
  ports:
    - "5432:5432"
  networks:
    - feast-network
  restart: unless-stopped
feast-ui
feast-ui:
  image: feastdev/feast-ui:latest
  environment:
    - FEAST_FEATURE_SERVER_URL=http://feast:6566
  ports:
    - "8888:8888"
  depends_on:
    - feast
  networks:
    - feast-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 feast:
5 image: feastdev/feature-server:latest
6 environment:
7 - FEAST_OFFLINE_STORE_TYPE=file
8 - FEAST_ONLINE_STORE_TYPE=redis
9 - FEAST_REDIS_HOST=redis
10 - FEAST_REDIS_PORT=6379
11 - FEAST_REGISTRY_PATH=/feast/registry.pb
12 volumes:
13 - feast-data:/feast
14 ports:
15 - "6566:6566"
16 depends_on:
17 - redis
18 networks:
19 - feast-network
20 restart: unless-stopped
21
22 redis:
23 image: redis:alpine
24 command: redis-server --appendonly yes
25 volumes:
26 - redis-data:/data
27 ports:
28 - "6379:6379"
29 networks:
30 - feast-network
31 restart: unless-stopped
32
33 postgres:
34 image: postgres:15
35 environment:
36 - POSTGRES_USER=${POSTGRES_USER}
37 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
38 - POSTGRES_DB=feast
39 volumes:
40 - postgres-data:/var/lib/postgresql/data
41 ports:
42 - "5432:5432"
43 networks:
44 - feast-network
45 restart: unless-stopped
46
47 feast-ui:
48 image: feastdev/feast-ui:latest
49 environment:
50 - FEAST_FEATURE_SERVER_URL=http://feast:6566
51 ports:
52 - "8888:8888"
53 depends_on:
54 - feast
55 networks:
56 - feast-network
57 restart: unless-stopped
58
59volumes:
60 feast-data:
61 redis-data:
62 postgres-data:
63
64networks:
65 feast-network:
66 driver: bridge
67EOF
68
69# 2. Create the .env file
70cat > .env << 'EOF'
71# Feast Feature Store
72POSTGRES_USER=feast
73POSTGRES_PASSWORD=secure_postgres_password
74
75# Redis as online store
76# PostgreSQL as offline store
77EOF
78
79# 3. Start the services
80docker compose up -d
81
82# 4. View logs
83docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/feast-feature-store/run | bash

Troubleshooting

  • Feature server fails to start with registry errors: Ensure feast-data volume has proper write permissions and initialize with 'docker-compose exec feast feast init'
  • Redis connection refused during feature retrieval: Verify Redis container is healthy and FEAST_REDIS_HOST environment variable matches the service name
  • PostgreSQL connection timeout in offline queries: Check POSTGRES_USER and POSTGRES_PASSWORD environment variables are set correctly in the feast service
  • Feast UI shows 'Feature server unreachable': Confirm FEAST_FEATURE_SERVER_URL points to http://feast:6566 and containers are on the same network
  • Features not materializing to online store: Check Redis memory limits and ensure appendonly persistence is working with sufficient disk space

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space