Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
hanszarkov
· 2y ago · 0 comments
I've used the BSON Java ObjectId for distributed primary key generation for a long time. Really useful for distributed systems.
Comments
[–]
salil999
2y ago
It's specifically advised NOT to use ObjectId for distribution. This data type has a notion of time embedded in it which results in monotonically increasing ObjectIds. Use UUID or a hashed version of the ObjectId