> BOOLEAN The value of this element is always a single byte. If all the bits in that byte are set to zero (0x00), then the value is FALSE. If one or more of the bytes is set to one, then the value is TRUE. As a result, there are 255 different ways to encode a BOOLEAN value of TRUE, but in practice it is generally encoded as 0xFF (that is, all the bits are set to one).
> Strings (TYPE_STRING) are similar to blobs, except they have an additional 0 termination byte for convenience, and they MUST be UTF-8 encoded (since an accessor in a language that does not support pointers to UTF-8 data may have to convert them to a native string type). I wonder if it is exposed as a different type. Could not find any doc about it.
The UTF-8 encoding/decoding overhead is still paid in FlatBuffers (desinged to support junior gaming developers), but impl is quite tuned and impressive otherwise.
I'd strongly suggest using separte types (if possible) and not to pay penalty of encoding decoding (branch missprediction) specially such serialization optiosn would be used for advanced users i.e. they would understand the difference.
For decent server-side storage you may get inspiration fro HyPer (not trivial, but bleading edge commercial and open source solution).
The whole design is described and sources (not in Java) available and applicable in JVM world starting from 9 (better SIMD support).
The stuff with fizzled pointers and super fast Bloom filters can be appplied in EE/of-heap ;-)