MySQL, the popular open-source database that’s a standard element in many web application stacks, has unveiled the first release candidate for version 8.0.
Features to be rolled out in MySQL 8.0 include:
- First-class support for Unicode 9.0 out of the box.
- Window functions and recursive SQL syntax, for queries that previously weren’t possible or would have been difficult to write.
- Expanded support for native JSON data and document-store functionality.
With version 8.0, MySQL is jumping several versions in its numbering (from 5.5), due to 6.0 being nixed and 7.0 being reserved for the clustering version of MySQL.
MySQL 8.0’s expected release date
MySQL hasn’t committed to a release date for MySQL 8.0, by MySQL’s policy is “a new [general] release every 18-24 months.” The last general release was October 21, 2015, for MySQL 5.7, so MySQL 8.0’s production version is likely to come in October 2017.
MySQL 8.0’s road to standard Unicode
Moving to Unicode by default is arguably one of the biggest changes planned. MySQL has long had persistent, persnickety problems with Unicode. So, a long standing game plan for MySQL 8.0 was to fix as many of those lingering Unicode issues as possible.
MySQL 8.0 no longer uses latin1
as the default encoding, to discourage new users from choosing a troublesome legacy option. The recommended default character set for MySQL 8.0 is now utf8mb4
, which is intended to be faster than the now-deprecated utf8mb3
character set and also to support more flexible collations and case sensitivity.
The improved Unicode will not only support non-Western character sets but the rise of emoji.
MySQL 8.0 gets current with window functions
Many other implementations of SQL support window functions, a way to perform aggregate calculations across multiple rows while still allowing access to the individual rows from the query. It’s possible to do this in MySQL without window function support in the database, but it’s cumbersome and slow. To overcome its window deficit, MySQL 8.0 adds window functions via the standard OVER
SQL keyword, in much the same way it is implemented in competing products like PostgreSQL.
Another feature in the same vein, recursive common table expressions, lets you perform recursive operations as part of a query, without having to resort to cursors or other performance-sapping workarounds.
MySQL 8.0 works better with documents and JSON
With MySQL 5.7 came JSON support, to make MySQL competitive with NoSQL databases that use JSON natively. MySQL 8.0 expands JSON support with better performance, functions to allow extracting ranges from a JSON query (such as a “top N”-type request), and new aggregation functions that let MySQL-native structured data and semistructured JSON data be merged in a query.
Another improvement related to JSON involve MySQL’s document-store abilities. Reads and writes to MySQL’s document store are transactionally consistent, allowing rollback operations on changes to JSON data. Document data stored in the open GeoJSON format for geospatial data can be indexed, so you can search by proximity.
The other key features in MySQL 8.0
Other changes planned for MySQL 8.0 include:
- More options for how to handle locked rows, via the
SKIP LOCKED
andNOWAIT
keywords.SKIP LOCKED
allows locked rows to be skipped during an operation;NOWAIT
throws an error immediately on encountering a locked row. - MySQL can automatically scale to the total amount of memory available, to make the best possible use of virtual machine deployments.
- Indexes can be manually excluded from the query optimizer via the “invisible index” feature. Indexes marked as invisible are kept up to date with changes to tables, but aren’t used to optimize queries. One suggested use for this is to nondestructively determine if a particular index needs to be kept or not.
Where to download MySQL 8.0
You can download the beta versions of MySQL 8.0 now for Windows, MacOS, several versions of Linux, FreeBSD, and Solaris; the source code is also available. Scroll down the downloads page and go to the Development Releases tab to get them.