|
| 1 | +# Architecture Decision Records (ADRs) |
| 2 | + |
| 3 | +This directory contains Architecture Decision Records (ADRs) for the Torrust Tracker Demo project. |
| 4 | + |
| 5 | +## What are ADRs? |
| 6 | + |
| 7 | +Architecture Decision Records document important architectural decisions made during the project |
| 8 | +lifecycle. They provide context, rationale, and consequences of decisions that affect the |
| 9 | +system's structure, behavior, or development process. |
| 10 | + |
| 11 | +## ADR Guidelines |
| 12 | + |
| 13 | +### When to Create an ADR |
| 14 | + |
| 15 | +Create an ADR for decisions that: |
| 16 | + |
| 17 | +- **Affect multiple system components** or development workflows |
| 18 | +- **Have significant long-term implications** for the project |
| 19 | +- **Involve trade-offs** between different approaches |
| 20 | +- **Need to be communicated** to the team and future contributors |
| 21 | +- **May be questioned** or reversed in the future |
| 22 | + |
| 23 | +### When NOT to Create an ADR |
| 24 | + |
| 25 | +Avoid creating ADRs for: |
| 26 | + |
| 27 | +- **Implementation details** specific to a single component |
| 28 | +- **Temporary workarounds** or quick fixes |
| 29 | +- **Obvious technical choices** with no reasonable alternatives |
| 30 | +- **Operational procedures** (use operational documentation instead) |
| 31 | + |
| 32 | +### ADR Structure |
| 33 | + |
| 34 | +Each ADR should follow this template: |
| 35 | + |
| 36 | +```markdown |
| 37 | +# ADR-XXX: [Decision Title] |
| 38 | + |
| 39 | +## Status |
| 40 | + |
| 41 | +[Proposed | Accepted | Deprecated | Superseded] |
| 42 | + |
| 43 | +## Context |
| 44 | + |
| 45 | +[Describe the problem, constraints, and forces at play] |
| 46 | + |
| 47 | +## Decision |
| 48 | + |
| 49 | +[State the decision clearly and concisely] |
| 50 | + |
| 51 | +## Alternatives Considered |
| 52 | + |
| 53 | +[List other options that were considered and why they were rejected] |
| 54 | + |
| 55 | +## Rationale |
| 56 | + |
| 57 | +[Explain why this decision was made] |
| 58 | + |
| 59 | +## Consequences |
| 60 | + |
| 61 | +### Positive |
| 62 | + |
| 63 | +- [List benefits and positive outcomes] |
| 64 | + |
| 65 | +### Negative |
| 66 | + |
| 67 | +- [List costs, risks, and negative impacts] |
| 68 | + |
| 69 | +### Neutral |
| 70 | + |
| 71 | +- [List neutral consequences and trade-offs] |
| 72 | + |
| 73 | +## Implementation Details |
| 74 | + |
| 75 | +[Optional: Include relevant implementation specifics] |
| 76 | + |
| 77 | +## Monitoring |
| 78 | + |
| 79 | +[How will we measure if this decision is working] |
| 80 | + |
| 81 | +## Related Decisions |
| 82 | + |
| 83 | +[Link to related ADRs] |
| 84 | + |
| 85 | +## References |
| 86 | + |
| 87 | +[Links to supporting documentation, discussions, etc.] |
| 88 | +``` |
| 89 | + |
| 90 | +## Lessons Learned |
| 91 | + |
| 92 | +### Keep ADRs Focused |
| 93 | + |
| 94 | +**❌ Bad Practice**: Mixing multiple unrelated decisions in a single ADR |
| 95 | + |
| 96 | +**✅ Good Practice**: Each ADR should address a single architectural decision |
| 97 | + |
| 98 | +**Example**: ADR-005 originally mixed sudo cache management with SSH host key verification. |
| 99 | +These are separate infrastructure concerns and should be documented separately: |
| 100 | + |
| 101 | +- Sudo cache management → ADR (architectural decision) |
| 102 | +- SSH host key verification → Operational documentation (troubleshooting guide) |
| 103 | + |
| 104 | +### Separate Concerns by Type |
| 105 | + |
| 106 | +| Documentation Type | Purpose | Location | Example | |
| 107 | +| ------------------------ | ------------------------------ | ---------------------- | ------------------- | |
| 108 | +| **ADR** | Record architectural decisions | `docs/adr/` | Database choice | |
| 109 | +| **Operational Docs** | Solve immediate problems | `docs/infrastructure/` | SSH troubleshooting | |
| 110 | +| **Implementation Plans** | Detail feature implementation | `docs/issues/` | Development plans | |
| 111 | +| **User Guides** | End-to-end workflows | `docs/guides/` | Testing procedures | |
| 112 | + |
| 113 | +### Scope and Audience |
| 114 | + |
| 115 | +- **ADRs**: For contributors understanding design decisions |
| 116 | +- **Operational Docs**: For users encountering specific problems |
| 117 | +- **Guides**: For users following complete procedures |
| 118 | + |
| 119 | +## Current ADRs |
| 120 | + |
| 121 | +### 📋 Active ADRs |
| 122 | + |
| 123 | +- [ADR-001: Makefile Location](001-makefile-location.md) - Decision to keep |
| 124 | + Makefile at repository root level |
| 125 | +- [ADR-002: Docker for All Services](002-docker-for-all-services.md) - Decision |
| 126 | + to use Docker for all services including UDP tracker |
| 127 | +- [ADR-003: Use MySQL Over MariaDB](003-use-mysql-over-mariadb.md) - Decision |
| 128 | + to use MySQL instead of MariaDB for database backend |
| 129 | +- [ADR-004: Configuration Approach Files vs Environment Variables] |
| 130 | + (004-configuration-approach-files-vs-environment-variables.md) - |
| 131 | + Configuration approach decision for application settings |
| 132 | +- [ADR-005: Sudo Cache Management for Infrastructure Operations] |
| 133 | + (005-sudo-cache-management-for-infrastructure-operations.md) - |
| 134 | + Proactive sudo cache management for better UX during testing |
| 135 | + |
| 136 | +### 📊 ADR Statistics |
| 137 | + |
| 138 | +- **Total ADRs**: 5 |
| 139 | +- **Status**: All Accepted |
| 140 | +- **Coverage**: Infrastructure (3), Application (1), Development Workflow (1) |
| 141 | + |
| 142 | +## Contributing |
| 143 | + |
| 144 | +### Creating a New ADR |
| 145 | + |
| 146 | +1. **Identify the decision** that needs documentation |
| 147 | +2. **Check existing ADRs** to avoid duplication |
| 148 | +3. **Determine ADR number** (next sequential number) |
| 149 | +4. **Use the template** provided above |
| 150 | +5. **Focus on a single decision** - avoid mixing multiple concerns |
| 151 | +6. **Get team review** before marking as "Accepted" |
| 152 | +7. **Update this README** to include the new ADR in the list |
| 153 | + |
| 154 | +### Updating Existing ADRs |
| 155 | + |
| 156 | +- **Status changes**: Update status from "Proposed" to "Accepted" |
| 157 | +- **Superseding**: When replacing an ADR, update the old one's status to "Superseded" |
| 158 | +- **References**: Add references when decisions are implemented or referenced |
| 159 | + |
| 160 | +### Best Practices |
| 161 | + |
| 162 | +1. **Write for the future**: Assume readers don't have current context |
| 163 | +2. **Include alternatives**: Show what options were considered |
| 164 | +3. **Be honest about trade-offs**: Document both benefits and costs |
| 165 | +4. **Keep it concise**: Focus on the decision, not implementation details |
| 166 | +5. **Link related decisions**: Cross-reference related ADRs |
| 167 | +6. **Update when necessary**: ADRs can evolve as understanding improves |
| 168 | + |
| 169 | +## Templates and Examples |
| 170 | + |
| 171 | +- **Template**: Use the structure outlined in "ADR Structure" above |
| 172 | +- **Good Examples**: ADR-001 (clear trade-offs), ADR-003 (thorough alternatives analysis) |
| 173 | +- **Lessons Learned**: See ADR-005 for an example of how to keep focused scope |
| 174 | + |
| 175 | +## Related Documentation |
| 176 | + |
| 177 | +- [Main Documentation Guide](../README.md) - Overall documentation structure |
| 178 | +- [Infrastructure Documentation](../../infrastructure/docs/) - Infrastructure-specific docs |
| 179 | +- [Application Documentation](../../application/docs/) - Application-specific docs |
| 180 | +- [Guides](../guides/) - End-to-end procedures and workflows |
0 commit comments