SlideShare a Scribd company logo
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
https://www.facebook.com/groups/hkmysqlusergroup/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What's New in MySQL 8.0
HKOSCon 2017
Ryusuke Kajiyama / 梶山隆輔
MySQL Global Business Unit
MySQL Sales Consulting Senior Manager, Asia Pacific & Japan
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Innovation: 5.7 -> 8.0
- 3x Better Performance
- Replication Enhancements
- Optimizer Cost Model
- JSON Support
- Improved Security
- Sys & Performance Schema
- GIS
MySQL 5.7 (GA)
MySQL InnoDB Cluster (GA)
- MySQL Group Replication
- MySQL Router
- MySQL Shell
MySQL 8.0 (DMR)
- Data Dictionary
- Roles
- Unicode
- CTEs
- Window Functions
- Security
- Replication
- SysSchema
- GIS
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
100%
6
Virtually all organizations require
their most critical systems to be
highly available
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
7
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
“High Availability becomes a core
first class feature of MySQL!”
GA
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 8
MySQL InnoDB Cluster: Vision
“A single product — MySQL — with high availability and scaling
features baked in; providing an integrated end-to-end solution
that is easy to use.”
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• One Product: MySQL
– All components created together
– Tested together
– Packaged together
• Flexible and Modern
– SQL and NoSQL together
– Protocol Buffers
– Asynchronous API
– Developer friendly
9
• Easy to Ue
– One client: MySQL Shell
– Easy packaging
– Integrated orchestration
– Homogenous servers
• Support Read/Write Scale Out
– Sharded clusters
– Federated system of N replica sets
• Supporting cross shard operations
– Each replica set manages a shard
MySQL InnoDB Cluster: Goals
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Powers the Web
10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 11
Evolution Driving Roadmap: 1995 vs 2017
There was no
local. Now
everything is
contextual to
me as a user.
The internet was
global, but full of
silos. Now we are
more connected
than ever.
In the past APIs
were cumbersome,
powered by SOAP
and XML-RPC.
There is now an
increased focus on
privacy and
protecting
information.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• Switched to
Boost.Geometry
library
• R+Tree Indexes for
InnoDB
• Spatial Types for
InnoDB
• Optimized InnoDB
Temporary Tables
• Optimized Packed
Sort Buffer
• Switched InnoDB to
DYNAMIC row format
by default
• Native JSON Data
Type
• 20+ JSON Functions
• Generated Columns
for Functional Index
• JSON Comparator
• Short-hand JSON
operators
• Secure by Default
• Password Expiry
• Password Policy
• Remove old
password hash
• Encrypted
Tablespaces, TDE
(Enterprise)
• Firewall (Enterprise)
• Audit (Enterprise)
12
Evolution Driving Roadmap: MySQL 5.7 Recap
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• Geography support
• Spatial Reference
Systems (SRS)
Support
• SQL/MM Information
Schema views
• Standard compliant
axis ordering in
import/export
functions
• Utf8mb4 as default
• Up to 16x Faster
Performance
• Based on Unicode 9.0
• New collations with
Accent/Case
sensitivity
• Japanese Collation
• Aggregate, table and
Pretty print
Functions
• Sort Performance
Improvements
• Optimizer support for
in-place update
• JSON Shell
• Roles
• Encrypted REDO Logs
and UNDO space
• Finer grained system
privileges
• Atomicity in Privilege
statements
13
Evolution continued in MySQL 8.0
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14
0
45000
90000
135000
180000
8 16 64 128 512 1024
SELECT DISTINCT_RANGES
0
10000
20000
30000
40000
8 16 64 128 512 1024
OLTP RO
0
7500
15000
22500
30000
8 16 64 128 512 1024
OLTP RW
MySQL 8.0 vs MySQL 5.7 utf8mb4
+300-350% in OLTP RO
+176-233% in OLTP RW
+1500-1800% in SELECT DISTINCT_RANGES
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• Increased Reliability
• Built on InnoDB
– No FRM files
– No DB.OPT files
– No TRG files
– No TRN files
– No PAR files
– MyISAM not required
• Atomic DDL
– Better Replication
– Simplifies server edge cases
• MDL for Foreign Keys
• Flexible Metadata API
– Easier path to adding new features
• Better cross-platform experience
– No dependencies on filesystem
semantics
15
MySQL 8.0: Native Data Dictionary
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 16
MySQL Data Dictionary before MySQL 8.0
Data Dictionary
Files
FRM TRG OPT
System Tables (mysql.)
user procevents
InnoDB System Tables
MyISAM
File system
InnoDB
SQL
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17
Transactional Data Dictionary in MySQL 8.0
Data Dictionary
InnoDB
SQL
DD TableDD TableDD Table
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
New! MySQL Roles
Improving MySQL Access Controls
• Introduced in the 8.0.0 DMR
• Easier to manage user and applications rights
• As standards compliant as practically possible
• Multiple default roles
• Can export the role graph in GraphML
18
Feature Request
from DBAs
Directly
In directly
Set Role(s)
Default Role(s)
Set of
ACLS
Set of
ACLS
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
New! InnoDB Redo and Undo Encryption
• AES 256 encryption
• Encrypted when redo/undo log data is written to disk
• Decryption occurs when redo/undo log data is read from disk
• Once redo/undo log data is read into memory, it is in unencrypted form.
• Two tiered encryption – like Innodb tablepace encryption
– Fast key rotation, high performance
• Easy to use
– Enabled using innodb_redo_log_encrypt and innodb_undo_log_encrypt
19
Feature Request
from DBAs
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0: Boosts Developer Productivity
• New! CTEs and Recursive CTEs
• New! Window Functions
• New! SKIP LOCKED and NOWAIT
• UUIDs and Bitwise Functions
20
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Hierarchy Traversal
21
Employee database
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(100),
manager_id INT,
FOREIGN KEY (manager_id)
REFERENCES employees(id) );
INSERT INTO employees VALUES
(333, "Yasmina", NULL), # CEO
(198, "John", 333), # John reports to 333
(692, "Tarek", 333),
(29, "Pedro", 198),
(4610, "Sarah", 29),
(72, "Pierre", 29),
(123, "Adil", 692);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Hierarchy Traversal
22
List reporting chain
WITH RECURSIVE
emp_ext (id, name, path) AS (
SELECT id, name, CAST(id AS CHAR(200))
FROM employees
WHERE manager_id IS NULL
UNION ALL
SELECT s.id, s.name,
CONCAT(m.path, ",", s.id)
FROM emp_ext m JOIN employees s
ON m.id=s.manager_id )
SELECT * FROM emp_ext ORDER BY path;
id name path
333 Yasmina 333
198 John 333,198
692 Tarek 333,692
29 Pedro 333,198,29
123 Adil 333,692,123
4610 Sarah 333,198,29,4610
72 Pierre 333,198,29,72
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Window function example
23
PARTITION == disjoint
set of rows in result set
name dept_id salary dept_total
Newt NULL 75000 75000
Dag 10 NULL 370000
Ed 10 100000 370000
Fred 10 60000 370000
Jon 10 60000 370000
Michael 10 70000 370000
Newt 10 80000 370000
Lebedev 20 65000 130000
Pete 20 65000 130000
Jeff 30 300000 370000
Will 30 70000 370000
Sum up total salary for each department:
SELECT name, dept_id, salary,
SUM(salary) OVER (PARTITION BY
dept_id) AS dept_total
FROM employee
ORDER BY dept_id, name;
The OVER keyword
signals a window function
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 24
MySQL 8.0: Better Handing of Hot Rows
SELECT seat_no
FROM seats
JOIN seat_rows USING ( row_no )
WHERE seat_no IN (3,4)
AND seat_rows.row_no IN (12)
AND booked = 'NO'
FOR UPDATE OF seats SKIP LOCKED
FOR SHARE OF seat_rows NOWAIT;
Non deterministically
skip over locked rows
Error immediately
if a row is already
locked
Feature Request
from Developers
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0: Makes Managing Scale Easier
• Greater density per server
• Operator Friendliness
• Increased Reliability
• New! Improved Replication Throughput
25
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• Storage engines:
– Estimate for how much of data and
indexes are in a memory buffer
– Estimate for hit rate for memory buffer
• Optimizer cost model:
– Take into account whether data is
already in memory or need to be read
from disk
Memory Buffer Aware Cost Estimates
Server
Storage
engine
Disk data
Query
executor
Database
buffer
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0: Performance Schema
• SQL error instrumentation
• Indexes
• Configuration Variables
• New! Data Locks
• New! Histograms
27
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Performance Comparison
28
0. 10. 20. 30. 40.
Query Time MySQL 8.0
MySQL 5.7
Over 30x faster!
SELECT * FROM sys.session
1000 active sessions
Time in Seconds (Lower is better)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0: Invisible Indexes
• Indexes are “hidden” to the MySQL Optimizer
– Not the same as “disabled indexes”
– Contents are fully up to date and maintained by DML
• Two use cases:
– Soft Delete (Recycle Bin)
– Staged Rollout
29
Feature Request
from DBAs
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0: Persist Configuration
• Persist GLOBAL Server Variables
– SET PERSIST max_connections = 500;
• Examples Include:
– Offline_mode
– Read_Only
• Requires no filesystem access
• New! Captures timestamp and change user
30
Cloud Friendly
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
All these features plus…
• Source code now documented with
Doxygen
• Plugin Infrastructure!
• Expanded GIS Support
• Expanded Query Hints Support
• Improved Scan Query Performance
• Improved BLOB Storage
• Improved Memcached Interface
• Cost Model Improvements
• Scalability Improvements
• Atomicity in Privileges
• Parser Refactoring
• Improvements to Temporary Tables
• C++11 and Toolchain Improvements
• GTID_PURGED always settable
• Persistent Auto Increment
• Native InnoDB Data dictionary
• Improved Information Schema performance
• New! SQL Grouping Function
• New! Optimizer Trace detailed sort statistics
• New! Descending Indexes
• New! Smaller Package Downloads
• New! JSON Aggregate, Pretty print functions
• New! JSON performance improvements
• New! Expanded Query Hints
• New! Improved usability of cost constant
configuration
• Group Replication in 8.0
• New! Transaction Save Point support in
Group Replication
• New! Improved Replication Applier Lag
Statistics in Performance Schema
• New! Per Multi-source Channel Replication
Filters
• New! Atomic DDL extended to the Binary
Log
• New! Performance Improvements on the
Replication Applier
• New! Parallel Replication Applier Policy
• New! Binary Log Management
Enhancements
• New! Additional Metadata Into the Binary
Log
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
What's New in MySQL 8.0 @ HKOSC 2017

