I am rather confused at this time about exactly the number of unique ids MongoDB could generate for any single server.

Obviously, with multiple servers the server portion of their id object would change too, however with just one server the only real parts that will change appear to become the pid section (2 numbers) and also the incrementing section (4 numbers). Correct me if I am wrong relating to this.

With only 6 of the items seem to be hexadecimal numbers altering, I think that you will see only 16,777,216 possible combinations for any single server.

The main reason I'm asking this happens because I'm thinking about using MongoDB to keep vast amounts of unique records, and also the number would continuously grow.

Could it be dependable MongoDB for this kind of job? I apologize if I am made any mathematical errors or logical errors.


You ought to be safe. If you are getting MongoDB itself to create ids, it'll produce a 12-byte value, which 4 bytes are seconds since epoch, and three bytes are counter. This really is sufficient in excess of 7.20 * 10^16 (i.e. 2^(7*8)) documents per server, and/or 16 million (i.e. 2^(3*8)) per server per second.