docs: Gateway Redis 통합 및 문서 업데이트

- 250809_happybell80_robing-gateway구현.md 수정
  - UserCache(메모리)와 Redis(rate limiting) 구분 명시
- 250926_happybell80_gateway_redis_integration.md 신규
  - Stats API 슬래시 문제 해결
  - auth-redis 연결 설정

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
happybell80 2025-09-26 11:19:45 +09:00
parent 981606c6a6
commit 8ce2d19396
2 changed files with 66 additions and 4 deletions

View File

@ -18,7 +18,8 @@
robeing-gateway/
├── app/
│ ├── main.py # FastAPI 메인 앱
│ ├── cache.py # 메모리 캐시 (30분 TTL)
│ ├── cache.py # UserCache 메모리 캐시 (30분 TTL)
│ ├── rate_limiter.py # Redis 기반 rate limiting
│ ├── database.py # PostgreSQL 연결
│ └── models.py # SQLAlchemy 모델
├── scripts/
@ -31,9 +32,10 @@ robeing-gateway/
**핵심 기능**:
1. 사용자-로빙 매핑 관리
2. 메모리 캐시로 성능 최적화
3. 기존 main_db 테이블 활용 (workspaces, workspace_member)
4. 헬스체크 및 모니터링 엔드포인트
2. UserCache(메모리)로 사용자 매핑 캐싱
3. Redis(auth-redis)로 rate limiting
4. 기존 main_db 테이블 활용 (workspaces, workspace_member)
5. 헬스체크 및 모니터링 엔드포인트
### 23서버팀 피드백

View File

@ -0,0 +1,60 @@
# Gateway Redis 통합 및 Stats API 수정
## 날짜: 2025-09-26
## 작성자: happybell80
## 관련 서비스: robeing-gateway
## 상태: 해결 완료
---
## 1. 문제 발생
### Stats API URL 이중 슬래시
- **증상**: Gateway → Monitor 요청 시 `///api/stats//rb8001`
- **원인**: MONITOR_URL과 MONITOR_STATUS_URI 연결 시 슬래시 중복
- **위치**: `robeing-gateway/app/main.py:290`
### 헬스체크 실패
- **증상**: Actions에서 localhost:8100/healthz 연결 거부
- **원인**: 컨테이너 시작 지연
---
## 2. 해결 방법
### Stats API 수정
**서버 .env 수정**:
```bash
MONITOR_STATUS_URI=/api/stats # 앞 슬래시만 유지
```
### Redis 연결 설정
**서버 .env 추가**:
```bash
REDIS_HOST=auth-redis # auth-server의 Redis 컨테이너 공유
REDIS_PORT=6379
```
---
## 3. 아키텍처
### 캐시 구조
- **UserCache**: 사용자-로빙 매핑 (메모리, 30분 TTL)
- **Redis**: Rate limiting (auth-redis 컨테이너)
### 네트워크
- 모든 컨테이너가 appnet 네트워크 공유
- auth-redis:6379로 직접 통신 가능
---
## 4. 확인 방법
```bash
docker inspect robeing-gateway auth-redis | grep -A2 "Networks"
```
## 5. 결과
- ✅ Stats API 정상 작동
- ✅ Redis 연결 성공 (rate limiting)
- ✅ 헬스체크 통과