kt-event-marketing/design/backend/database/distribution-service-erd.puml
jhbkjh 3075a5d49f 물리아키텍처 설계 완료
 주요 기능
- Azure 기반 물리아키텍처 설계 (개발환경/운영환경)
- 7개 마이크로서비스 물리 구조 설계
- 네트워크 아키텍처 다이어그램 작성 (Mermaid)
- 환경별 비교 분석 및 마스터 인덱스 문서

📁 생성 파일
- design/backend/physical/physical-architecture.md (마스터)
- design/backend/physical/physical-architecture-dev.md (개발환경)
- design/backend/physical/physical-architecture-prod.md (운영환경)
- design/backend/physical/*.mmd (4개 Mermaid 다이어그램)

🎯 핵심 성과
- 비용 최적화: 개발환경 월 $143, 운영환경 월 $2,860
- 확장성: 개발환경 100명 → 운영환경 10,000명 (100배)
- 가용성: 개발환경 95% → 운영환경 99.9%
- 보안: 다층 보안 아키텍처 (L1~L4)

🛠️ 기술 스택
- Azure Kubernetes Service (AKS)
- Azure Database for PostgreSQL Flexible
- Azure Cache for Redis Premium
- Azure Service Bus Premium
- Application Gateway + WAF

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 15:13:01 +09:00

113 lines
2.5 KiB
Plaintext

@startuml
!theme mono
title Distribution Service ERD
' Entity 정의
entity "distribution_status" as ds {
* id : BIGSERIAL <<PK>>
--
* event_id : VARCHAR(36) <<UK>>
* overall_status : VARCHAR(20)
* started_at : TIMESTAMP
completed_at : TIMESTAMP
* created_at : TIMESTAMP
* updated_at : TIMESTAMP
}
entity "channel_status" as cs {
* id : BIGSERIAL <<PK>>
--
* distribution_status_id : BIGINT <<FK>>
* channel : VARCHAR(20)
* status : VARCHAR(20)
progress : INTEGER
distribution_id : VARCHAR(100)
estimated_views : INTEGER
* update_timestamp : TIMESTAMP
* event_id : VARCHAR(36)
impression_schedule : TEXT
post_url : VARCHAR(500)
post_id : VARCHAR(100)
message_id : VARCHAR(100)
completed_at : TIMESTAMP
error_message : TEXT
retries : INTEGER
last_retry_at : TIMESTAMP
* created_at : TIMESTAMP
* updated_at : TIMESTAMP
}
' 관계 정의
ds ||--o{ cs : "has"
' 제약 조건 노트
note right of ds
**제약 조건**
- UK: event_id (이벤트당 하나의 배포)
- CHECK: overall_status IN
('IN_PROGRESS', 'COMPLETED',
'FAILED', 'PARTIAL_SUCCESS')
**인덱스**
- PRIMARY: id
- UNIQUE: event_id
end note
note right of cs
**제약 조건**
- FK: distribution_status_id
REFERENCES distribution_status(id)
ON DELETE CASCADE
- UK: (distribution_status_id, channel)
- CHECK: channel IN
('URIDONGNETV', 'RINGOBIZ', 'GINITV',
'INSTAGRAM', 'NAVER', 'KAKAO')
- CHECK: status IN
('PENDING', 'IN_PROGRESS',
'SUCCESS', 'FAILED')
- CHECK: progress BETWEEN 0 AND 100
**인덱스**
- PRIMARY: id
- UNIQUE: (distribution_status_id, channel)
- INDEX: event_id
- INDEX: (event_id, channel)
- INDEX: status
end note
' 데이터 설명
note top of ds
**배포 상태 테이블**
이벤트별 배포 전체 상태 관리
- 배포 시작/완료 시간 추적
- 전체 배포 성공/실패 상태
end note
note top of cs
**채널 배포 상태 테이블**
채널별 세부 배포 상태 및 성과 추적
- 6개 채널 독립적 상태 관리
- 진행률, 도달률, 에러 정보 저장
- 재시도 정보 및 외부 시스템 ID 추적
end note
' Redis 캐시 정보
note bottom of ds
**Redis 캐시**
Key: event:{eventId}:distribution
TTL: 1시간
- 배포 상태 실시간 조회 최적화
- DB 부하 감소
end note
note bottom of cs
**Redis 캐시**
Key: distribution:channel:{eventId}:{channel}
TTL: 30분
- 채널별 상태 실시간 모니터링
- 진행률 추적 및 업데이트
end note
@enduml