Files
2nd/10_Wiki/Topics/Architecture/Technical-Architecture.md
T
koriweb d8a80f6272 chore(wiki): dangling 링크 canonical 정규화 (768파일/1200건)
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해
끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은
과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업.
도구: Datacollect/scripts/link_reconcile_apply.mjs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 12:24:15 +09:00

195 lines
6.0 KiB
Markdown

---
id: wiki-2026-0508-technical-architecture
title: Technical Architecture
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [System Architecture, Tech Architecture, 기술 아키텍처]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [architecture, system-design, structure]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: agnostic
framework: C4/arc42
---
# Technical Architecture
## 매 한 줄
> **"매 system 의 high-level structure + 매 design decision 의 rationale"**. 매 component, 매 boundary, 매 data flow, 매 quality attribute (performance, security, scalability) 의 결정. 매 2026 modern stack 은 C4 model + ADR + arc42 의 combination 으로 documentation.
## 매 핵심
### 매 4+1 view (Kruchten 1995)
- **Logical**: 매 functional decomposition (class, module).
- **Process**: 매 runtime concurrency (thread, service).
- **Development**: 매 source code organization (package, repo).
- **Physical**: 매 deployment topology (node, network).
- **Scenarios**: 매 use case 의 cross-cutting validation.
### 매 C4 model (Brown 2018)
- **L1 Context**: 매 system + 매 external actors.
- **L2 Container**: 매 deployable unit (web app, DB, queue).
- **L3 Component**: 매 container 의 internal module.
- **L4 Code**: 매 class diagram (rarely needed).
### 매 quality attributes (ISO 25010)
- Performance · Scalability · Availability · Security · Maintainability · Testability · Observability.
- 매 trade-off 의 명시 — 매 "all of them" 은 fantasy.
### 매 응용
1. Greenfield project 시 C4 L1+L2 먼저, ADR 로 매 decision 기록.
2. Legacy reverse engineering — 매 dependency graph 추출 후 component view.
3. Architecture review — quality attribute scenario 의 validation.
## 💻 패턴
### C4 diagram (PlantUML)
```plantuml
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
Person(user, "Customer")
System_Boundary(shop, "E-commerce") {
Container(web, "Web App", "Next.js 15")
Container(api, "API", "Node.js / Fastify")
ContainerDb(db, "Database", "Postgres 16")
Container(queue, "Queue", "Redis Streams")
}
System_Ext(stripe, "Stripe")
Rel(user, web, "Browses", "HTTPS")
Rel(web, api, "API calls", "JSON/HTTPS")
Rel(api, db, "Reads/Writes", "SQL")
Rel(api, queue, "Publishes events")
Rel(api, stripe, "Charges", "REST")
@enduml
```
### ADR template
```markdown
# ADR 0007: Choose Postgres over MongoDB
## Status: Accepted (2026-05-10)
## Context
Need primary store for order data. Strong consistency required.
Team has 5 years Postgres experience.
## Decision
Postgres 16 with JSONB for flexible product attributes.
## Consequences
+ ACID transactions for orders.
+ Mature ecosystem (Prisma, pgvector for AI features).
+ Single skill set for ops.
- Less flexible schema evolution.
- Manual sharding if scale > single node.
## Alternatives considered
- MongoDB: rejected — eventual consistency unsuitable for orders.
- DynamoDB: rejected — vendor lock-in, query flexibility.
```
### Hexagonal architecture (ports & adapters)
```typescript
// Domain (port)
interface OrderRepository {
save(order: Order): Promise<void>;
findById(id: string): Promise<Order | null>;
}
// Application
class PlaceOrderUseCase {
constructor(private repo: OrderRepository, private payments: PaymentGateway) {}
async execute(cmd: PlaceOrderCommand) {
const order = Order.create(cmd);
await this.payments.charge(order.total);
await this.repo.save(order);
}
}
// Infrastructure (adapter)
class PostgresOrderRepository implements OrderRepository {
async save(order: Order) { /* SQL */ }
async findById(id: string) { /* SQL */ }
}
```
### Layered architecture
```
┌─ Presentation (controllers, DTOs)
├─ Application (use cases)
├─ Domain (entities, value objects, services)
└─ Infrastructure (DB, HTTP, queue adapters)
```
### Event-driven boundary
```typescript
// Publisher (order service)
await events.publish('OrderPlaced', {
orderId: order.id,
customerId: order.customerId,
total: order.total.amount,
ts: Date.now(),
});
// Subscriber (notification service — independent deploy)
events.subscribe('OrderPlaced', async (e) => {
await emailClient.send(e.customerId, 'order-confirmation', e);
});
```
### Quality attribute scenario
```yaml
attribute: Performance
source: 1000 concurrent users
stimulus: place order
artifact: API
environment: peak load
response: order accepted
measure: p95 latency < 500ms, error rate < 0.1%
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Small team, single domain | Layered monolith |
| Multiple teams, bounded contexts | Microservices |
| Heavy I/O, async workflow | Event-driven |
| Domain-rich, complex rules | Hexagonal + DDD |
| Read-heavy, eventual consistency OK | CQRS + event sourcing |
**기본값**: 매 modular monolith 부터 시작 — 매 microservice 의 premature split 의 regret.
## 🔗 Graph
- 부모: [[Software_Architecture]] · [[System Design]]
- 변형: [[Microservices]] · [[Hexagonal Architecture]] · [[Event-Driven Architecture]]
- 응용: [[C4 Model (Architecture Documentation)]] · [[Architecture Decision Record]]
- Adjacent: [[Domain-Driven Design]] · [[Testability_Architecture]] · [[Technical_Debt]]
## 🤖 LLM 활용
**언제**: ADR drafting, C4 generation, quality attribute analysis, architecture review.
**언제 X**: 매 production 의 actual capacity planning — 매 real load test 필요.
## ❌ 안티패턴
- **Big design up front**: 매 waterfall 의 회귀.
- **No documentation**: 매 6개월 후 nobody knows why.
- **Microservices for 3 devs**: distributed monolith 의 distributed pain.
- **Cargo cult architecture**: Netflix scale 의 mimicry without justification.
## 🧪 검증 / 중복
- Verified (Kruchten 4+1 1995; Brown C4 2018; arc42 2024).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — 4+1 + C4 + hexagonal patterns |