More Related Content

PDF
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
PDF
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
PDF
MySQL for Software-as-a-Service (SaaS)
PDF
MySQL InnoDB Cluster and NDB Cluster
PDF
MySQL 5.7 InnoDB Cluster (Jan 2018)
PDF
MySQL Day Paris 2016 - State Of The Dolphin
PDF
MySQL High Availability -- InnoDB Clusters
PDF
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL for Software-as-a-Service (SaaS)
MySQL InnoDB Cluster and NDB Cluster
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL Day Paris 2016 - State Of The Dolphin
MySQL High Availability -- InnoDB Clusters
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster

What's hot (20)

PDF
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
PDF
20171104 hk-py con-mysql-documentstore_v1
PPTX
MySQL 8.0 Released Update
PDF
MySQL InnoDB Cluster - Group Replication
PDF
My sql crashcourse_2012
PDF
MySQL Shell - The Best MySQL DBA Tool
PDF
My sql crashcourse_intro_kdl
PDF
Why MySQL High Availability Matters
PDF
MySQL Technology Overview
PDF
MySQL 8.0 InnoDB Cluster demo
PDF
My sql susecon_crashcourse_2012
PDF
20190817 coscup-oracle my sql innodb cluster sharing
PDF
2012 scale replication
PDF
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
PDF
MySQL Cloud Service Deep Dive
PDF
MySQL Day Paris 2016 - MySQL Enterprise Edition
PDF
Case Study: MySQL migration from latin1 to UTF-8
PDF
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
PDF
2012 replication
PDF
2012 ohiolinuxfest replication
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
20171104 hk-py con-mysql-documentstore_v1
MySQL 8.0 Released Update
MySQL InnoDB Cluster - Group Replication
My sql crashcourse_2012
MySQL Shell - The Best MySQL DBA Tool
My sql crashcourse_intro_kdl
Why MySQL High Availability Matters
MySQL Technology Overview
MySQL 8.0 InnoDB Cluster demo
My sql susecon_crashcourse_2012
20190817 coscup-oracle my sql innodb cluster sharing
2012 scale replication
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL Cloud Service Deep Dive
MySQL Day Paris 2016 - MySQL Enterprise Edition
Case Study: MySQL migration from latin1 to UTF-8
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
2012 replication
2012 ohiolinuxfest replication
Ad

