You're basically implementing an optimized version of ObjectId for your use case and having to take a couple stabs at it as well. No big deal, but there are just lots of little tricks like that to learn with MongoDB.
"My stuff wouldn't work on PostgreSQL at all, I have so much data that I must use sharding."
We had to implement sharding as well and chose to do it manually in PostgreSQL. Luckily our schema made that relatively easy and natural. YMMV
"My stuff wouldn't work on PostgreSQL at all, I have so much data that I must use sharding."
We had to implement sharding as well and chose to do it manually in PostgreSQL. Luckily our schema made that relatively easy and natural. YMMV