docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,168 @@
---
id: wiki-2026-0508-아키텍처-패턴-지식
title: 아키텍처 패턴 지식
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Architecture Patterns, Architectural Styles]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [architecture, patterns, design]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: agnostic
framework: agnostic
---
# 아키텍처 패턴 지식
## 매 한 줄
> **"매 architectural pattern 은 매 recurring problem 의 매 reusable solution 으로, 매 trade-off 가 매 명시되어야 한다"**. Buschmann 의 매 POSA series (1996) 이래로, 매 modern catalog (Richards/Ford 2020, Vernon 2021) 는 매 microservices, event-driven, hexagonal, modular monolith, serverless 를 매 핵심으로 다룬다.
## 매 핵심
### 매 6 fundamental styles
- **Layered (n-tier)**: presentation / business / data.
- **Pipe & filter**: 매 streaming transformation chain.
- **Microkernel (plugin)**: 매 core + 매 extension.
- **Service-based**: 매 monolith → 매 coarse-grained services.
- **Event-driven (broker / mediator)**: 매 async pub/sub.
- **Space-based**: 매 in-memory data grid + 매 messaging.
### 매 modern patterns
- **Hexagonal (Ports & Adapters)**: 매 domain 매 framework-independent.
- **Clean Architecture**: 매 dependency rule (outward → inward).
- **CQRS**: 매 read / write 분리.
- **Event Sourcing**: 매 state = 매 event sequence.
- **Saga**: 매 distributed transaction via 매 compensation.
- **BFF (Backend for Frontend)**: 매 client-specific gateway.
### 매 응용
1. 매 quality attribute → 매 pattern 매 mapping.
2. 매 ADR 에서 매 chosen pattern 명시.
3. 매 fitness function 으로 매 pattern adherence 검증.
## 💻 패턴
### Hexagonal (TypeScript)
```typescript
// domain/order.ts (pure)
export class Order { confirm(): Order { /*...*/ } }
// app/ports.ts
export interface OrderRepo { save(o: Order): Promise<void>; }
export interface PaymentGate { charge(amt: number): Promise<string>; }
// app/place-order.ts (use case)
export class PlaceOrder {
constructor(private repo: OrderRepo, private pay: PaymentGate) {}
async run(cart: Cart): Promise<Order> {
const txn = await this.pay.charge(cart.total);
const order = new Order(cart, txn).confirm();
await this.repo.save(order);
return order;
}
}
// infra/postgres-order-repo.ts (adapter)
export class PgOrderRepo implements OrderRepo { /*...*/ }
```
### Event-driven (Kafka, Java)
```java
@KafkaListener(topics = "orders.placed")
public void onOrderPlaced(OrderPlacedEvent e) {
inventoryService.reserve(e.items());
kafka.send("inventory.reserved",
new InventoryReservedEvent(e.orderId(), e.items()));
}
```
### CQRS (.NET 9)
```csharp
public record PlaceOrderCommand(Guid Id, List<Item> Items);
public record OrderSummaryQuery(Guid Id);
public class CommandHandler : IRequestHandler<PlaceOrderCommand, Unit> {
public async Task<Unit> Handle(PlaceOrderCommand cmd, CancellationToken ct) {
await writeDb.SaveAsync(new Order(cmd));
await bus.PublishAsync(new OrderPlaced(cmd.Id));
return Unit.Value;
}
}
public class QueryHandler : IRequestHandler<OrderSummaryQuery, OrderSummary> {
public Task<OrderSummary> Handle(OrderSummaryQuery q, CancellationToken ct)
=> readReplica.GetAsync<OrderSummary>(q.Id);
}
```
### Saga (orchestration, Temporal)
```python
@workflow.defn
class CheckoutWorkflow:
@workflow.run
async def run(self, order: Order) -> str:
try:
payment = await workflow.execute_activity(charge, order)
inv = await workflow.execute_activity(reserve, order)
ship = await workflow.execute_activity(ship, order)
return ship.tracking_id
except ActivityError:
await workflow.execute_activity(refund, payment)
await workflow.execute_activity(release_inventory, inv)
raise
```
### Modular Monolith (Spring Modulith)
```java
@Modulith(systemName = "Shop", sharedModules = "shared")
@SpringBootApplication
public class ShopApp { }
// inventory/InventoryService.java — package-private
@ApplicationModuleListener
void on(OrderPlaced e) { reserve(e.items()); }
```
## 매 결정 기준
| 상황 | Pattern |
|---|---|
| 매 startup, single team | Modular monolith |
| 매 read >> write | CQRS |
| 매 audit / temporal queries | Event Sourcing |
| 매 cross-service workflow | Saga (Temporal / orchestration) |
| 매 polyglot frontends | BFF |
| 매 high event throughput | Event-driven (Kafka) |
**기본값**: 매 modular monolith 시작 → 매 evidence 기반 매 split.
## 🔗 Graph
- 부모: [[소프트웨어 아키텍처 설계]]
- 변형: [[Microservices]] · [[Cloud_Native|Modular Monolith]] · [[Hexagonal Architecture]]
- 응용: [[CQRS]] · [[Event Sourcing]] · [[Saga]] · [[BFF]]
- Adjacent: [[DDD]] · [[Clean Architecture]]
## 🤖 LLM 활용
**언제**: 매 pattern selection rationale / 매 trade-off 비교 / 매 boilerplate generation.
**언제 X**: 매 final architecture decision — 매 senior architect review 필수.
## ❌ 안티패턴
- **Pattern over-application**: 매 모든 곳 매 microservice.
- **Mixing CQRS + sync read-after-write**: 매 consistency expectation 위반.
- **Saga without compensation test**: 매 partial failure 매 silent.
- **Hexagonal in name only**: 매 domain 매 framework annotations 의 침투.
## 🧪 검증 / 중복
- Verified (Richards & Ford, *Software Architecture: The Hard Parts*; Vernon, *Strategic Monoliths and Microservices*; Buschmann, *POSA Vol 1*).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — hexagonal/CQRS/saga/modulith 패턴 추가 |