MySQL 8.0.21 includes several new features and enhancements:
1) It allows disabling of the InnoDB redo log at runtime to improve performance while loading initial data.
2) The JSON_VALUE function was added to extract scalar values from JSON documents.
3) CREATE TABLE...SELECT statements are now atomic and crash-safe operations.
4) Per-user comments and attributes can now be set when creating or updating MySQL user accounts.
2. www.dasini.net/blog/en/
Me, Myself & I
➢
MySQL Geek
✔ Addicted to MySQL for 15+ years!
✔ Playing with databases for 20+ years
➢
MySQL Writer, Blogger and Speaker
✔ Also former : DBA, Consultant, Architect, Trainer, ...
➢
MySQL Principal Solutions Architect EMEA at Oracle
➢
Stay tuned! :
✔ Twitter : @freshdaz
✔ Blog : www.dasini.net/blog/en
Olivier DASINI
3. www.dasini.net/blog/en/
The following is just a summary of the MySQL 8.0.21 new features.
For a more thorough and exhaustive view please read the following :
➢
The MySQL 8.0.21 Maintenance Release is Generally Available
✔ https://mysqlserverteam.com/the-mysql-8-0-21-maintenance-release-is-generally-available/
➢
Changes in MySQLMySQL 8.0.21 (2020-07-13, General Availability)
✔ https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-21.html
➢
Changes in MySQL ShellMySQL Shell 8.0.21 (2020-07-13, General Availability)
✔ https://dev.mysql.com/doc/relnotes/mysql-shell/8.0/en/news-8-0-21.html
➢
Changes in MySQL RouterMySQL Router 8.0.21 (2020-07-13, General Availability)
✔ https://dev.mysql.com/doc/relnotes/mysql-router/en/news-8-0-21.html
➢
Changes in MySQL NDB ClusterMySQL NDB Cluster 8.0.21 (2020-07-13, General Availability)
✔ https://dev.mysql.com/doc/relnotes/mysql-cluster/8.0/en/news-8-0-21.html
And especially the MySQL team Blogs :
➢
https://mysqlserverteam.com/
➢
https://mysqlhighavailability.com/
➢
https://mysqlrelease.com/
➢
http://insidemysql.com/
Disclaimer
5. www.dasini.net/blog/en/
Highlights
8
Runtime Disabling InnoDB Redo Log
JSON_VALUE function
CREATE TABLE... SELECT statement is atomic
Per-user Comments & Attributes
MySQL Document Store Enhancements
MySQL Shell Enhancements
MySQL Router Enhancements
MySQL InnoDB Cluster Enhancements
MySQL Group Replication Enhancements
Thanks to the Contributors
7. www.dasini.net/blog/en/
Runtime Disabling InnoDB Redo Log
➢
Support for disabling and enabling InnoDB redo log dynamically
➢
Makes all write operation to the database faster
✔ The primary use case is while loading initial data to a mysqld instance
━
1. Disable redo logging
━
2. Load data
━
3. Enable redo logging
➢
Intended only for loading data into a new MySQL instance
➢
/! Do not disable redo logging on a production system
10
JS> sql ALTER INSTANCE DISABLE INNODB REDO_LOG;
JS> util.loadDump('/backup/dump_20200815/properties')
Loading DDL and Data from '/backup/dump_20200815/properties' using 4 threads.
Target is MySQL 8.0.21. Dump was produced from MySQL 8.0.21
...
188 chunks (10.00M rows, 2.52 GB) for 1 tables in 1 schemas were loaded in 6 min 2 sec (avg throughput 6.96 MB/s)
0 warnings were reported during the load.
JS> sql ALTER INSTANCE ENABLE INNODB REDO_LOG;
10. www.dasini.net/blog/en/
JSON_VALUE function
➢
Ease index creation of JSON values
✔ Extract scalar value at the specified path from the given JSON document and return it
as the specified type
➢
This function is described in SQL 2016, chapter 6.27
13
Resources
➢
JSON_VALUE(json_doc, path)
✔ https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-value
➢
JSON_VALUE() now in MySQL 8.0.21
✔ https://elephantdolphin.blogspot.com/2020/07/jsonvalue-now-in-mysql-8021.html
➢
WL#12228 - Add JSON_VALUE function
✔ https://dev.mysql.com/worklog/task/?id=12228
12. www.dasini.net/blog/en/
CREATE TABLE... SELECT statement is atomic
➢
Now an atomic and crash-safe operation
✔ Logged as one transaction in the binary log when row-based replication is in use
━
On storage engines that support atomic DDL
✔ Either be committed or rolled back.
➢
Safe for row-based replication and permitted for use with GTID-based replication
✔ Enable its execution in MySQL Group Replication as atomic operation
15
Resources
➢
CREATE TABLE ... SELECT Statement
✔ https://dev.mysql.com/doc/refman/8.0/en/create-table-select.html
➢
Atomic Data Definition Statement Support
✔ https://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html
➢
WL#13355 - Make CREATE TABLE...SELECT atomic and crash-safe
✔ https://dev.mysql.com/worklog/task/?id=13355
14. www.dasini.net/blog/en/
Per-user Comments & Attributes
➢
You can now set per-user comments and attributes when creating or updating
MySQL user accounts
➢
User comment:
✔ Arbitrary text passed as the argument to a COMMENT clause
➢
User attribute:
✔ Data in the form of a JSON object passed as the argument to an ATTRIBUTE clause
✔ Can contain any valid key-value pairs in JSON object notation
17
CREATE USER 'olivier'@'localhost' COMMENT 'Power User';
ALTER USER 'olivier'@'localhost' ATTRIBUTE '{"FirstName": "Olivier", "LastName": "Dasini",
"Blog": "www.dasini.net/blog/en/"}';
SELECT User, Host, User_attributes FROM mysql.user WHERE User='olivier' AND Host='localhost'G
*************************** 1. row ***************************
User: olivier
Host: localhost
User_attributes: {"metadata": {"Blog": "www.dasini.net/blog/en/", "comment": "Power User",
"LastName": "Dasini", "FirstName": "Olivier"}}
15. www.dasini.net/blog/en/
Per-user Comments & Attributes
18
Resources
➢
CREATE USER Overview
✔ https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-overview
➢
The INFORMATION_SCHEMA USER_ATTRIBUTES Table
✔ https://dev.mysql.com/doc/refman/8.0/en/information-schema-user-attributes-table.html
➢
WL#13562 - CREATE/ALTER USER COMMENT 'JSON'
✔ https://dev.mysql.com/worklog/task/?id=13562
17. www.dasini.net/blog/en/
MySQL Document Store Enhancements
JSON Schema validation
➢
Collections can be configured to verify documents against a JSON schema
➢
Enable you to require that documents have a certain structure before they can be inserted
or updated in a collection
➢
Can be used from SQL or through the X DevAPI
20
Resources
➢
JSON Schema Validation
✔ https://dev.mysql.com/doc/x-devapi-userguide/en/collection-validation.html
➢
JSON Schema
✔ http://json-schema.org/
19. www.dasini.net/blog/en/
MySQL Shell Enhancements
Logical Dump Utilities
➢
Instance dump: dumpInstance()
✔ Dump an entire database instance, including users
➢
Schema dump: dumpSchemas()
✔ Dump a set of schemas
➢
Support the export of all schemas or a selected schema from an on-premise MySQL server
instance into a set of local files or an Oracle Cloud Infrastructure Object Storage bucket
➢
The schemas can then be imported into a MySQL Database Service DB System using MySQL
Shell's new dump loading utility
➢
Provide Oracle Cloud Infrastructure Object Storage streaming, MySQL Database Service
compatibility checks and modifications, parallel dumping with multiple threads, and file
compression
22
20. www.dasini.net/blog/en/
MySQL Shell Enhancements
Logical Load Utility
➢
Load a dump: loadDump()
✔ Load a dump into a target database
➢
Support the import of schemas dumped using MySQL Shell's new instance dump utility and
schema dump utility into a MySQL instance or a MySQL Database Service DB System
➢
The dump loading utility provides data streaming from remote storage, parallel loading of
tables or table chunks, progress state tracking, resume and reset capability, and the option
of concurrent loading while the dump is taking place
23
21. www.dasini.net/blog/en/
MySQL Shell Enhancements
24
Resources
➢
Instance Dump Utility and Schema Dump Utility
✔ https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-dump-instance-schema.html
➢
Dump Loading Utility
✔ https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-load-dump.html
➢
MySQL Shell Dump & Load part 1: Demo!
✔ https://mysqlserverteam.com/mysql-shell-dump-load-part-1-demo/
➢
MySQL Shell Dump & Load part 2: Benchmarks
✔ https://mysqlserverteam.com/mysql-shell-dump-load-part-2-benchmarks/
➢
MySQL Shell Dump & Load part 3: Load Dump
✔ https://mysqlserverteam.com/mysql-shell-dump-load-part-3-load-dump/
➢
MySQL Shell Dump & Load part 4: Dump Instance & Schemas
✔ https://mysqlserverteam.com/mysql-shell-8-0-21-speeding-up-the-dump-process/
➢
MySQL Shell 8.0.20 – What’s New?
✔ https://mysqlserverteam.com/mysql-shell-8-0-20-whats-new/
22. www.dasini.net/blog/en/
MySQL Shell Enhancements
Tagging the Metadata
➢
Generic tags
✔ A user configurable tag framework, to allow specific instances of an InnoDB Cluster or an InnoDB
ReplicaSet to be marked with additional information
✔ The idea is to use predefined tags to let the user define the specific behavior required from the
metadata user (MySQL Router for example)
✔ Tags can be any ASCII character and provide a namespace
➢
Specific tags
✔ Enable you to mark instances as hidden and remove them from routing
✔ See “MySQL Router Enhancements”
25
Resources
➢
Tagging the Metadata
✔ https://dev.mysql.com/doc/refman/8.0/en/admin-api-tagging.html
➢
MySQL Shell AdminAPI – What’s new in 8.0.21?
✔ https://mysqlserverteam.com/mysql-shell-adminapi-whats-new-in-8-0-21/
24. www.dasini.net/blog/en/
MySQL Router Enhancements
Hide instances from client traffic
➢
Support for the InnoDB Cluster & InnoDB ReplicaSet metadata "tags" property:
✔ _hidden: A boolean that indicates if the node should be hidden
━
true makes the node hidden, while false or any other value considers it not hidden
✔ _disconnect_existing_sessions_when_hidden: A boolean that indicates if the existing
connections to the node should be dropped in case the node is hidden
━
false means existing connections to hidden nodes are not disconnected while true or any other value
means the opposite
➢
Hidden instances only affect user connections; the instance remains available to Router
when performing tasks such as fetching metadata and calculating the quorum
27
Resources
➢
Hiding instances on MySQL InnoDB Cluster/ReplicaSet
✔ https://mysqlserverteam.com/hiding-instances-on-mysql-innodb-cluster-replicaset/
➢
WL#13787 - Support hiding instances from applications
✔ https://dev.mysql.com/worklog/task/?id=13787
26. www.dasini.net/blog/en/
InnoDB Cluster Enhancements
29
Hide & mark nodes on MySQL InnoDB Cluster/ReplicaSet
➢
Tagging framework to the AdminAPI which:
✔ Allow to temporarily hide instances from client traffic without actually changing the topology of the
cluster
✔ Allow specific instances to be marked with additional information
Resources
➢
Hiding instances on MySQL InnoDB Cluster/ReplicaSet
✔ https://mysqlserverteam.com/hiding-instances-on-mysql-innodb-cluster-replicaset/
➢
Tagging the Metadata
✔ https://dev.mysql.com/doc/refman/8.0/en/admin-api-tagging.html
28. www.dasini.net/blog/en/
Group Replication Enhancements
Default response to network partitions has changed
➢
Goal is to reduce the need for manual user intervention, to bring a node back, whenever
there is a temporary network partition or a server slowdown
➢
group_replication_member_expel_timeout = 5 (instead of 0)
✔ Defer the expulsion of the member
➢
group_replication_autorejoin_tries = 3 (instead of 0)
✔ Enable member auto-rejoin
Binary Log Checksums Support for Group Replication
➢
You can use Group Replication with binary log event checksums turned on
✔ i.e. binlog-checksum=NONE is no more required
➢
Makes archiving, backing up the binary logs & distributed recovery more resilient when it
comes to validity and integrity checking
Specify Recovery IP Addresses
➢
Specify which IPs and ports are used during distributed recovery
✔ Control the flow of the recovery traffic in the network infrastructure - for stability or security reasons
✔ New system variable: group_replication_advertise_recovery_endpoints
34
29. www.dasini.net/blog/en/
Group Replication Enhancements
35
Resources
➢
MySQL 8.0.21 Replication Enhancements
✔ https://mysqlhighavailability.com/mysql-8-0-21-replication-enhancements/
➢
MySQL Group Replication – Default response to network partitions has changed
✔ https://mysqlhighavailability.com/mysql-group-replication-default-response-to-network-partitions-has-changed/
➢
WL#13706 - Increase default group_replication_autorejoin_tries
✔ https://dev.mysql.com/worklog/task/?id=13706
➢
WL#13773 - Increase default group_replication_member_expel_timeout
✔ https://dev.mysql.com/worklog/task/?id=13773
➢
You Can Now Use Binary Log Checksums with Group Replication
✔ https://mysqlhighavailability.com/you-can-now-use-binary-log-checksums-with-group-replication/
➢
WL#9038 - Group Replication: Support Binary Log Checksums
✔ https://dev.mysql.com/worklog/task/?id=9038
➢
Specify Recovery IP Addresses in Group Replication
✔ https://mysqlhighavailability.com/specify-recovery-ip-addresses-in-group-replication/
➢
group_replication_advertise_recovery_endpoints
✔ https://dev.mysql.com/doc/refman/8.0/en/group-replication-options.html#sysvar_group_replication_advertise_recovery_endpoints
➢
WL#13767 - Group Replication: specify through which endpoints can recovery traffic flow
✔ https://dev.mysql.com/worklog/task/?id=13767
31. www.dasini.net/blog/en/
Thanks To The Contributors
Daniël van Eeden
Edgars Irmejs
Facebook
Fungo Wang
Jeremy Cole
41
If you have patches you would like to contribute you can do so from :
➢
MySQL’s GitHub repository : https://github.com/mysql
➢
Requires signing the Oracle Contributor Agreement :
https://www.oracle.com/technetwork/community/oca-486395.html
➢
MySQL 8.0.21: thank you for the contributions
✔ https://lefred.be/content/mysql-8-0-21-thank-you-for-the-contributions/
Lou Shuai
Quanan Han
Tsubasa Tanaka
Wenfeng Shih
Billy O'Neal (MySQL Router)
32. www.dasini.net/blog/en/
The Complete List Of New Features In MySQL 8.0
42
There are 250+ new features in MySQL 8.0...
https://mysqlserverteam.com/the-complete-list-of-new-features-in-mysql-8-0/