Search code examples
mysqljsonbase64blobvarchar

MySQL BLOB or VARCHAR?


I have to store a whole form data at about 300 000 times. Pls do not ask why. ;)

So, I have a JSON serialized form data with about 20-30 simple fields.

What do you think, which is more efficient? May I have to store this JSON base64 encoded in a VARCHAR or gzcompressed in a BLOB?

I know the difference between VARCHAR and BLOB, but the base64 quite bigger than a gzcompressed json. FYI: The bas64 encoded form is about 2.3K while the same data gzcompressed is only 420 bytes.

It isnt neccessary to search inside these forms, just store them.

thx


Solution

  • MySQL actually has a JSON data type.