@@ -163,7 +163,7 @@ Swagger 설정이 포함되어 있어 실행 환경에서 API 문서를 확인
163163
164164## 시스템 구조
165165
166- ![ TrainUs Architecture] ( ./docs/architecture/trainus-architecture.png )
166+ ![ TrainUs Architecture] ( ./docs/architecture/trainus-architecture-simplified .png )
167167
168168운영 환경에서는 API 서버와 Consumer 서버를 역할별 profile로 분리합니다.
169169
@@ -189,64 +189,62 @@ config:
189189 theme: redux-color
190190 themeCSS: |
191191 text.actor {
192- font-size: 17px !important;
193- }
194- .messageText {
195192 font-size: 19px !important;
193+ font-weight: 600 !important;
196194 }
197- .note {
198- fill: #f1f5f9 !important;
199- stroke: #cbd5e1 !important;
195+ .messageText {
196+ font-size: 20px !important;
200197 }
201198 .noteText {
202- font-size: 17px !important;
199+ font-size: 18px !important;
200+ font-weight: 600 !important;
203201 }
204202 .labelText {
205- font-size: 17px !important;
203+ font-size: 18px !important;
204+ font-weight: 600 !important;
206205 }
207206 .loopText {
208- font-size: 17px !important;
207+ font-size: 18px !important;
208+ font-weight: 600 !important;
209+ }
210+ .note {
211+ fill: #f8fafc !important;
212+ stroke: #cbd5e1 !important;
209213 }
210214---
211215sequenceDiagram
212216 autonumber
213217 actor User
214- participant API as API Server
215- participant Core as Redis Core<br/>(Sorted Set)
216- participant Consumer as Consumer Server
217- participant Stream as Redis Stream
218- participant DB as PostgreSQL / PostGIS
219-
220- activate API
221- User->>API: POST /lesson/apply
218+ participant API as API<br/>Server
219+ participant Core as Redis Core<br/>(Stock / Waiting / Status)
220+ participant Consumer as Consumer<br/>Server
221+ participant Stream as Redis<br/>Stream
222+ participant DB as DB
223+
224+ User->>API: 신청 요청
222225 API->>Core: 재고 선점 / 중복 확인 / 대기열 등록
223- Note over API,Core: requestId는 Sorted Set Waiting Room에서 대기
224226 API-->>User: requestId 반환
225- deactivate API
226227
227- activate Consumer
228+ Note over User,Core: 사용자는 응답 대기 대신 requestId로 처리 상태 확인
229+
228230 rect rgb(255, 242, 242)
229- Note over Core,Stream: Admission 단계
230- Consumer->>Core: 대기열 requestId dequeue
231- Consumer->>Core: 상태변경: PROCESSING
232- Consumer->>Stream: XADD 신청 메시지
231+ Note over Core,Stream: Admission - 접수 요청을 처리 메시지로 전환
232+ Consumer->>Core: 대기열 조회
233+ Consumer->>Stream: 신청 메시지 적재
233234 end
234- Note over Consumer,Stream: 신청 메시지는 Redis Stream에 적재
235+
235236 rect rgb(239, 246, 255)
236- Note over Core,DB: Consumer 처리 단계
237- Stream-->>Consumer: XREADGROUP
238- Consumer->>DB: DB 반영
239- Consumer->>Core: 상태변경: SUCCESS / FAIL
237+ Note over Core,DB: Async Processing - 신청 내역 DB 반영
238+ Consumer->>Stream: 메시지 읽기
239+ Consumer->>DB: 신청 내역 일괄 반영
240+ Consumer->>Core: SUCCESS / FAIL 저장
240241 end
241- deactivate Consumer
242242
243- loop requestId polling
244- activate API
245- User->>API: GET /lesson/apply/{requestId}
243+ loop requestId 기반 상태 조회
244+ User->>API: requestId 상태 조회
246245 API->>Core: 상태 조회
247246 Core-->>API: WAITING / PROCESSING / SUCCESS / FAIL
248- API-->>User: 현재 상태 응답
249- deactivate API
247+ API-->>User: 현재 상태 반환
250248 end
251249```
252250
0 commit comments