Couchbase: is there a base64-encoding overhead on storing binary data? -
It is known (see here), that cachebase provides binary data in the form of base-64-encoded document However, using the MapReduce query, does it also store it as base 64? From the perspective of libcouchbase , it takes a byte array + length, does it change into base 64 later? Couchbase storage engine stores your data in the same way (such as you specify the length of the bytes Section) internally. By reading the data using the CRUD key / value API at the protocol level, you get the exact same stream of bytes. This is possible because the low-level key-value protocol is binary on the wire, and therefore there is no problem using all 8 bits of all bytes. Different client SDKs will appear in front of you in different ways. For example: On the other side , the visual API is done with JSON reaction objects on HTTP, can not 8-bit bye directly Changing the data re-encode, so Couchbase require the use of base 64 encoding for visual feedback objects, if they are binary data. (As a side, this is one reason why the minimum amount of an index
four * buffer and
length .
emit is required, for example the key of the key of the interest , Then actually use the CRUD key / value interface to get the document - the key / value interface is not base 64 overhead when the data is returned.
Comments
Post a Comment