Use from UUID v4 to UUID v7 for database entity IDs
@dushaniw is already working on this.
Since Feb 20, 2026.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Current Limitation
Current: Using uuid.New() (UUID v4) - random 122-bit identifiers
Proposed: Using uuid.NewV7 (UUID v7) - time-ordered UUIDs with Unix timestamp in first 48 bits
Benefits:
- faster database inserts due to sequential ordering
- smaller B-tree indexes
- Better cache locality and reduced page splits
- Lexicographically sortable by creation time
- Fully backward compatible (both are 36-character strings)
No database migration required - UUID v7 and v4 coexist safely
No API breaking changes - both are 36-character strings
No client changes needed - transparent to external consumers
Suggested Improvement
Move all database entity ID generation from UUID v4 to UUID v7 to improve database performance through time-ordered, sequential UUIDs that reduce B-tree fragmentation and improve insert performance.
Version
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.