Mongo UUIDs vs ObjectId creation and performance

I am considering using UUIDs v1 for my document indexes instead of ObjectId. I am concerned about performance and uncertainty about the best way to migrate to uuids.

My performance comes from comments about ObjectIDs which are more efficient with b-tree / indexing. What performance issues am I looking at?

My other problem is a unique factor. I am creating an API for storing public documents and will eventually have to consider sharding. And there is this document from Mongo on the issues with the uniqueness and outlines of ObjectIDs.

I am not entirely clear what problems this ability to check for uniqueness between shards can cause and if it would create problems for my situation. (basically people can create documents from a website or API and search for them the same way. I'd say let's think about millions of documents for the sake of this question. I'm more worried about selections and then lots of parallel inserts).

There seems to be pros and cons for both types of IDs. Can anyone please clarify this?

+3
mongodb


source to share


No one has answered this question yet

See similar questions:

sixteen
Using UUID instead of ObjectID in MongoDB

or similar:

682
How to list all collections in mongo shell?
sixteen
Using UUID instead of ObjectID in MongoDB
15
Using UUID in mongoose to reference ObjectID
nine
How to create a globally unique GUID / UUID system for Mongo with Python?
3
Custom Mongo ObjectId for Inserts
1
Providing a unique index in the assembled Mongo collection
1
How to query UUID field in mongodb using mgo (golang client)?
0
Taking hours to repeat 300 million mongo db records
0
what creates the default ObjectID in mongodb?
0
Converting Parse objectId to Mongo ObjectId?



All Articles
Loading...
X
Show
Funny
Dev
Pics