If I have a MongoDB sharded cluster with multiple MongoS instances, will my ObjectID in _id be consistant whichever MongoS I write to?
For example, if I write some data from MongoS#1 and the _id ascends normally, if I then write using MongoS#2 will these _id's also ascend in line with the other writes?
Seeing as part of ObjectID is based on the machine hash and the process id, I can't see that this will so sorting on the ObjectID would be useless. Correct?
Whats the recomendation here?
How the ObjectId is generated would give you a fair idea about your query.
if you type this in your mongo console,
you would see the ObjectId sample value as
Now, lets break and see how mongo generates this. 558bf61f 9f49f3 03f7 2dd59b
http://api.mongodb.org/libbson/current/bson_oid_t.html
So, for sure however mongos you are connected with, as the time goes on it would be in ascending order only (because of the first point) the other points ensure that its always a unique number. Hope it clarifies your doubt.
-$