kt-event-marketing/design/backend/logical/logical-architecture-v2.mmd.backup
2025-10-22 11:25:59 +09:00

81 lines
4.1 KiB
Plaintext

graph TB
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 논리 아키텍처 (CQRS + Event-Driven)
%% Command Services (Write)
subgraph "Command Services"
UserCmd["User Service<br/>• 회원가입/로그인<br/>• 프로필 관리<br/>• 사업자번호 검증"]
EventCmd["Event Command<br/>Service<br/>• 이벤트 생성/수정/삭제<br/>• 플로우 오케스트레이션"]
PartCmd["Participation<br/>Command Service<br/>• 참여 접수<br/>• 당첨자 추첨"]
end
%% Query Services (Read)
subgraph "Query Services"
EventQuery["Event Query<br/>Service<br/>• 이벤트 목록/상세<br/>• 이벤트 검색"]
PartQuery["Participation<br/>Query Service<br/>• 참여자 목록<br/>• 당첨자 조회"]
AnalQuery["Analytics Query<br/>Service<br/>• 실시간 대시보드<br/>• 성과 분석"]
end
%% Async Services
subgraph "Async Services"
AISvc["AI Service<br/>• 트렌드 분석<br/>• 이벤트 추천<br/>[Circuit Breaker]"]
ContentSvc["Content Service<br/>• SNS 이미지 생성<br/>• 3가지 스타일<br/>[Circuit Breaker]"]
DistSvc["Distribution<br/>Service<br/>• 다중 채널 배포<br/>[Circuit Breaker]<br/>[Retry Pattern]"]
end
%% Event Bus
EventBus["Event Bus<br/>(Kafka/SQS)<br/>━━━━━━━━━━<br/>• EventCreated<br/>• EventPublished<br/>• ParticipantRegistered<br/>• WinnerSelected<br/>• DistributionCompleted"]
%% Job Queue
JobQueue["Job Queue<br/>(RabbitMQ)<br/>━━━━━━━━━━<br/>• AI 작업 큐<br/>• 이미지 생성 큐"]
%% External System
External["외부시스템<br/>[Circuit Breaker]<br/>━━━━━━━━━━<br/>• 국세청 API<br/>• AI API<br/>• 이미지 생성 API<br/>• 배포 채널 APIs"]
%% Command to Event Bus (이벤트 발행)
EventCmd ==>|"1. EventCreated<br/>발행"| EventBus
EventCmd ==>|"2. EventPublished<br/>발행"| EventBus
PartCmd ==>|"3. ParticipantRegistered<br/>발행"| EventBus
PartCmd ==>|"4. WinnerSelected<br/>발행"| EventBus
DistSvc ==>|"5. DistributionCompleted<br/>발행"| EventBus
%% Event Bus to Services (이벤트 구독)
EventBus -.->|"EventCreated<br/>구독"| EventQuery
EventBus -.->|"EventCreated<br/>구독"| AnalQuery
EventBus -.->|"EventPublished<br/>구독"| DistSvc
EventBus -.->|"ParticipantRegistered<br/>구독"| PartQuery
EventBus -.->|"ParticipantRegistered<br/>구독"| AnalQuery
EventBus -.->|"WinnerSelected<br/>구독"| PartQuery
EventBus -.->|"DistributionCompleted<br/>구독"| AnalQuery
%% Command to Job Queue (비동기 작업)
EventCmd -->|"AI 추천 요청"| JobQueue
EventCmd -->|"이미지 생성 요청"| JobQueue
JobQueue -->|작업 처리| AISvc
JobQueue -->|작업 처리| ContentSvc
%% Query to Query (읽기 최적화)
AnalQuery -.->|캐시 조회| EventQuery
AnalQuery -.->|캐시 조회| PartQuery
%% Services to External (Resilience 패턴)
UserCmd -->|"사업자번호 검증<br/>[Circuit Breaker]<br/>[Retry: 3회]"| External
AISvc -->|"트렌드 분석/추천<br/>[Circuit Breaker]<br/>[Timeout: 30s]"| External
ContentSvc -->|"이미지 생성<br/>[Circuit Breaker]<br/>[Timeout: 20s]"| External
DistSvc -->|"다중 채널 배포<br/>[Circuit Breaker]<br/>[Retry: 3회]<br/>[Bulkhead]"| External
AnalQuery -->|"채널별 통계<br/>[Circuit Breaker]<br/>[Fallback: Cache]"| External
%% Styling
classDef command fill:#4ECDC4,stroke:#14B8A6,stroke-width:3px
classDef query fill:#10B981,stroke:#059669,stroke-width:3px
classDef async fill:#8B5CF6,stroke:#7C3AED,stroke-width:3px,color:#fff
classDef eventbus fill:#F59E0B,stroke:#D97706,stroke-width:3px
classDef jobqueue fill:#FB923C,stroke:#EA580C,stroke-width:3px
classDef external fill:#E5E7EB,stroke:#9CA3AF,stroke-width:2px
class UserCmd,EventCmd,PartCmd command
class EventQuery,PartQuery,AnalQuery query
class AISvc,ContentSvc,DistSvc async
class EventBus eventbus
class JobQueue jobqueue
class External external