Similar to What's New in MySQL 8.0 @ HKOSC 2017 (20)

PPTX
MySQL 8.0 in a nutshell
PPTX
State ofdolphin short
PDF
MySQL Innovation: from 5.7 to 8.0
PDF
MySQL Innovation from 5.7 to 8.0
PDF
MySQL Community Meetup in China : Innovation driven by the Community
PPTX
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
PDF
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
PDF
MySQL 8.0.1 DMR
PDF
Oracle Open World Middle East - MySQL 8 a Giant Leap for SQL
PDF
MySQL 8: Ready for Prime Time
PDF
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
PPTX
cPanel now supports MySQL 8.0 - My Top Seven Features
PDF
20180420 hk-the powerofmysql8
PDF
MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019
PPTX
MySQL 8.0 Featured for Developers
PDF
Mysql8for blr usercamp
PDF
the State of the Dolphin - October 2020
PPTX
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
PDF
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
PDF
Developers' mDay 2017. - Bogdan Kecman Oracle
MySQL 8.0 in a nutshell
State ofdolphin short
MySQL Innovation: from 5.7 to 8.0
MySQL Innovation from 5.7 to 8.0
MySQL Community Meetup in China : Innovation driven by the Community
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL 8.0.1 DMR
Oracle Open World Middle East - MySQL 8 a Giant Leap for SQL
MySQL 8: Ready for Prime Time
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
cPanel now supports MySQL 8.0 - My Top Seven Features
20180420 hk-the powerofmysql8
MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019
MySQL 8.0 Featured for Developers
Mysql8for blr usercamp
the State of the Dolphin - October 2020
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
Developers' mDay 2017. - Bogdan Kecman Oracle
Ad

