Feast Feature Store
Feature store for ML with offline and online serving.
Overview
Feast (Feature Store) is an operational data system for managing and serving machine learning features to models in production. Originally developed by Gojek and later open-sourced, Feast addresses the critical challenge of feature engineering at scale by providing a centralized platform for storing, managing, and serving ML features with consistent offline training and online inference capabilities. The system bridges the gap between data engineering and machine learning by standardizing how features are defined, computed, stored, and retrieved across the entire ML lifecycle. This Docker configuration combines Feast's feature server with Redis as the online feature store and PostgreSQL as the offline feature store, creating a complete feature management pipeline. Redis provides sub-millisecond feature retrieval for real-time model inference, while PostgreSQL handles historical feature storage for training data generation and batch processing. The architecture enables teams to maintain feature consistency between training and serving environments, eliminating training-serving skew that commonly degrades model performance in production. This stack is ideal for ML teams building production systems that require both historical feature access for model training and low-latency feature serving for real-time predictions. The combination offers enterprise-grade reliability with PostgreSQL's ACID compliance for critical feature lineage and Redis's proven performance for high-throughput inference workloads, making it suitable for organizations scaling from prototype ML models to production feature stores serving thousands of requests per second.
Key Features
- Dual-store architecture with Redis online store for sub-millisecond feature retrieval and PostgreSQL offline store for historical analysis
- Feature registry in PostgreSQL with versioning, lineage tracking, and metadata management for reproducible ML experiments
- Time-travel queries enabling point-in-time correct feature retrieval for training data generation without data leakage
- Materialization engine for syncing features from offline PostgreSQL storage to online Redis cache on configurable schedules
- Feature server REST API on port 6566 supporting both online feature retrieval and offline feature extraction
- Redis hash-based feature storage optimized for batch feature retrieval across multiple entities and feature groups
- PostgreSQL JSONB support for flexible feature schema evolution without breaking existing feature definitions
- Feast CLI integration for feature definition deployment, data source registration, and infrastructure management
Common Use Cases
- 1Real-time recommendation systems requiring millisecond feature lookups for user preferences, item embeddings, and contextual signals
- 2Fraud detection models needing historical transaction patterns from PostgreSQL and real-time account features from Redis
- 3ML model training pipelines requiring consistent feature definitions between offline training and online serving environments
- 4A/B testing frameworks where feature flags and user segments must be consistently applied across training and inference
- 5Financial trading algorithms needing both historical market data analysis and real-time feature serving for trade decisions
- 6Customer churn prediction models combining long-term behavioral patterns with real-time activity features
- 7MLOps platforms centralizing feature engineering across multiple data science teams and model deployments
Prerequisites
- Minimum 2GB RAM (512MB for Redis online store, 1GB for PostgreSQL offline store, 512MB for Feast server)
- Docker Engine 20.10+ and Docker Compose 2.0+ with networking capabilities for inter-service communication
- Available ports 6566 (Feast API), 6379 (Redis), and 5432 (PostgreSQL) for service access
- Understanding of feature store concepts including entities, feature views, and online/offline stores
- Python environment for Feast SDK usage and feature definition management outside containers
- Basic knowledge of SQL for PostgreSQL feature queries and Redis data structures for online serving optimization
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:latest4 container_name: feast5 restart: unless-stopped6 command: feast serve -h 0.0.0.0 -p 65667 volumes: 8 - ./feature_repo:/feature_repo9 working_dir: /feature_repo10 ports: 11 - "6566:6566"12 depends_on: 13 - redis14 - postgres15 networks: 16 - feast1718 redis: 19 image: redis:alpine20 container_name: feast-redis21 ports: 22 - "6379:6379"23 networks: 24 - feast2526 postgres: 27 image: postgres:16-alpine28 container_name: feast-postgres29 environment: 30 POSTGRES_DB: feast31 POSTGRES_USER: feast32 POSTGRES_PASSWORD: feast33 volumes: 34 - postgres_data:/var/lib/postgresql/data35 networks: 36 - feast3738volumes: 39 postgres_data: 4041networks: 42 feast: 43 driver: bridge.env Template
.env
1# Initialize with: feast init feature_repoUsage Notes
- 1Docs: https://docs.feast.dev/
- 2Feature server API at http://localhost:6566
- 3Initialize: feast init feature_repo, then cd feature_repo
- 4Register features: feast apply - reads feature_store.yaml
- 5Materialize: feast materialize-incremental $(date -u +%Y-%m-%dT%H:%M:%S)
- 6Get features: store.get_online_features(features=[...], entity_rows=[...])
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
feast
feast:
image: feastdev/feature-server:latest
container_name: feast
restart: unless-stopped
command: feast serve -h 0.0.0.0 -p 6566
volumes:
- ./feature_repo:/feature_repo
working_dir: /feature_repo
ports:
- "6566:6566"
depends_on:
- redis
- postgres
networks:
- feast
redis
redis:
image: redis:alpine
container_name: feast-redis
ports:
- "6379:6379"
networks:
- feast
postgres
postgres:
image: postgres:16-alpine
container_name: feast-postgres
environment:
POSTGRES_DB: feast
POSTGRES_USER: feast
POSTGRES_PASSWORD: feast
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- feast
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 feast:5 image: feastdev/feature-server:latest6 container_name: feast7 restart: unless-stopped8 command: feast serve -h 0.0.0.0 -p 65669 volumes:10 - ./feature_repo:/feature_repo11 working_dir: /feature_repo12 ports:13 - "6566:6566"14 depends_on:15 - redis16 - postgres17 networks:18 - feast1920 redis:21 image: redis:alpine22 container_name: feast-redis23 ports:24 - "6379:6379"25 networks:26 - feast2728 postgres:29 image: postgres:16-alpine30 container_name: feast-postgres31 environment:32 POSTGRES_DB: feast33 POSTGRES_USER: feast34 POSTGRES_PASSWORD: feast35 volumes:36 - postgres_data:/var/lib/postgresql/data37 networks:38 - feast3940volumes:41 postgres_data:4243networks:44 feast:45 driver: bridge46EOF4748# 2. Create the .env file49cat > .env << 'EOF'50# Initialize with: feast init feature_repo51EOF5253# 3. Start the services54docker compose up -d5556# 4. View logs57docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/feast/run | bashTroubleshooting
- Error 'No module named feast': Install Feast SDK locally with pip install feast for CLI operations outside containers
- feast apply fails with database connection error: Ensure PostgreSQL container is healthy and POSTGRES_DB environment matches feature_store.yaml configuration
- Feature server returns 404 for registered features: Run feast materialize to sync offline features to Redis online store before querying
- Redis connection timeout during high load: Increase Redis maxclients setting and consider Redis Cluster for horizontal scaling
- PostgreSQL disk space issues with large feature datasets: Implement table partitioning by date and configure automated cleanup policies
- Feast CLI commands hang: Verify feature_repo directory contains valid feature_store.yaml and feature definitions before running feast commands
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
Shortcuts: C CopyF FavoriteD Download