논리 아키텍처 메시지 브로커 변경: RabbitMQ → Azure Event Hubs

- 메시지 브로커를 Azure Event Hubs로 변경
- Consumer Group을 통한 Pub/Sub 패턴 적용
- Partition 기반 부하 분산 및 순서 보장
- Event Hub 구성 정의 (meeting-events, transcript-events, todo-events)
- Throughput Units 자동 확장 설정 (2-10)
- Message Retention 1-7일 설정
- AMQP over TLS 암호화 적용
- ADR-002 업데이트 (Azure Event Hubs 선택 이유)
- Mermaid 다이어그램 업데이트

장점:
- 완전 관리형 서비스로 운영 부담 제거
- 초당 수백만 이벤트 고성능 스트리밍
- Azure Speech, Azure AI와 완벽한 생태계 통합
- Kafka 프로토콜 호환성
- 자동 확장 및 고가용성

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kimjh 2025-10-22 14:33:54 +09:00
parent 3405d233ee
commit 1b5efd76d8
2 changed files with 37 additions and 33 deletions

View File

@ -57,9 +57,9 @@
- 비동기 작업 상태 저장
**메시지 브로커**
- **RabbitMQ**: 이벤트 기반 통신 및 작업 큐
- Topic Exchange를 통한 Pub/Sub 패턴
- 작업 큐를 통한 부하 분산
- **Azure Event Hubs**: 이벤트 기반 통신 및 스트리밍
- Consumer Group을 통한 Pub/Sub 패턴
- Partition을 통한 부하 분산 및 순서 보장
**외부 서비스**
- **Azure Speech**: STT (Speech-to-Text) 엔진
@ -254,10 +254,10 @@
| **TodoCompleted** | Meeting Service | Notification Service | 완료 알림 |
| **TranscriptShared** | Meeting Service | Notification Service | 회의록 공유 알림 |
**RabbitMQ Exchange/Queue 구성**:
- **Topic Exchange**: `meeting.events`, `transcript.events`, `todo.events`
- **Queue 네이밍**: `{service}.{event-category}.queue`
- **Routing Key 패턴**: `{event}.{action}` (예: `meeting.ended`, `todo.created`)
**Azure Event Hubs 구성**:
- **Event Hub 네이밍**: `meeting-events`, `transcript-events`, `todo-events`
- **Consumer Group**: 서비스별 독립적인 Consumer Group (예: `ai-service-group`, `notification-service-group`)
- **Partition Key**: `{meetingId}` 또는 `{userId}` (동일 회의/사용자 이벤트 순서 보장)
---
@ -553,19 +553,19 @@ HPA (Horizontal Pod Autoscaler) 설정:
### 5.2 부하 분산 전략
#### Queue-Based Load Leveling
#### Event Streaming-Based Load Leveling
**적용 대상**: 장시간 작업, 트래픽 급증 가능 작업
| 서비스 | 큐 이름 | Worker 수 | 목적 |
|--------|---------|----------|------|
| STT Service | `stt.processing.queue` | 3-10 | 음성 변환 부하 분산 |
| AI Service | `ai.processing.queue` | 2-5 | AI 처리 부하 분산 |
| Notification Service | `notification.queue` | 3-10 | 대량 알림 발송 |
| 서비스 | Event Hub | Consumer Group | Partition 수 | 목적 |
|--------|-----------|---------------|-------------|------|
| STT Service | `stt-processing` | `stt-worker-group` | 4-8 | 음성 변환 부하 분산 |
| AI Service | `ai-processing` | `ai-worker-group` | 4-8 | AI 처리 부하 분산 |
| Notification Service | `notification-events` | `notification-worker-group` | 4-8 | 대량 알림 발송 |
**Queue 설정**:
- Max Length: 1000-2000 메시지
- Message TTL: 1-2시간
- Consumer Concurrency: 동적 조정 (2-10)
**Event Hub 설정**:
- Throughput Units: 2-10 (자동 확장 가능)
- Message Retention: 1-7일
- Partition Count: 4-8 (병렬 처리 수준)
---
@ -618,7 +618,7 @@ HPA (Horizontal Pod Autoscaler) 설정:
#### 전송 중 암호화
- **HTTPS/TLS**: 모든 외부 통신 암호화
- **RabbitMQ TLS**: 메시지 브로커 연결 암호화
- **Event Hubs AMQP over TLS**: 메시지 스트리밍 연결 암호화
#### 저장 암호화
- **민감 정보 암호화**: 사용자 인증 정보, 비밀번호
@ -778,18 +778,22 @@ HPA (Horizontal Pod Autoscaler) 설정:
---
### ADR-002: RabbitMQ 선택
### ADR-002: Azure Event Hubs 선택
**날짜**: 2025-01-22
**상태**: 승인
**결정**: 메시지 브로커로 RabbitMQ 사용
**상태**: 수정됨 (2025-01-23)
**결정**: 메시지 브로커로 Azure Event Hubs 사용
**이유**:
- Pub/Sub 및 Queue 패턴 모두 지원
- 성숙한 기술, 안정적 운영
- Spring AMQP와 원활한 통합
- **완전 관리형 서비스**: 인프라 운영 부담 제거
- **고성능 스트리밍**: 초당 수백만 이벤트 처리 가능
- **자동 확장**: Throughput Units 자동 조정
- **Azure 생태계 통합**: Azure Speech, Azure AI 서비스와 완벽한 연동
- **Kafka 호환**: 기존 Kafka 클라이언트 재사용 가능
- **메시지 보관**: 1-7일 이벤트 재처리 가능
**대안**:
- Apache Kafka: 고처리량이지만 운영 복잡도 높음
- AWS SQS: 클라우드 종속성 발생
- RabbitMQ: 자체 운영 필요, 확장성 제한
- Apache Kafka: 자체 운영 복잡도 높음
- AWS Kinesis: Azure 환경에서 최적화 부족
---

