mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 14:46:23 +00:00
✨ 주요 기능 - 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>
109 lines
2.2 KiB
Plaintext
109 lines
2.2 KiB
Plaintext
@startuml
|
|
!theme mono
|
|
|
|
title User Service ERD
|
|
|
|
' ====================
|
|
' Entity 정의
|
|
' ====================
|
|
|
|
entity "users" as users {
|
|
* **id** : UUID <<PK>>
|
|
--
|
|
* name : VARCHAR(100)
|
|
* phone_number : VARCHAR(20) <<UK>>
|
|
* email : VARCHAR(255) <<UK>>
|
|
* password_hash : VARCHAR(255)
|
|
* role : VARCHAR(20)
|
|
* status : VARCHAR(20)
|
|
last_login_at : TIMESTAMP
|
|
* created_at : TIMESTAMP
|
|
* updated_at : TIMESTAMP
|
|
--
|
|
CHECK: role IN ('OWNER', 'ADMIN')
|
|
CHECK: status IN ('ACTIVE', 'INACTIVE', 'LOCKED', 'WITHDRAWN')
|
|
}
|
|
|
|
entity "stores" as stores {
|
|
* **id** : UUID <<PK>>
|
|
--
|
|
* user_id : UUID <<FK>> <<UK>>
|
|
* name : VARCHAR(200)
|
|
* industry : VARCHAR(100)
|
|
* address : VARCHAR(500)
|
|
business_hours : TEXT
|
|
* created_at : TIMESTAMP
|
|
* updated_at : TIMESTAMP
|
|
}
|
|
|
|
' ====================
|
|
' 관계 정의
|
|
' ====================
|
|
|
|
users ||--|| stores : "1:1\nhas"
|
|
|
|
' ====================
|
|
' 인덱스 정의
|
|
' ====================
|
|
|
|
note right of users
|
|
**인덱스**
|
|
- idx_users_email (email)
|
|
- idx_users_phone_number (phone_number)
|
|
- idx_users_status (status)
|
|
|
|
**비즈니스 규칙**
|
|
- email: 로그인 ID (UNIQUE)
|
|
- phone_number: 중복 불가
|
|
- password_hash: bcrypt 암호화
|
|
- role: OWNER(소상공인), ADMIN(관리자)
|
|
- status: 계정 상태 관리
|
|
- last_login_at: 최종 로그인 추적
|
|
end note
|
|
|
|
note right of stores
|
|
**인덱스**
|
|
- idx_stores_user_id (user_id)
|
|
|
|
**비즈니스 규칙**
|
|
- user_id: User와 1:1 관계 (UNIQUE)
|
|
- ON DELETE CASCADE
|
|
- industry: 업종 (예: 음식점, 카페)
|
|
- business_hours: 영업시간 정보
|
|
end note
|
|
|
|
' ====================
|
|
' Redis 캐시 구조
|
|
' ====================
|
|
|
|
note top of users
|
|
**Redis 캐시**
|
|
|
|
1. JWT 세션
|
|
- Key: session:{token}
|
|
- Value: {userId, role, email, expiresAt}
|
|
- TTL: JWT 만료시간 (예: 7일)
|
|
|
|
2. JWT Blacklist
|
|
- Key: blacklist:{token}
|
|
- Value: {userId, logoutAt}
|
|
- TTL: 토큰 만료시간까지
|
|
end note
|
|
|
|
' ====================
|
|
' 제약조건 설명
|
|
' ====================
|
|
|
|
note bottom of stores
|
|
**Foreign Key 제약**
|
|
- FK: user_id → users(id)
|
|
- ON DELETE CASCADE
|
|
- ON UPDATE CASCADE
|
|
|
|
**1:1 관계 보장**
|
|
- UNIQUE: user_id
|
|
- 하나의 User는 최대 하나의 Store
|
|
end note
|
|
|
|
@enduml
|