We currently support encoding RecordId strings at the end of a KeyString for secondary index support on clustered collections.
The current encoding is designed to be read in reverse from the end of the string. The 1-byte size is appended at the end, preceded by the string contents. The current string encoding only supports encoding strings up to 127 bytes long, or what fits in 7 bits.
Extend the encoding to support larger strings. Use the unused high bit as a continuation bit that indicates the presence of a preceding size byte. Continue encoding right-to-left until there are no more size bytes remaining with continuation bits.