- RT @lawyerist: How to Organize Paperless Client Files https://t.co/n8wsRs5r2W 08:34:42, 2017-05-22
- RT @kemitchell: Software service legal multitool is coming along https://t.co/ZKmmwMOP2s 08:37:39, 2017-05-22
- RT @wpmudev: #WordPress REST API For Dummies https://t.co/8LE5FLsm88 via @wplift 08:40:12, 2017-05-22
- The @caliorg website is down due to a database issue. We are working on it and will have it online again shortly. 09:31:09, 2017-05-22
- @caliorg The website is back online. in reply to emasters 09:43:15, 2017-05-22
Did you know that MySQL 5.7 has a native JSON data type?
MySQL introduced a native JSON data type in MySQL 5.7. So like an integer, a char, or a real, there became a way to store an entire JSON document in a column in a table of a database—and this document in a column could be roughly a gigabyte in size! The server would make sure it was a valid JSON document and then save it in a binary format that’s optimized for searching. This new data type has probably been responsible for more upgrades of MySQL than any other feature.
The data type also comes with over 20 functions. These functions will extract key-value pairs from the document, update data, provide metadata about the data, output non-JSON columns in JSON format, and more. And it’s much easier on the psyche than REGEX.
Source: What you need to know about JSON in MySQL | Opensource.com
Well, I guess I really do need to update to MySQL 5.7 and keep track of what’s going on in version 8 development.
From the MySQL 5.7 docs on the JSON data type:
As of MySQL 5.7.8, MySQL supports a native
JSONdata type provides these advantages over storing JSON-format strings in a string column:
- Automatic validation of JSON documents stored in
JSONcolumns. Invalid documents produce an error.
- Optimized storage format. JSON documents stored in
JSONcolumns are converted to an internal format that permits quick read access to document elements. When the server later must read a JSON value stored in this binary format, the value need not be parsed from a text representation. The binary format is structured to enable the server to look up subobjects or nested values directly by key or array index without reading all values before or after them in the document.
I’ve got a number of project that would benefit from this right now.