writing-adrs
Writing Architecture Decision Records
What is an ADR?
An Architecture Decision Record captures an important architectural decision along with its context and consequences.
When to Write an ADR
- Choosing a framework or library
- Selecting a database or storage solution
- Defining API patterns
- Establishing coding conventions
- Making infrastructure decisions
- Any decision that affects multiple components
ADR Structure
Title
Short phrase describing the decision.
Status
- Proposed: Under discussion
- Accepted: Decision made
- Rejected: Considered but not adopted
- Deprecated: No longer valid
- Superseded: Replaced by another ADR
Context
What is the situation? What forces are at play?
Decision
What is the change we're making?
Rationale
Why is this the best choice?
Consequences
What are the trade-offs? Both positive and negative.
Example ADR
# ADR: Use PostgreSQL for Primary Database
## Status
Accepted
## Context
We need a database for our new service. Requirements:
- ACID transactions
- JSON support
- Strong ecosystem
- Team familiarity
## Decision
We will use PostgreSQL 15+ as our primary database.
## Rationale
- Mature, reliable RDBMS
- Excellent JSON support with JSONB
- Strong extension ecosystem (pgvector, PostGIS)
- Team has deep PostgreSQL experience
- Well-supported by all cloud providers
## Consequences
### Positive
- Reliable, battle-tested technology
- Rich feature set
- Easy to find developers
### Negative
- Vertical scaling has limits
- Requires careful connection management
- More operational overhead than managed NoSQL
Best Practices
- Keep them short: 1-2 pages max
- Write when deciding: Not after the fact
- Include alternatives: Show what was considered
- Update status: Mark deprecated/superseded ADRs
- Number sequentially:
ADR-001,ADR-002, etc.
More from nguyenhuuca/assessment
compliance
Ensure regulatory compliance. Use when implementing GDPR, HIPAA, PCI-DSS, or SOC2 requirements. Covers compliance frameworks and controls.
17requirements-analysis
Analyze and refine product requirements. Use when clarifying scope, identifying gaps, or validating requirements. Covers requirement types and analysis techniques.
16security-review
Conduct security code reviews. Use when reviewing code for vulnerabilities, assessing security posture, or auditing applications. Covers security review checklist.
13identity-access
Implement identity and access management. Use when designing authentication, authorization, or user management. Covers OAuth2, OIDC, and RBAC.
12execution-roadmaps
Create execution roadmaps for projects. Use when planning multi-phase projects or feature rollouts. Covers phased delivery and milestone planning.
12cloud-native-patterns
Apply cloud-native architecture patterns. Use when designing for scalability, resilience, or cloud deployment. Covers microservices, containers, and distributed systems.
12