More from Ivan Ma (13)

PDF
Exploring MySQL Operator for Kubernetes in Python
PDF
20201106 hk-py con-mysql-shell
PDF
20200613 my sql-ha-deployment
PDF
20191001 bkk-secret-of inno-db_clusterv1
PDF
20190615 hkos-mysql-troubleshootingandperformancev2
PDF
20161029 py con-mysq-lv3
PDF
20160821 coscup-my sql57docstorelab01
PDF
Hkosc group replication-lecture_lab07
PDF
20151010 my sq-landjavav2a
PDF
01 demystifying mysq-lfororacledbaanddeveloperv1
PDF
Exploring mysql cluster 7.4
PDF
20150110 my sql-performanceschema
PDF
20141011 my sql clusterv01pptx
Exploring MySQL Operator for Kubernetes in Python
20201106 hk-py con-mysql-shell
20200613 my sql-ha-deployment
20191001 bkk-secret-of inno-db_clusterv1
20190615 hkos-mysql-troubleshootingandperformancev2
20161029 py con-mysq-lv3
20160821 coscup-my sql57docstorelab01
Hkosc group replication-lecture_lab07
20151010 my sq-landjavav2a
01 demystifying mysq-lfororacledbaanddeveloperv1
Exploring mysql cluster 7.4
20150110 my sql-performanceschema
20141011 my sql clusterv01pptx

