Design Redis data model for App Proxy state
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Goal
Convert PostgreSQL tables to Redis data structures
## Work Items
- Define Worker data structure (Hash + TTL)
- Define Circuit/Route data structure (reuse existing `endpoint.{id}.route_connection_info`)
- Define Token data structure (Hash + TTL)
## Redis Key Design
```
appproxy:worker:{worker_id} # Worker info (Hash)
appproxy:worker:{worker_id}:heartbeat # Heartbeat (TTL: 60s)
appproxy:worker:{worker_id}:ports # Occupied ports (Set)
appproxy:worker:all # All worker IDs (Set)
appproxy:token:{token_id} # Token info (Hash, TTL: 1h)
# Existing keys (pushed by Manager)
endpoint.{endpoint_id}.route_connection_info
endpoint.{endpoint_id}.health_check_enabled
endpoint.{endpoint_id}.health_check_config
```
## Files to Modify
- `src/ai/backend/appproxy/common/types.py` - Add Redis key constants
JIRA Issue: BA-3222
Contributor guide
Assessment
This issue has not been assessed yet.