Status: [Proposed | Accepted | Rejected | Superseded | Deprecated]
Date: YYYY-MM-DD
Deciders: [Names or roles of decision makers]
Tags: [Optional: e.g., database, performance, security]
What is the issue we're seeing that is motivating this decision or change?
Describe the forces at play:
- Technical constraints
- Business requirements
- Performance considerations
- Team skills
- Cost factors
- Time pressure
Example:
We need globally unique identifiers for distributed entities (Customer, Order, Invoice). Current UUID v4 approach creates random IDs, leading to poor database index performance and difficult debugging (no timestamp information).
What alternatives did we consider?
- Pros: ...
- Cons: ...
- Example: ...
- Pros: ...
- Cons: ...
- Example: ...
- Pros: ...
- Cons: ...
- Example: ...
What is the change that we're proposing and/or doing?
State the decision clearly:
We will use UUID v7 (time-ordered) for all primary keys instead of UUID v4 (random).
Provide implementation details:
- How will this be implemented?
- What components are affected?
- What is the migration path (if applicable)?
Example:
import "github.com/basilex/promenade/pkg/uuidv7"
func NewCustomer() *Customer {
return &Customer{
ID: uuidv7.New(), // Time-sortable UUID
}
}What becomes easier or more difficult to do because of this change?
- Benefit 1
- Benefit 2
- Benefit 3
- Drawback 1
- Drawback 2
- ℹ Consideration 1
- ℹ Consideration 2
How was/will this be rolled out?
- Phase 1: ...
- Phase 2: ...
- Rollback Plan: ...
Example:
All new entities use
uuidv7.New(). Existing entities remain on UUID v4 (no migration needed).
- [Link to RFC, blog post, or documentation]
- [Related ADRs]
- [Related code files]
Example:
Under what conditions should this decision be revisited?
Example:
- If database write performance degrades by >20%
- If UUID v8 becomes widely adopted (better collision resistance)
- If distributed ID generation becomes a bottleneck
| Date | Change | Author |
|---|---|---|
| YYYY-MM-DD | Initial version | Name |
| YYYY-MM-DD | Updated consequences after 6 months | Name |