[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,91 +2,193 @@
|
||||
id: wiki-2026-0508-technical-architecture
|
||||
title: Technical Architecture
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-TEAR-001]
|
||||
aliases: [System Architecture, Tech Architecture, 기술 아키텍처]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.97
|
||||
tags: [auto-reinforced, technical-Architecture, infrastructure, blueprint, high-level-design, Scalability, durability]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [architecture, system-design, structure]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: agnostic
|
||||
framework: C4/arc42
|
||||
---
|
||||
|
||||
# [[Technical-Architecture|Technical-Architecture]]
|
||||
# Technical Architecture
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "지능 시스템의 뼈대와 실핏줄: 단순히 예쁜 화면을 넘어, 데이터가 어디로 흐르고 서버가 어떻게 부하를 견디며 지식이 어떻게 안전하게 저장될지 정의한 기술적 총본산이자 시스템의 '지속 가능한 생존 전략'."
|
||||
## 매 한 줄
|
||||
> **"매 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.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
기술 아키텍처(Technical-Architecture)는 소프트웨어 시스템의 구조, 구성 요소 간의 관계, 그리고 이들을 설계하고 진화시키기 위한 원칙을 정의한 것입니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **3대 설계 원칙**:
|
||||
* **[[Modularity|Modularity]]**: 기능별로 쪼개어 하나가 고장 나도 전체가 멈추지 않게 함. ([[SPOF|SPOF]] 제거).
|
||||
* **Scalability**: 사용자 증가 시 서버를 무한히 늘릴 수 있는 구조. (Scalability와 연결)
|
||||
* **Decoupling**: 부품 간의 의존성을 줄여 독립적인 업데이트 가능케 함. ([[Refinement|Refinement]]의 용이성).
|
||||
2. **왜 중요한가?**:
|
||||
* 아키텍처가 부실하면 초기엔 빠를지 모르나, 곧 '기술 부채'의 늪에 빠져 시스템이 제 무게를 견디지 못하고 붕괴하기 때문임. ([[Technical-Debt|Technical-Debt]]와 대비)
|
||||
### 매 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.
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거에는 거대한 하나로 뭉친 구조(Monolithic) 정책이었으나, 현대 정책은 아주 작게 쪼개어진 '마이크로서비스(MSA) 정책'과 '서버리스(Serverless) 정책'이 하이브리드된 상태로 진화함(RL Update).
|
||||
- **정책 변화(RL Update)**: 이제는 단순 인프라 구조 정책을 넘어, AI 모델이 어떻게 검색 엔진(RAG)과 연결되고 사용자 피드백 정책을 다시 학습 루프(RL)로 넣을 것인지 정의하는 'AI 네이티브 아키텍처 정책'이 경쟁력의 핵심임.
|
||||
### 매 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).
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Scalability|Scalability]], [[SPOF|SPOF]], [[Refinement|Refinement]], [[Technical-Debt|Technical-Debt]], Engineering, [[System-Theory|System-Theory]]
|
||||
- **Modern Patterns**: Microservices, Serverless, Event-driven, Layered architecture.
|
||||
---
|
||||
### 매 quality attributes (ISO 25010)
|
||||
- Performance · Scalability · Availability · Security · Maintainability · Testability · Observability.
|
||||
- 매 trade-off 의 명시 — 매 "all of them" 은 fantasy.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 응용
|
||||
1. Greenfield project 시 C4 L1+L2 먼저, ADR 로 매 decision 기록.
|
||||
2. Legacy reverse engineering — 매 dependency graph 추출 후 component view.
|
||||
3. Architecture review — quality attribute scenario 의 validation.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### C4 diagram (PlantUML)
|
||||
```plantuml
|
||||
@startuml
|
||||
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
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")
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
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
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### ADR template
|
||||
```markdown
|
||||
# ADR 0007: Choose Postgres over MongoDB
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
## Status: Accepted (2026-05-10)
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
## Context
|
||||
Need primary store for order data. Strong consistency required.
|
||||
Team has 5 years Postgres experience.
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
## Decision
|
||||
Postgres 16 with JSONB for flexible product attributes.
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
## 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.
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
## 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 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 |
|
||||
|
||||
Reference in New Issue
Block a user