--- id: wiki-2026-0508-decisions title: Architecture Decision Records (ADR) category: 10_Wiki/Topics status: verified canonical_id: self aliases: [ADR, Decision Log, Architecture Decisions] duplicate_of: none source_trust_level: A confidence_score: 0.9 verification_status: applied tags: [adr, architecture, decisions, documentation, engineering] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: markdown framework: adr-tools --- # Architecture Decision Records (ADR) ## 매 한 줄 > **"매 immutable record of architectural choices, written in the moment of decision"**. Michael Nygard 가 2011 년 originally proposed; 2026 modern engineering org 의 standard practice — single ADR file per decision, append-only, version-controlled in repo alongside code. ## 매 핵심 ### 매 ADR file 구조 - **Title**: short noun phrase (e.g., "Use PostgreSQL for transactional store"). - **Status**: Proposed → Accepted → Deprecated → Superseded. - **Context**: forces 와 constraints 의 background. - **Decision**: what we will do — active voice, declarative. - **Consequences**: positive / negative / neutral trade-offs. ### 매 lifecycle - ADR 는 immutable — supersede 하려면 new ADR 작성, old 의 status 를 `Superseded by ADR-N` 로 update. - PR review 의 part — engineering team 의 collective signoff. - ADR-001 부터 sequential numbering, 절대 renumbering 안 함. ### 매 응용 1. Microservices boundary 의 결정 (e.g., service split rationale). 2. Data store / message queue 의 선택 (Postgres vs DynamoDB). 3. Auth flow / API style (REST vs GraphQL vs gRPC). 4. Build tooling / CI 의 stack lock-in. ## 💻 패턴 ### Nygard ADR template (md) ```markdown # ADR-007: Adopt PostgreSQL for primary OLTP ## Status Accepted (2026-05-08) ## Context We need an ACID-compliant store for orders. Read/write ratio is 3:1, peak 2k QPS. Team has Postgres ops experience; Aurora / RDS managed offering available. ## Decision We will use Amazon RDS for PostgreSQL 16 as the primary OLTP store. ## Consequences + Strong consistency, mature ecosystem. + Existing in-house expertise reduces ramp. - Vendor lock-in to AWS RDS. - Need to manage VACUUM tuning at >10M rows/table. ``` ### MADR template (richer variant) ```markdown --- status: accepted date: 2026-05-08 deciders: [alice, bob, carol] consulted: [security-team] informed: [eng-all] --- # Use Kafka for event bus ## Context and Problem Statement How do we propagate domain events across 8 microservices? ## Considered Options - Kafka - RabbitMQ - AWS SNS/SQS ## Decision Outcome Chosen: Kafka, because durable replay + partition ordering matter. ### Positive Consequences - Replayable history (compaction). - High throughput (>1M msg/s). ### Negative Consequences - Operational complexity (ZK / KRaft). ``` ### adr-tools CLI workflow ```bash # Init in repo adr init doc/adr # Create new ADR adr new "Use Postgres for OLTP" # -> doc/adr/0007-use-postgres-for-oltp.md # Supersede old decision adr new -s 3 "Replace MongoDB with Postgres" # -> auto-marks ADR-0003 as Superseded ``` ### Lightweight in-PR ADR (modern variant) ```markdown ## Decision Record - **Choice**: - **Why now**: - **Alternatives considered**: - **Trade-offs accepted**: ``` ### ADR index generation (CI script) ```python # scripts/build_adr_index.py import re, pathlib adrs = sorted(pathlib.Path("doc/adr").glob("[0-9]*.md")) lines = ["# ADR Index\n"] for f in adrs: title = next(l[2:].strip() for l in f.read_text().splitlines() if l.startswith("# ")) status = re.search(r"## Status\n(\w+)", f.read_text()).group(1) lines.append(f"- [{f.stem}]({f.name}) — {title} ({status})") pathlib.Path("doc/adr/README.md").write_text("\n".join(lines)) ``` ## 매 결정 기준 | 상황 | Approach | |---|---| | Solo / prototype | Skip ADR — overhead > benefit | | Team ≥ 3, multi-quarter project | Nygard ADR mandatory | | Regulated env (FDA, SOC2) | MADR + sign-off metadata | | Very fast-moving startup | In-PR lightweight ADR | | Architecture review board | MADR with `consulted` / `informed` | **기본값**: Nygard ADR in `doc/adr/`, accepted via PR review, supersession over deletion. ## 🔗 Graph - 부모: [[Software_Architecture_Patterns]] · [[소프트웨어_설계_원칙_및_디자인_패턴|Engineering_Principles]] - 응용: [[Microservices_Architecture]] · [[Codebase_Onboarding]] - Adjacent: [[Pull_Request_and_Issue_Tracking]] ## 🤖 LLM 활용 **언제**: Engineering team ≥ 3, decisions have multi-month consequences, onboarding context value matters. **언제 X**: Personal project, throwaway prototype, decisions reversible in <1 day. ## ❌ 안티패턴 - **Edit history erasure**: ADR 를 mutate — supersession chain 의 의도 가 lost. - **Decision-by-Slack**: ADR 없이 채팅 만 의 합의 — 6 개월 후 누구 도 rationale 모름. - **Over-documentation**: 매 trivial choice 의 ADR — signal-to-noise drops. - **Status drift**: Accepted ADR 가 production 의 actual state 와 diverge — periodic audit 필요. ## 🧪 검증 / 중복 - Verified (Michael Nygard 2011 original post; ThoughtWorks Tech Radar "Adopt"; AWS / Spotify / GitHub public ADR repos). - 신뢰도 A. ## 🕓 Changelog | 날짜 | 변경 | |---|---| | 2026-05-08 | Phase 1 | | 2026-05-10 | Manual cleanup — full ADR taxonomy + Nygard/MADR templates + adr-tools workflow |