View File

@ -37,7 +37,7 @@ graph TB
Redis["Redis<br/>- 분산 캐시 (Cache-Aside)<br/>- 작업 상태 저장<br/>- 세션 관리"]
%% 메시지 브로커
RabbitMQ["RabbitMQ<br/>- Pub/Sub 패턴<br/>- Queue-Based Load Leveling"]
EventHubs["Azure Event Hubs<br/>- Pub/Sub 패턴 (Consumer Groups)<br/>- Partition 기반 부하 분산<br/>- 이벤트 스트리밍"]
end
%% ========================================
@ -79,18 +79,18 @@ graph TB
%% ========================================
%% ========================================
%% 서비스 → RabbitMQ (이벤트 발행)
%% 서비스 → Event Hubs (이벤트 발행)
%% ========================================
MeetingSvc ==>|"이벤트 발행"| RabbitMQ
STTSvc ==>|"이벤트 발행"| RabbitMQ
AISvc ==>|"이벤트 발행"| RabbitMQ
MeetingSvc ==>|"이벤트 발행<br/>(meeting-events)"| EventHubs
STTSvc ==>|"이벤트 발행<br/>(transcript-events)"| EventHubs
AISvc ==>|"이벤트 발행<br/>(transcript-events)"| EventHubs
%% ========================================
%% 이벤트 구독 정보 (노트)
%% ========================================
Note1["📋 이벤트 구독 매핑<br/><br/>Meeting Service:<br/>- TranscriptSummaryCreated<br/><br/>STT Service:<br/>- MeetingEnded<br/><br/>AI Service:<br/>- MeetingCreated<br/>- MeetingEnded<br/>- TranscriptReady<br/><br/>Notification Service:<br/>- MeetingCreated<br/>- MeetingEnded<br/>- TranscriptCreated<br/>- TodoCreated<br/>- TodoCompleted"]
Note1 -.->|"참조"| RabbitMQ
Note1 -.->|"참조"| EventHubs
%% ========================================
%% 서비스 → 외부 시스템
@ -117,5 +117,5 @@ graph TB
class STTSvc,AISvc special
class NotifySvc support
class Redis infra
class RabbitMQ mq
class EventHubs mq
class AzureSpeech,LLM,EmailSMS external