|
Eliot Horowitz made changes - Jul 29 2009 09:05 PM UTC
Eliot Horowitz made changes - Jul 29 2009 09:08 PM UTC
Eliot: faster lookups and, mainly, data size. Many of my collections contain millions of documents that store basicly a lot of _ids of others documents, so _id size matters a lot.
so, my general feelings:
- int auto increment is to small these days - long is 8 bytes - ObjectId is 12, so not too much bigger - with ObjectId you can get sharding, which is more beneficial What are your thoughts on these?
Eliot Horowitz made changes - Oct 17 2009 10:18 AM UTC
Size matters, but sharding is more important. I'd like auto-incrementing numbers too but not at the cost of sharding.
Also, if size is the real issue it seems like some kinds of optimization with key-names is more important than the difference between 8/12 bytes. For example, if I am storing objects where I might have a millions (or billions) of documents with 15-40 key-value pairs of ints (32bit values) then the overhead of storing the key-name in each document becomes significant. For every key-value pair there may be 3-8 charaters (8-chars (8-bit) = 64bits) + 1 int (32bit) which makes the key-name twice as big as the data. Anyway, you see where I'm going... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
why do you need this rather that a guid (like ObjectId)?