Loading...
Loading...
Creates Architecture Decision Records documenting key technical decisions with context, alternatives considered, tradeoffs, consequences, and decision owners. Use when documenting "architecture decisions", "technical choices", "design decisions", or "ADRs".
npx skill4agent add patricio0312rev/skills adr-writer# ADR-001: [Title of Decision]
**Status:** Proposed | Accepted | Deprecated | Superseded by ADR-XXX
**Date:** 2024-01-15
**Deciders:** Alice (Tech Lead), Bob (Principal Engineer)
**Owner:** Alice
## Context
What is the issue we're facing? What factors are driving this decision?
We need to choose a database for our new analytics service. Current
requirements:
- 10M+ events per day
- Complex aggregation queries
- Real-time dashboards
- Budget: $5k/month
- Team familiar with SQL
## Decision
We will use PostgreSQL with TimescaleDB extension.
## Alternatives Considered
### Option 1: PostgreSQL + TimescaleDB (CHOSEN)
**Pros:**
- Team already knows PostgreSQL
- Time-series optimization for analytics
- Reliable and proven
- Good query performance
- Reasonable cost (~$3k/month)
**Cons:**
- Requires manual scaling effort
- Not purpose-built for analytics
### Option 2: ClickHouse
**Pros:**
- Excellent query performance for analytics
- Built for analytics workloads
- Column-oriented storage
**Cons:**
- Team unfamiliar with ClickHouse
- Steeper learning curve
- Different query syntax
### Option 3: BigQuery
**Pros:**
- Fully managed
- Excellent for analytics
- Scales automatically
**Cons:**
- Higher cost (~$8k/month for our volume)
- Vendor lock-in to GCP
- Less control over optimization
## Tradeoffs
**What we're optimizing for:**
- Team velocity (familiar tech)
- Cost efficiency
- Good enough performance
**What we're sacrificing:**
- Peak analytical performance (vs ClickHouse)
- Fully managed experience (vs BigQuery)
## Consequences
### Positive
- Development can start immediately (no learning curve)
- Lower operational costs
- Can reuse existing PostgreSQL expertise
- Easy integration with current stack
### Negative
- Will need to manually optimize queries
- May need to revisit if we scale 10x
- Requires more operational work than BigQuery
### Risks
- Performance may degrade at 100M+ events/day
- **Mitigation:** Monitor query performance, plan migration at 50M events/day
## Implementation Notes
- Use TimescaleDB hypertables for event storage
- Implement continuous aggregates for common queries
- Set up read replicas for dashboard queries
- Document scaling runbook at 50M events/day
## Follow-up Actions
- [ ] Provision PostgreSQL + TimescaleDB cluster (Alice, by 2024-01-20)
- [ ] Create migration script from MySQL (Bob, by 2024-01-22)
- [ ] Set up monitoring dashboards (Alice, by 2024-01-25)
- [ ] Document scaling thresholds (Alice, by 2024-01-30)
## References
- [TimescaleDB Benchmarks](https://example.com)
- [Cost Analysis Spreadsheet](https://docs.google.com/...)
- [Team Survey Results](https://example.com)
## Revision History
- 2024-01-15: Initial draft (Alice)
- 2024-01-16: Added cost analysis (Bob)
- 2024-01-17: Accepted by architecture review boardADR-001: Initial System Architecture
ADR-002: Database Selection for Analytics
ADR-003: Authentication Strategy
...Proposed → Accepted → Implemented
↓
Rejected
Accepted → Deprecated → Superseded by ADR-XXX# 1. Create new ADR
cp templates/adr-template.md docs/adr/ADR-042-title.md
# 2. Fill in sections
# - Context: Why are we making this decision?
# - Decision: What did we decide?
# - Alternatives: What else did we consider?
# - Consequences: What are the impacts?
# 3. Review with team
# - Share in architecture channel
# - Get feedback from stakeholders
# - Iterate on alternatives
# 4. Update status to "Accepted"
# 5. Link from main architecture docs