Image

2

JSON as String Data vs. JSON as a Data Type

Developers were using JSON in MySQL long before there was a MySQL JSON data type in version 5.7. There is nothing special about JSON that keeps it from being used in earlier versions of MySQL, and there are cases where not using the MySQL data type is preferred. This may seem confusing or contradictory but all will be explained later in this chapter.

JSON String Data

In versions of MySQL released before version 5.7, developers were storing JSON in MySQL in text fields (such as CHAR, VARCHAR, TEXT, or BLOB). And this remains a viable option for developers running versions of MySQL prior to version ...

Get MySQL and JSON: A Practical Programming Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.