NUID vs UUIDv7 #1370
              
  
  Closed
              
          
                  
                    
                      magicprinc
                    
                  
                
                  started this conversation in
                Ideas
              
            
            
              NUID vs UUIDv7
            
            #1370
          
          
        Replies: 1 comment
-
| The little I know about NUID is that it is supposed to be extremely fast to generate and it is used by the server and clients in every language. There is nothing to prevent a developer from using UUID for their own purpose. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Why reinvent the wheel 🤷♀️
UUIDv7 (RFC 9562) https://uuid7.com/
✅ Time-ordered and sortable: Embeds a 48-bit Unix timestamp, making UUIDv7 naturally sortable by creation time, which improves database index locality and query efficiency.
✅ Improved database performance: Time ordering reduces B-tree page splits and write amplification, leading to faster inserts (about 35% faster than UUIDv4) and quicker range queries.
✅ Reduced collision risk: Combines timestamp with 74 bits of randomness, ensuring uniqueness even at very high ID generation rates without needing centralized coordination.
✅ Direct timestamp retrieval: The embedded timestamp allows easy extraction of creation time from the UUID itself, aiding debugging and time-based analytics.
✅ Scalable for high throughput: Supports generating billions of identifiers per millisecond with sub-millisecond ordering bits, ideal for distributed systems and IoT.
Java UUIDv7 implementations
1️⃣ https://github.com/cowtowncoder/java-uuid-generator
2️⃣ https://github.com/ebean-orm/ebean-uuidv7
😭
https://bugs.openjdk.org/browse/JDK-8334015
https://bugs.openjdk.org/browse/JDK-8357251
Beta Was this translation helpful? Give feedback.
All reactions