I have a table with a VARCHAR(10240) column. I have a Java application which store a list of Strings to that table column as a comma separated value.
But now I want to compress that String and store it in the same column to comply with the storage requirements and constraints. Most of the SO questions and answers for similar questions suggest to change the table column type to BLOB or a binary safe type.
Result of the compression is most of the time a Binary data, so we might need a binary oriented type. But can we encode that binary data with Base64 or something and store it.Refer this also.
String -> compress -> Binary data (byte[]) -> encode Base64 -> store in VARCHAR
And can we have something like below for decompress that,
VARCHAR -> decode base64 -> Binary data (byte[]) -> decompress -> String
Trick is I can't change that column into BLOB or anything, I need to use the column as VARCHAR(10240) and store the compressed data there. Is there anyway to achieve this ?