Recently uploaded (20)

PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
Project and change Managment: short video sequences for IBA
PPTX
NORMAN_RESEARCH_PRESENTATION.in education
PPTX
Research Process - Research Methods course
PPTX
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
PPTX
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
Hydrogel Based delivery Cancer Treatment
PPTX
Human Mind & its character Characteristics
PPTX
An Unlikely Response 08 10 2025.pptx
PPTX
Lesson-7-Gas. -Exchange_074636.pptx
PPTX
fundraisepro pitch deck elegant and modern
DOCX
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
PPTX
Impressionism_PostImpressionism_Presentation.pptx
PPTX
Tour Presentation Educational Activity.pptx
PPTX
worship songs, in any order, compilation
PDF
Instagram's Product Secrets Unveiled with this PPT
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
PPT
First Aid Training Presentation Slides.ppt
DOC
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
nose tajweed for the arabic alphabets for the responsive
Project and change Managment: short video sequences for IBA
NORMAN_RESEARCH_PRESENTATION.in education
Research Process - Research Methods course
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
The Effect of Human Resource Management Practice on Organizational Performanc...
Hydrogel Based delivery Cancer Treatment
Human Mind & its character Characteristics
An Unlikely Response 08 10 2025.pptx
Lesson-7-Gas. -Exchange_074636.pptx
fundraisepro pitch deck elegant and modern
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
Impressionism_PostImpressionism_Presentation.pptx
Tour Presentation Educational Activity.pptx
worship songs, in any order, compilation
Instagram's Product Secrets Unveiled with this PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
First Aid Training Presentation Slides.ppt
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证

