I am planning to store a json_encoded
string on my database. I can't precisely tell the length its going to be, but I'm pretty sure it will be long. My concern is which field type I am going to use for this, is it blob
or text
?
I prefer the one where I can save space as much as possible over fast searching, in any case I have other column where I should just index.
As stated in the documentation of MySQL, since 5.7.8 a native JSON data type is supported.
The JSON data type provides these advantages over storing JSON-format strings in a string column:
So, as the MySQL documentation states, the JSON data type should be used and not the text.