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 JSON data type that enables efficient access to data in JSON (JavaScript Object Notation) documents. The JSON data type provides these advantages over storing JSON-format strings in a string column:

  • Automatic validation of JSON documents stored in JSON columns. Invalid documents produce an error.
  • Optimized storage format. JSON documents stored in JSON columns 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.

linkedin/rest.li: Rest.li is a REST+JSON framework for building robust, scalable service architectures using dynamic discovery and simple asynchronous APIs.

Rest.li is an open source REST framework for building robust, scalable RESTful architectures using type-safe bindings and asynchronous, non-blocking IO. Rest.li fills a niche for applying RESTful principals at scale with an end-to-end developer workflow for buildings REST APIs that promotes clean REST practices, uniform interface design and consistent data modeling.

https://github.com/linkedin/rest.li

From the folks at LinkedIn. I found it interesting that many tech based companies are open sourcing their architectures. These systems are like today’s assembly lines, everyone has one, each is a little different, and all produce.