I'm developing a system with a "Group" collection and many other document collections that need to refer to this Group document. There will only ever be ~10,000 groups, so using the 12-byte ObjectId leads to bloat in the size of these other collections.
I would ideally like a sort of cut-down ObjectId that can still be generated on distributed nodes and have a high chance of uniqueness but be maybe 6 bytes in size. I'm thinking just:
- a 2-byte machine identifier,
- a 2-byte process id,
- a 2-byte hash of the seconds since the Unix epoch
Does something like this exist? or is this just a bad idea?
Update: I understand my suggestion above would lose the ability to sort by date.