edit logical architecture
This commit is contained in:
@@ -1,80 +1,62 @@
|
||||
graph TB
|
||||
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 논리 아키텍처 (CQRS + Event-Driven)
|
||||
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 논리 아키텍처 (Event-Driven + Kafka)
|
||||
|
||||
%% 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/>• 성과 분석"]
|
||||
%% Services
|
||||
subgraph "Services"
|
||||
UserSvc["User Service<br/>• 회원가입/로그인<br/>• 프로필 관리<br/>• 사업자번호 검증<br/>[Circuit Breaker]"]
|
||||
EventSvc["Event Service<br/>• 이벤트 생성/수정/삭제<br/>• 플로우 오케스트레이션<br/>• AI/이미지 작업 요청<br/>• 배포 작업 요청"]
|
||||
PartSvc["Participation<br/>Service<br/>• 참여 접수<br/>• 당첨자 추첨"]
|
||||
AnalSvc["Analytics Service<br/>• 실시간 대시보드<br/>• 성과 분석<br/>• 채널별 통계<br/>[Circuit Breaker]"]
|
||||
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]"]
|
||||
AISvc["AI Service<br/>• 트렌드 분석<br/>• 이벤트 추천<br/>[Circuit Breaker]<br/>[Timeout: 30s]"]
|
||||
ContentSvc["Content Service<br/>• SNS 이미지 생성<br/>• 3가지 스타일<br/>[Circuit Breaker]<br/>[Timeout: 20s]"]
|
||||
DistSvc["Distribution<br/>Service<br/>• 다중 채널 배포<br/>[Circuit Breaker]<br/>[Retry: 3회]<br/>[Bulkhead]"]
|
||||
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/>• 이미지 생성 큐"]
|
||||
%% Kafka (Event Bus + Job Queue)
|
||||
Kafka["Kafka<br/>━━━━━━━━━━<br/><Event Topics><br/>• EventCreated<br/>• ParticipantRegistered<br/>• WinnerSelected<br/>• DistributionCompleted<br/>━━━━━━━━━━<br/><Job Topics><br/>• ai-job<br/>• image-job<br/>• distribution-job"]
|
||||
|
||||
%% External System
|
||||
External["외부시스템<br/>[Circuit Breaker]<br/>━━━━━━━━━━<br/>• 국세청 API<br/>• AI API<br/>• 이미지 생성 API<br/>• 배포 채널 APIs"]
|
||||
External["외부시스템<br/>[Circuit Breaker]<br/>━━━━━━━━━━<br/>• 국세청 API<br/>• AI API<br/>• 이미지 생성 API<br/>• 배포 채널 APIs<br/>(비동기)"]
|
||||
|
||||
%% 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 Publishing
|
||||
EventSvc ==>|"EventCreated<br/>발행"| Kafka
|
||||
PartSvc ==>|"ParticipantRegistered<br/>발행"| Kafka
|
||||
PartSvc ==>|"WinnerSelected<br/>발행"| Kafka
|
||||
DistSvc ==>|"DistributionCompleted<br/>발행"| Kafka
|
||||
|
||||
%% 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
|
||||
%% Job Publishing (비동기 작업 요청)
|
||||
EventSvc -->|"ai-job 발행"| Kafka
|
||||
EventSvc -->|"image-job 발행"| Kafka
|
||||
EventSvc -->|"distribution-job<br/>발행 (비동기)"| Kafka
|
||||
|
||||
%% Command to Job Queue (비동기 작업)
|
||||
EventCmd -->|"AI 추천 요청"| JobQueue
|
||||
EventCmd -->|"이미지 생성 요청"| JobQueue
|
||||
JobQueue -->|작업 처리| AISvc
|
||||
JobQueue -->|작업 처리| ContentSvc
|
||||
%% Event Subscription
|
||||
Kafka -.->|"EventCreated<br/>구독"| AnalSvc
|
||||
Kafka -.->|"ParticipantRegistered<br/>구독"| AnalSvc
|
||||
Kafka -.->|"DistributionCompleted<br/>구독"| AnalSvc
|
||||
|
||||
%% Query to Query (읽기 최적화)
|
||||
AnalQuery -.->|캐시 조회| EventQuery
|
||||
AnalQuery -.->|캐시 조회| PartQuery
|
||||
%% Job Subscription
|
||||
Kafka -.->|"ai-job 구독"| AISvc
|
||||
Kafka -.->|"image-job 구독"| ContentSvc
|
||||
Kafka -.->|"distribution-job<br/>구독 (비동기)"| DistSvc
|
||||
|
||||
%% 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
|
||||
UserSvc -->|"사업자번호 검증<br/>[Retry: 3회]"| External
|
||||
AISvc -->|"트렌드 분석/추천"| External
|
||||
ContentSvc -->|"이미지 생성"| External
|
||||
DistSvc -->|"다중 채널 배포<br/>(비동기)"| External
|
||||
AnalSvc -->|"채널별 통계<br/>[Fallback: Cache]"| External
|
||||
|
||||
%% Styling
|
||||
classDef command fill:#4ECDC4,stroke:#14B8A6,stroke-width:3px
|
||||
classDef query fill:#10B981,stroke:#059669,stroke-width:3px
|
||||
classDef service fill:#4ECDC4,stroke:#14B8A6,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 kafka fill:#F59E0B,stroke:#D97706,stroke-width:3px
|
||||
classDef external fill:#E5E7EB,stroke:#9CA3AF,stroke-width:2px
|
||||
|
||||
class UserCmd,EventCmd,PartCmd command
|
||||
class EventQuery,PartQuery,AnalQuery query
|
||||
class UserSvc,EventSvc,PartSvc,AnalSvc service
|
||||
class AISvc,ContentSvc,DistSvc async
|
||||
class EventBus eventbus
|
||||
class JobQueue jobqueue
|
||||
class Kafka kafka
|
||||
class External external
|
||||
|
||||
Reference in New Issue
Block a user