Skip to main content

Federation Service Configuration

Environment Variables​

Database​

DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/federation_dev

Redis​

REDIS_URL=redis://localhost:6379

Service Configuration​

# Server
HOST=0.0.0.0
PORT=8020

# Logging
LOG_LEVEL=info

# Schema Cache TTL (seconds)
SCHEMA_CACHE_TTL=3600

# Service Discovery
SERVICE_DISCOVERY_TYPE=redis # or static
SERVICE_DISCOVERY_REDIS_KEY=saga:services

# Static Service List (if not using Redis)
STATIC_SERVICES='[
{"name": "gateway", "url": "http://gateway:8000/api/graphql"},
{"name": "payment", "url": "http://payment:8001/api/graphql"}
]'

OpenTelemetry​

OTLP_ENDPOINT=http://otel-collector:4317
OTLP_SERVICE_NAME=federation

Configuration Files​

pyproject.toml​

Project dependencies and metadata.

alembic.ini​

Database migration configuration.

Service Discovery​

Redis-based Discovery​

Services register themselves in Redis, and Federation Service discovers them automatically.

Static Configuration​

For environments without service discovery, configure services statically via environment variables.

Schema Caching​

Schemas are cached in PostgreSQL with configurable TTL. Set SCHEMA_CACHE_TTL to control refresh frequency.