DEV Community

Discussion on: What would you use as a sortable, globally unique, ID?

Collapse
 
stegriff profile image
Ste Griffiths

Instagram use a custom scheme (instagram-engineering.com/sharding...) as they need time-sortable unique IDs across multiple DB servers (shards). They implemented it in PL/SQL, composing an ID from the current time, the shard ID, and an auto-increment, giving 1024 IDs per shard per millisecond. Pretty cool, check out the link.

Collapse
 
rhymes profile image
rhymes

It's pretty cool indeed! Thank you! In our case I think it should be abstracted from the DB but that's just an implementation detail