Architecture Decision Record (ADR) Template
Lightweight Nygard-style ADR: status, context, decision, consequences, alternatives, related decisions, lifecycle and log
उपयोग कैसे करें: Use it for architecturally significant decisions that are hard to reverse but do not need scored options (use MADR for that). Write the context neutrally before the decision. The main pitfall is editing an accepted ADR instead of superseding it with a new one.
प्रीव्यू
ADR-[NNNN]: [Short decision title in the active voice]
Lightweight architecture decision record in the format popularised by Michael Nygard ("Documenting Architecture Decisions", 2011): title, status, context, decision and consequences, extended here with alternatives considered and related decisions. Use it for decisions that are significant but do not need the structured option scoring of the MADR template (
dev/madr).
| Field | Value |
|---|---|
| ID | ADR-[NNNN] |
| Status | [Proposed / Accepted / Rejected / Deprecated / Superseded by ADR-NNNN] |
| Date | YYYY-MM-DD |
| Deciders | [@name, @name] |
| Consulted | [@name] |
| Tags | [architecture, storage, api] |
| Supersedes | [ADR-NNNN or none] |
When to write an ADR
Write an ADR when a decision is architecturally significant: it is hard or expensive to reverse, it affects several teams or components, or someone will later ask "why did we do it this way?". Typical triggers:
- Choosing a framework, database, message broker, cloud service or major library.
- Changing a public API style, data format, protocol or authentication method.
- Setting a cross-cutting rule, such as how errors are logged or how services talk.
- Accepting a known trade-off, such as eventual consistency or a vendor dependency.
- Deliberately not doing something that people will keep proposing.
Do not write an ADR for choices that are local, cheap to change or already dictated by an existing standard; a code comment or pull request description is enough.
Lifecycle
An ADR moves through a small set of states. Only the deciders named in the record can accept or reject it, normally after review in a pull request or an architecture meeting.
| Status | Meaning | Who changes it |
|---|---|---|
| Proposed | Under discussion; may still change | Author |
| Accepted | In force; the system should conform | Deciders |
| Rejected | Considered and declined; kept for history | Deciders |
| Deprecated | No longer applies, with no direct replacement | Deciders |
| Superseded | Replaced by a newer ADR, linked in the status | Author of the new ADR |
Context
[Describe the issue that motivates this decision and the forces that shape it, including constraints and facts that cannot be changed.]
Example: The editor stores documents in the browser using IndexedDB. Users ask for revision history, and today every save overwrites the previous version. Average document size is 18 KB; heavy users keep about 400 documents and save every few seconds while typing. Browser storage quotas vary by browser and can be as low as a few hundred megabytes on some mobile devices. We must not send document content to a server.
Decision
We will [decision in one or two sentences].
Example: We will store revisions as full snapshots in a separate IndexedDB table, created at most once every 5 minutes of active editing and on explicit save, and keep the latest 50 revisions per document, pruning older ones automatically. Revisions are stored locally only.
Consequences
What becomes easier or harder because of this decision.
Positive
- Example: Simple to implement and to restore; any revision is readable on its own.
- Example: No server and no change to the privacy model.
Negative
- Example: Storage grows to roughly per heavily edited document, about 360 MB in the worst case for 400 documents; quota handling is required.
- Example: Diffs between revisions must be computed on demand.
Follow-up actions
- [Action, owner, due date], Example: add a quota warning in Settings, @dev, YYYY-MM-DD.
- [Action, owner, due date]
Alternatives considered
| Alternative | Summary | Why not chosen |
|---|---|---|
| Example: Store diffs (patches) between revisions | Smaller storage, about 10% of snapshots | Restoring requires replaying chains; corruption of one patch breaks later revisions |
| Example: Keep every save | Complete history | Storage grows without bound for users who type continuously |
| Example: Sync revisions to a server | Unlimited storage | Breaks the local-first, zero-collection principle |
| [Alternative] | [Summary] | [Reason] |
Related decisions
| ADR | Relationship | Note |
|---|---|---|
| Example: ADR-0003 Use IndexedDB through Dexie for local storage | Depends on | Revisions use the same database |
| Example: ADR-0011 Autosave debounce interval | Related | Revision interval builds on autosave events |
| [ADR-NNNN] | [Depends on / Supersedes / Superseded by / Conflicts with] | [Note] |
ADR log
The log lists every ADR with its current status.
| ID | Title | Status | Date | Superseded by |
|---|---|---|---|---|
| ADR-0001 | Example: Record architecture decisions | Accepted | YYYY-MM-DD | |
| ADR-0003 | Example: Use IndexedDB through Dexie for local storage | Accepted | YYYY-MM-DD | |
| ADR-0007 | Example: Render Markdown with a custom parser | Superseded | YYYY-MM-DD | ADR-0009 |
| ADR-0009 | Example: Render Markdown with a unified/remark pipeline | Accepted | YYYY-MM-DD | |
| ADR-[NNNN] | [Title] | [Status] | YYYY-MM-DD | [ADR-NNNN] |
Standard and licence note
Based on the architecture decision record format described by Michael Nygard in "Documenting Architecture Decisions" (2011): title, status, context, decision and consequences, extended with alternatives, related decisions and an ADR log as commonly practised. The text is original to this collection and reproduces none of the source article. Template licence: MIT.
संबंधित टेम्पलेट
AGENTS.md Template for AI Coding Agents
Repository instructions for AI coding agents: setup, build and test commands, conventions, architecture map, PR and security rules
सॉफ़्टवेयर और इंजीनियरिंगAI Coding Assistant Policy Template
Policy for AI coding assistants and agents: autonomy levels, tool register, secrets, sandboxing, review of generated code, provenance, OWASP ASI and SSDF mapping
सॉफ़्टवेयर और इंजीनियरिंगREST Endpoint Reference Template
One REST endpoint: auth, parameter tables, request example, responses per status, RFC 9457 errors, limits, idempotency, paging, deprecation headers