Object IDs are more synergistic with sharding and distribution.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
One thing to note is that the ObjectIDs are actually created by the
client. If you have multiple clients (potentially on multiple
machines) you will be less likely to have "_id" collisions using
ObjectIDs because of the structure of an ObjectID.
In the context of
sharding specifically (ignoring all the other issues previously
mentioned in this thread) an ObjectID won't necessarily work better
than a sequence and obviously isn't more compact than an int64.
Sequence Numbers
Traditional databases often use monotonically increasing sequence numbers for primary keys. In MongoDB, the preferred approach is to use Object IDs instead. Object IDs are more synergistic with sharding and distribution.
+1. Jared's reply explains architectural aspects precisely.