lablup / lablup/backend.ai

Design Redis data model for App Proxy state

Open
#7,066 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.