What's New in MySQL 8.0 @ HKOSC 2017

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | https://www.facebook.com/groups/hkmysqlusergroup/
  • 2. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | What's New in MySQL 8.0 HKOSCon 2017 Ryusuke Kajiyama / 梶山隆輔 MySQL Global Business Unit MySQL Sales Consulting Senior Manager, Asia Pacific & Japan
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Innovation: 5.7 -> 8.0 - 3x Better Performance - Replication Enhancements - Optimizer Cost Model - JSON Support - Improved Security - Sys & Performance Schema - GIS MySQL 5.7 (GA) MySQL InnoDB Cluster (GA) - MySQL Group Replication - MySQL Router - MySQL Shell MySQL 8.0 (DMR) - Data Dictionary - Roles - Unicode - CTEs - Window Functions - Security - Replication - SysSchema - GIS
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 100% 6 Virtually all organizations require their most critical systems to be highly available
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 7 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate “High Availability becomes a core first class feature of MySQL!” GA
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 8 MySQL InnoDB Cluster: Vision “A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use.”
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • One Product: MySQL – All components created together – Tested together – Packaged together • Flexible and Modern – SQL and NoSQL together – Protocol Buffers – Asynchronous API – Developer friendly 9 • Easy to Ue – One client: MySQL Shell – Easy packaging – Integrated orchestration – Homogenous servers • Support Read/Write Scale Out – Sharded clusters – Federated system of N replica sets • Supporting cross shard operations – Each replica set manages a shard MySQL InnoDB Cluster: Goals
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Powers the Web 10
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 11 Evolution Driving Roadmap: 1995 vs 2017 There was no local. Now everything is contextual to me as a user. The internet was global, but full of silos. Now we are more connected than ever. In the past APIs were cumbersome, powered by SOAP and XML-RPC. There is now an increased focus on privacy and protecting information.
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • Switched to Boost.Geometry library • R+Tree Indexes for InnoDB • Spatial Types for InnoDB • Optimized InnoDB Temporary Tables • Optimized Packed Sort Buffer • Switched InnoDB to DYNAMIC row format by default • Native JSON Data Type • 20+ JSON Functions • Generated Columns for Functional Index • JSON Comparator • Short-hand JSON operators • Secure by Default • Password Expiry • Password Policy • Remove old password hash • Encrypted Tablespaces, TDE (Enterprise) • Firewall (Enterprise) • Audit (Enterprise) 12 Evolution Driving Roadmap: MySQL 5.7 Recap
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • Geography support • Spatial Reference Systems (SRS) Support • SQL/MM Information Schema views • Standard compliant axis ordering in import/export functions • Utf8mb4 as default • Up to 16x Faster Performance • Based on Unicode 9.0 • New collations with Accent/Case sensitivity • Japanese Collation • Aggregate, table and Pretty print Functions • Sort Performance Improvements • Optimizer support for in-place update • JSON Shell • Roles • Encrypted REDO Logs and UNDO space • Finer grained system privileges • Atomicity in Privilege statements 13 Evolution continued in MySQL 8.0
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14 0 45000 90000 135000 180000 8 16 64 128 512 1024 SELECT DISTINCT_RANGES 0 10000 20000 30000 40000 8 16 64 128 512 1024 OLTP RO 0 7500 15000 22500 30000 8 16 64 128 512 1024 OLTP RW MySQL 8.0 vs MySQL 5.7 utf8mb4 +300-350% in OLTP RO +176-233% in OLTP RW +1500-1800% in SELECT DISTINCT_RANGES
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • Increased Reliability • Built on InnoDB – No FRM files – No DB.OPT files – No TRG files – No TRN files – No PAR files – MyISAM not required • Atomic DDL – Better Replication – Simplifies server edge cases • MDL for Foreign Keys • Flexible Metadata API – Easier path to adding new features • Better cross-platform experience – No dependencies on filesystem semantics 15 MySQL 8.0: Native Data Dictionary
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 16 MySQL Data Dictionary before MySQL 8.0 Data Dictionary Files FRM TRG OPT System Tables (mysql.) user procevents InnoDB System Tables MyISAM File system InnoDB SQL
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17 Transactional Data Dictionary in MySQL 8.0 Data Dictionary InnoDB SQL DD TableDD TableDD Table
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | New! MySQL Roles Improving MySQL Access Controls • Introduced in the 8.0.0 DMR • Easier to manage user and applications rights • As standards compliant as practically possible • Multiple default roles • Can export the role graph in GraphML 18 Feature Request from DBAs Directly In directly Set Role(s) Default Role(s) Set of ACLS Set of ACLS
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | New! InnoDB Redo and Undo Encryption • AES 256 encryption • Encrypted when redo/undo log data is written to disk • Decryption occurs when redo/undo log data is read from disk • Once redo/undo log data is read into memory, it is in unencrypted form. • Two tiered encryption – like Innodb tablepace encryption – Fast key rotation, high performance • Easy to use – Enabled using innodb_redo_log_encrypt and innodb_undo_log_encrypt 19 Feature Request from DBAs
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0: Boosts Developer Productivity • New! CTEs and Recursive CTEs • New! Window Functions • New! SKIP LOCKED and NOWAIT • UUIDs and Bitwise Functions 20
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Hierarchy Traversal 21 Employee database CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR(100), manager_id INT, FOREIGN KEY (manager_id) REFERENCES employees(id) ); INSERT INTO employees VALUES (333, "Yasmina", NULL), # CEO (198, "John", 333), # John reports to 333 (692, "Tarek", 333), (29, "Pedro", 198), (4610, "Sarah", 29), (72, "Pierre", 29), (123, "Adil", 692);
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Hierarchy Traversal 22 List reporting chain WITH RECURSIVE emp_ext (id, name, path) AS ( SELECT id, name, CAST(id AS CHAR(200)) FROM employees WHERE manager_id IS NULL UNION ALL SELECT s.id, s.name, CONCAT(m.path, ",", s.id) FROM emp_ext m JOIN employees s ON m.id=s.manager_id ) SELECT * FROM emp_ext ORDER BY path; id name path 333 Yasmina 333 198 John 333,198 692 Tarek 333,692 29 Pedro 333,198,29 123 Adil 333,692,123 4610 Sarah 333,198,29,4610 72 Pierre 333,198,29,72
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Window function example 23 PARTITION == disjoint set of rows in result set name dept_id salary dept_total Newt NULL 75000 75000 Dag 10 NULL 370000 Ed 10 100000 370000 Fred 10 60000 370000 Jon 10 60000 370000 Michael 10 70000 370000 Newt 10 80000 370000 Lebedev 20 65000 130000 Pete 20 65000 130000 Jeff 30 300000 370000 Will 30 70000 370000 Sum up total salary for each department: SELECT name, dept_id, salary, SUM(salary) OVER (PARTITION BY dept_id) AS dept_total FROM employee ORDER BY dept_id, name; The OVER keyword signals a window function
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 24 MySQL 8.0: Better Handing of Hot Rows SELECT seat_no FROM seats JOIN seat_rows USING ( row_no ) WHERE seat_no IN (3,4) AND seat_rows.row_no IN (12) AND booked = 'NO' FOR UPDATE OF seats SKIP LOCKED FOR SHARE OF seat_rows NOWAIT; Non deterministically skip over locked rows Error immediately if a row is already locked Feature Request from Developers
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0: Makes Managing Scale Easier • Greater density per server • Operator Friendliness • Increased Reliability • New! Improved Replication Throughput 25
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • Storage engines: – Estimate for how much of data and indexes are in a memory buffer – Estimate for hit rate for memory buffer • Optimizer cost model: – Take into account whether data is already in memory or need to be read from disk Memory Buffer Aware Cost Estimates Server Storage engine Disk data Query executor Database buffer
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0: Performance Schema • SQL error instrumentation • Indexes • Configuration Variables • New! Data Locks • New! Histograms 27
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Performance Comparison 28 0. 10. 20. 30. 40. Query Time MySQL 8.0 MySQL 5.7 Over 30x faster! SELECT * FROM sys.session 1000 active sessions Time in Seconds (Lower is better)
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0: Invisible Indexes • Indexes are “hidden” to the MySQL Optimizer – Not the same as “disabled indexes” – Contents are fully up to date and maintained by DML • Two use cases: – Soft Delete (Recycle Bin) – Staged Rollout 29 Feature Request from DBAs
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0: Persist Configuration • Persist GLOBAL Server Variables – SET PERSIST max_connections = 500; • Examples Include: – Offline_mode – Read_Only • Requires no filesystem access • New! Captures timestamp and change user 30 Cloud Friendly
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | All these features plus… • Source code now documented with Doxygen • Plugin Infrastructure! • Expanded GIS Support • Expanded Query Hints Support • Improved Scan Query Performance • Improved BLOB Storage • Improved Memcached Interface • Cost Model Improvements • Scalability Improvements • Atomicity in Privileges • Parser Refactoring • Improvements to Temporary Tables • C++11 and Toolchain Improvements • GTID_PURGED always settable • Persistent Auto Increment • Native InnoDB Data dictionary • Improved Information Schema performance • New! SQL Grouping Function • New! Optimizer Trace detailed sort statistics • New! Descending Indexes • New! Smaller Package Downloads • New! JSON Aggregate, Pretty print functions • New! JSON performance improvements • New! Expanded Query Hints • New! Improved usability of cost constant configuration • Group Replication in 8.0 • New! Transaction Save Point support in Group Replication • New! Improved Replication Applier Lag Statistics in Performance Schema • New! Per Multi-source Channel Replication Filters • New! Atomic DDL extended to the Binary Log • New! Performance Improvements on the Replication Applier • New! Parallel Replication Applier Policy • New! Binary Log Management Enhancements • New! Additional Metadata Into the Binary Log
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |