I'm new to MongoDB and am wondering how to decide to store some cryptographic hashes. Should I store the binary data itself, as a blob
, or should I store its string representation as a string
?
My instinct is to just use a string and be done with it, but I'm not sure if this is the best approach. A blob would take up less space, for example.
- Is there any negative impact, coding-wise, of using a
blob
(i.e. harder to pass around or reference objects?) - Are there any "gotchas" if the
_id
of a document is ablob
? - Is there any benefit of using a
blob
at all?
_id
without any problems._id
is indexed, so the index becomes bigger and potentially slower.