SlideShare a Scribd company logo
Geir Høydalsvik, MySQL Engineering
FOSDEM 2020, Database Track
February 2nd, 2020, Brussels
MySQL Goes to 8!
Copyright © 2020 Oracle and/or its affiliates.1
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, timing, and pricing of any features or functionality described for
Oracle’s products may change and remains at the sole discretion of Oracle Corporation.
Copyright © 2020 Oracle and/or its affiliates.2
WHAT IS MySQL?
• Relational Database
• Transactional, ACID
• InnoDB storage engine: ARIES, MVCC
• OLTP: low latency, high throughput
• Replication
• Read scale out, High Availability
• Simple, Solid, Secure
• Easy to use, Proven at scale
Copyright © 2020 Oracle and/or its affiliates.3
LAST 10 YEARS
• Major investments
• Reengineering
• Features
• Quality
• Major releases
• MySQL 5.5
• MySQL 5.6
• MySQL 5.7
• MySQL 8.0
Copyright © 2020 Oracle and/or its affiliates.4
MySQL 8 - IS LIGHT YEARS AWAY FROM 5.X
Copyright © 2020 Oracle and/or its affiliates.5
The Basics
SQL, JSON, GIS, Character
Sets, Collations, Functions
Copyright © 2020 Oracle and/or its affiliates.6
MySQL 8 - OPTIMIZER
Parse phase
• Parse step
• Contextualization step
• Abstract Syntax Tree
Optimize phase
• Range optimizer
• Join optimizer
• Physical plan
Prepare phase
• Resolve step
• Transform step
• Logical Plan
Execute phase
• Produce iterator tree
• Execute iterator
• Resultset
Copyright © 2020 Oracle and/or its affiliates.7
MySQL 8 - HISTOGRAM
Copyright © 2020 Oracle and/or its affiliates.
• Provides the optimizer with information about column value
distribution
ANALYZE TABLE table UPDATE HISTOGRAM ON column WITH n BUCKETS;
• Table sampling for efficiency
8
MySQL 8 – ITERATOR EXECUTOR
Copyright © 2020 Oracle and/or its affiliates.9
 Each operation is an iterator
 Execution loop reads from root node
Row by row
May trigger multiple read calls further down
 Common interface
Init()
Read()
HashJoinIterator
TableScanIterator TableScanIterator
SELECT * FROM t1 JOIN t2 ON t1.a = t2.a;
t1 t2
MySQL 8 - HASH JOIN
Copyright © 2020 Oracle and/or its affiliates.
• “Just another iterator”
• Faster than Block Nested Loop
• In-memory if possible
• Spill to disk if necessary
• Used for inner equi-joins in 8.0.18
• And also for outer, semi and anti joins in 8.0.20
• Hash Join replaces Block Nested Loop
10
HashJoinIterator
TableScanIterator TableScanIterator
SELECT * FROM t1 JOIN t2 ON t1.a = t2.a;
t1 t2
MySQL 8 - EXPLAIN ANALYZE
Copyright © 2020 Oracle and/or its affiliates.11
TimingIteratorTimingIterator
TimingIterator
HashJoinIterator
TableScanIterator TableScanIterator
t1 t2
EXPLAIN ANALYZE
SELECT * FROM t1 JOIN t2 ON t1.a = t2.a;
 Wrap iterators in instrumentation nodes
 Measurements
Time (in ms) to first row
Time (in ms) to last row
Number of rows
Number of loops
 Execute the query and dump the stats
 Built on EXPLAIN FORMAT=TREE
-> Inner hash join (t2.a = t1.a) (cost=0.70 rows=1) (actual time=0.441..0.441 rows=0 loops=1)
-> Table scan on t2 (cost=0.35 rows=1) (never executed)
-> Hash
-> Table scan on t1 (cost=0.35 rows=1) (actual time=0.220..0.220 rows=0 loops=1)
MySQL 8 – CHARACTER SET AND COLLATIONS
• MySQL 8 defaults to UTF-8
• Emoji, CJK characters, …
• Unicode 9.0 collations with accent,
case, and kana sensitivity
• Unicode support for REGEXP
Copyright © 2020 Oracle and/or its affiliates.12
MySQL 8 - Common Table Expression (WITH clause)
Copyright © 2020 Oracle and/or its affiliates.
WITH RECURSIVE cte AS
( SELECT ... FROM table_name
UNION [DISTINCT|ALL]
SELECT ... FROM cte, table_name )
SELECT ... FROM cte;
• Non-recursive
• Recursive
WITH cte AS (subquery)
SELECT ... FROM cte, t1…
13
• Better readability
• Can be referenced multiple times
• Can refer to other CTEs
• Improved performance
A Common Table Expression (CTE) is
just like a derived table, but its
declaration is put before the query
block instead of in the FROM clause
MySQL 8 - Window Functions (OVER clause)
Copyright © 2020 Oracle and/or its affiliates.14
A window function performs a calculation across a set of rows that are related to the current row,
similar to an aggregate function.
But unlike aggregate functions, a window function does not cause rows to become grouped into
a single output row.
Window functions can access values of other rows “in the vicinity” of the current row.
Aggregate function Window function
MySQL 8 - Window Functions (OVER clause)
Copyright © 2020 Oracle and/or its affiliates.
SELECT name, dept_id, salary,
SUM(salary)
OVER (PARTITION BY dept_id)
AS dept_total
FROM employee
ORDER BY dept_id, name;
15
name dept_id salary dept_total
Newt NULL 75000 75000
Dag 10 NULL 370000
Ed 10 10000
0
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 30000
0
370000
Will 30 70000 370000
Sum up total salary for each department:
PARTITION == disjoint
set of rows in result set
MySQL 8 – LATERAL DERIVED TABLES
• Can refer to other tables in the same FROM clause
• Sometimes referred to as the SQL «for each» equivalent
Copyright © 2020 Oracle and/or its affiliates.
SELECT … FROM t1, LATERAL (SELECT … FROM … WHERE … = t1.col)
AS derived, t2 …
16
MySQL 8.0 - FUNCTIONAL INDEXES
• Index over an expression
CREATE TABLE t1 (col1 INT, col2 INT);
CREATE INDEX idx1 ON t1 ((col1 + col2), (col1 - col2), col1) ;
• Document content, e.g. JSON array
CREATE TABLE lottery (data JSON);
CREATE INDEX ticket_idx ON lottery
((CAST(data->'$.lottery_tickets' AS UNSIGNED INT ARRAY))) ;
Copyright © 2020 Oracle and/or its affiliates.17
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: What will happen if I delete this index?
• Staged Rollout: I will create this index over night and make it visible when I
am at work tomorrow
Copyright © 2020 Oracle and/or its affiliates.18
MySQL 8 - CHECK CONSTRAINT
• Standard SQL Syntax
[ CONSTRAINT [symbol] ] CHECK ( condition) [ [ NOT ] ENFORCED ]
• Example
CREATE TABLE t1 (c1 INTEGER CONSTRAINT c1_chk CHECK (c1 > 0) ,
c2 INTEGER CONSTRAINT c2_chk CHECK (c2 > 0) ,
CONSTRAINT c1_c2_chk CHECK (c1 + c2 < 9999) );
Copyright © 2020 Oracle and/or its affiliates.19
MySQL 8 - Expressions as Default Values
• No longer limited to literal values
CREATE TABLE t1 (uuid BINARY DEFAULT (UUID_TO_BIN(UUID())) );
CREATE TABLE t2 (a INT, b INT, c INT DEFAULT (a+b) );
CREATE TABLE t3 (a INT, b INT, c POINT DEFAULT (POINT(0,0)) );
CREATE TABLE t4 (a INT, b INT, c JSON DEFAULT (‘[]’) );
• Useful for types without literal values
• GEOMETRY, POINT, LINESTRING, POLYGON, ...
Copyright © 2020 Oracle and/or its affiliates.20
MySQL 8 - NOWAIT and SKIP LOCKED
21
SELECT * FROM tickets
WHERE id IN (1,2,3,4)
AND order_id IS NULL
FOR UPDATE
NOWAIT;
Error immediately
if a row is already
locked
SELECT * FROM tickets
WHERE id IN (1,2,3,4)
AND order_id IS NULL
FOR UPDATE
SKIP LOCKED;
Non
deterministically
skip over locked
rows
Copyright © 2020 Oracle and/or its affiliates.
MySQL 8.0 - NEW FUNCTIONS
• REGEXP
• REGEXP_INSTR , REGEXP_LIKE, REGEXP_REPLACE, REGEXP_SUBSTR
• UUID
• UUID_TO_BIN, BIN_TO_UUID, IS_UUID
• STATEMENT_DIGEST
• STATEMENT_DIGEST , STATEMENT_DIGEST_TEXT
• Bit operations are now allowed on all binary data types
• BINARY, VARBINARY, BLOB, TINYBLOB, MEDIUMBLOB and
LONGBLOB
Copyright © 2020 Oracle and/or its affiliates.22
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE[_PRESERVE]()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
JSON_PRETTY()
JSON_STORAGE_SIZE()
JSON_STORAGE_FREE()
JSON_ARRAYAGG()
JSON_OBJECTAGG()
JSON_MERGE_PATCH()
JSON_TABLE()
JSON_OVERLAPS()
JSON Schema
JSON Array Indexes
MySQL 8 - JSON Functions
23 Copyright © 2020 Oracle and/or its affiliates.
MySQL 8 - JSON_TABLE()
From JSON Document to SQL Table
mysql> SELECT emps.* FROM JSON_TABLE(@jsonempl, "$[*]" COLUMNS
(id INT PATH "$.id", name VARCHAR(45) PATH "$.name", age INT
PATH "$.age")) emps;
+------+------+------+
| id | name | age |
+------+------+------+
| 1 | John | 34 |
| 2 | Mary | 40 |
| 3 | Mike | 44 |
+------+------+------+
3 rows in set (0,00 sec)
24 Copyright © 2020 Oracle and/or its affiliates.
MySQL 8 - Full Geography Support
Full Geography Support
• Longitude, Latitude
• Projected – Flat/Across 2 dimensions
• Geographic – Spheroid
• 5107 predefined SRSs from the EPSG Dataset 9.2
• 4628 projected, 479 geographic
Built in and ready to use
Copyright © 2020 Oracle and/or its affiliates.25
MySQL Document Store
SQL + NoSQL = MySQL
Copyright © 2020 Oracle and/or its affiliates.26
MySQL 8 – DOCUMENT STORE
Copyright © 2020 Oracle and/or its affiliates.27
Client
Server
MySQL Server
JavaScript
Node.js
X DEV API
X Plugin
X Protocol
• JSON documents
• Schemaless
• Document collections
• db.getCollections()
• CRUD operations
• add(), find(), modify(), remove()
• Connectors (X DevAPI)
• Asynchronous protocol (X Protocol)
• Server front end (X Plugin)
• Full Node.js integration
– Support for “Promises”
• Autocompletion support in IDEs
– Due to method chaining support
• Intuitive Documentation & Tutorials
– Example:
MySQL 8 – DOCUMENT STORE
Copyright © 2020 Oracle and/or its affiliates.28
COLLECTION.add Function
Operations
Secure, Monitor, Manage,
and Upgrade
Copyright © 2020 Oracle and/or its affiliates.29
MySQL 8.0 - SECURE BY DEFAULT
• User should not have to “opt in” for security
• Minimize attack surface
• Minimize process permissions
• Minimize file permissions
• Minimize privileges
• Strong authentication
• Strong encryption methods
Copyright © 2020 Oracle and/or its affiliates.30
MySQL 8.0 - AUTHENTICATION
• Strong default authentication
• caching_sha2_password
• Pluggable authentication
• Client and server side
• Support for intergation with external authentication systems
• Can use the OS login to authenticate
• unix sockets
Copyright © 2020 Oracle and/or its affiliates.31
MYSQL 8.0 - PASSWORD MANAGEMENT
• Password rotation policies and enforcement
• Password history and reuse protection
• Password strength evaluation and enforcement
• Password generation
• Two passwords per user
• Brute-force attack protection
Copyright © 2020 Oracle and/or its affiliates.32
MySQL 8.0 - AUTHORIZATION
• Standards compliant user and roles management
• Users, Roles, and Privileges
• SQL Standard Information Schema views for SQL Roles
• APPLICABLE_ROLES, ENABLED_ROLES, ROLE_TABLE_GRANTS , …
• Fine grained permissions management
• Admin Privileges
Copyright © 2020 Oracle and/or its affiliates.33
MYSQL 8.0 – FOCUS ON OpenSSL
• OpenSSL is linked dynamically
• OpenSSL versions can be patched at OS level
• Support for FIPs compliance
• Can reconfigure certificates without restarting the server
• Encrypt over the wire, TLS 1.3 support
• Encrypt data at rest
Copyright © 2020 Oracle and/or its affiliates.34
MYSQL 8.0 – MONITORING
• Information Schema tables
• Persistent meta data
• Views on the data dictionary tables
• Data dictionary is implemented as system tables in InnoDB
• Performance Schema tables
• Volatile meta data, lost upon restart
• SYS Schema
• Stored routines
• Task oriented reports
Copyright © 2020 Oracle and/or its affiliates.35
MySQL 8.0 - PERFORMANCE SCHEMA
• Statement latency statistics
• What is the latency distribution for a given SQL statement?
• Data Locks
• Which user threads are waiting for which locks? Who holds them?
• SQL Errors
• Which errors have been sent back to clients? When? How often?
• Configuration Variables
• What is the current value? Who set it? When?
36 Copyright © 2020 Oracle and/or its affiliates.
MYSQL 8.0 – MANAGEMENT
• Manage over a user connection or use the MySQL Shell
• Eliminate the need to access the host machine
• Eliminate the need to restart the server
• Configuration changes by SQL DDL
• SET PERSIST (mostly online)
• RESTART (still required in some cases)
• Auto Upgrade
• The system reads the «on disk» version
• Execute upgrade code if needed
Copyright © 2020 Oracle and/or its affiliates.37
MySQL Shell
Ease of Use
- To a new level
Copyright © 2020 Oracle and/or its affiliates.38
Meet Ada
Copyright © 2020 Oracle and/or its affiliates.39
• Meet Ada, the DevOps
• Ada is smart
• Ada is using the MySQL Shell
Ada
Hello!
MySQL Shell : Modern
Copyright © 2020 Oracle and/or its affiliates.40
• Colorful Prompt Themes
• Autocompletion
• Syntax Highlighting
• Context Sensitive Help
• Command History
• Pager, less/more
• Output Formats
MySQL Shell : Flexible
Copyright © 2020 Oracle and/or its affiliates.41
• SQL, JavaScript, Python
• Interactive & Batch
• SQL Client
• Document Store
• InnoDB Cluster Admin
• InnoDB ReplicaSet Admin
MySQL Shell : Extendible
Copyright © 2020 Oracle and/or its affiliates.42
• Utilities
– upgradeChecker()
– importJSON()
– importTable()
• Reporting Framework
– show watch
• User Defined Plugins
– JS or Python
Ada
I adapted it to my
prod environment!
MySQL CLONE
Fast instance
provisioning
Copyright © 2020 Oracle and/or its affiliates.43
MySQL 8 – CLONE
Copyright © 2020 Oracle and/or its affiliates.44
WHY IS CLONE SUCH A BIG DEAL?
• Puts the power of fast instance provisioning into the
hands of everybody
• Reduces the complex provisioning procedure to a few
simple steps
• Even happens automatically when needed when using
InnoDB Cluster
• Can be done fully remotely
Ada
CLONE makes
my life easy!
MySQL 8 - CLONE Directly from SQL
Copyright © 2020 Oracle and/or its affiliates.45
“User traffic is growing and I need a
new read replica”
Provision a new slave (RECIPIENT)
from an existing master (DONOR)
R/W Load
MySQL Shell
Are you ready?
DONOR RECIPIENT
MySQL – 8 CLONE Setup the DONOR
Copyright © 2020 Oracle and/or its affiliates.46
mysql> INSTALL PLUGIN CLONE SONAME "mysql_clone.so";
mysql> CREATE USER clone_user IDENTIFIED BY "clone_password";
mysql> GRANT BACKUP_ADMIN ON *.* to clone_user;
MySQL Shell
INSTALL PLUGIN
MySQL 8 - CLONE Setup the RECIPIENT
Copyright © 2020 Oracle and/or its affiliates.47
mysql> INSTALL PLUGIN CLONE SONAME "mysql_clone.so";
mysql> SET GLOBAL clone_valid_donor_list = "donor.host.com:3306";
mysql> CREATE USER clone_user IDENTIFIED BY "clone_password";
mysql> GRANT BACKUP_ADMIN ON *.* to clone_user;
MySQL Shell
INSTALL PLUGIN
MySQL 8 - Connect to RECIPIENT and execute CLONE SQL statement
Copyright © 2020 Oracle and/or its affiliates.48
mysql> CLONE INSTANCE
-> FROM clone_user@donor.host.com:3306
-> IDENTIFIED BY "clone_password";
R/W Load
MySQL Shell
CLONE INSTANCE
MySQL 8 - CLONE Check Status
Copyright © 2020 Oracle and/or its affiliates.49
mysql> select STATE, …
> from performance_schema.clone_status;
+-------------+---------------------+------------+
| STATE | START TIME | DURATION |
+-------------+---------------------+------------+
| In Progress | 2019-07-17 17:23:26 | 4.84 m |
+-------------+---------------------+------------+
MySQL 8 - CLONE Check Progress
Copyright © 2020 Oracle and/or its affiliates.50
mysql> select STATE, …
> from performance_schema.clone_progress;
+-----------+-------------+------------+----------+------------+---------+
| STAGE | STATE | START TIME | DURATION | Estimate | Done(%) |
+-----------+-------------+------------+----------+------------+---------+
| DROP DATA | Completed | 17:23:26 | 790.86 ms | 0 MB | 100% |
| FILE COPY | Completed | 17:23:27 | 10.33 m | 94,729 MB | 100% |
| PAGE COPY | Completed | 17:33:47 | 15.91 s | 11,885 MB | 100% |
| REDO COPY | Completed | 17:34:03 | 1.07 s | 293 MB | 100% |
| FILE SYNC | In Progress | 17:34:04 | 51.68 s | 0 MB | 0% |
| RESTART | Not Started | NULL | NULL | 0 MB | 0% |
| RECOVERY | Not Started | NULL | NULL | 0 MB | 0% |
+-----------+-------------+------------+-----------+-----------+---------+
MySQL InnoDB Cluster
High Availability
- Out of the Box
Copyright © 2020 Oracle and/or its affiliates.51
MySQL 8 - MySQL InnoDB Cluster
52
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
• MySQL Group Replication
– High Availability
– Elastic, Fault Tolerant, Self Healing
• MySQL Router
– Connection Routing, Load Balancing
• MySQL Shell
– Easy Setup & Administration
Copyright © 2020 Oracle and/or its affiliates.
MySQL 8 – GROUP REPLICATION
Initialize group
Detect node failure
Reestablish group
Elect new primary
Recover from failure
Rejoin group
Grow and shrink group
Provision new members
Topology Meta-data
Router Notification
Observability
Copyright © 2020 Oracle and/or its affiliates.53
A B C D E
MySQL 8 – REPLICATION TECHNOLOGY
• Multi-threaded Replication Applier With WRITESETs
• Faster Slaves - higher end-to-end throughput
• Global Transaction Identifiers (GTIDs)
• Track replication changes seamlessly across replication chains
• Replicated state machines
• Coordinate, synchronize and execute distributed operations using well known and
proven distributed algorithms such as Paxos
Copyright © 2020 Oracle and/or its affiliates.54
MySQL 8 – DISTRIBUTED AND COORDINATED AUTOMATION
• Fault-detection
• Automatic detection of failed servers in the cluster
• Server fencing
• Automatic isolation of faulty servers from the app and the cluster
• Data consistency levels
• Distributed commit protocol enabling reading your own writes
• Distributed recovery
• Automatic (re)syncing procedure for servers joining a cluster
• Flow control
• Automatic server throttling preventing unbounded secondary lag
• Membership services
• Automatic, dynamic list of servers in the cluster and their status
Copyright © 2020 Oracle and/or its affiliates.55
MySQL InnoDB Cluster
Mini-tutorial
Copyright © 2020 Oracle and/or its affiliates.56
MySQL InnoDB Cluster
Copyright © 2020 Oracle and/or its affiliates.57
Primary Secondary
• configureInstance()
• createCluster()
• addInstance()
• removeInstance()
• rejoinInstance()
MySQL Router
MySQL Shell
R/W Load
And here CLONE is
fully automated!
Pre-requisites : Install and start MySQL on 3 servers
Copyright © 2020 Oracle and/or its affiliates.58
MySQL Shell
Install and start
Note: mysqld is managed by Linux systemd
mysql-js>dba.configureInstance('clusteradmin@mysql1')
Copyright © 2020 Oracle and/or its affiliates.59
MySQL Shell
binlog_checksum = NONE
enforce_gtid_consistency = ON
gtid_mode=ON
server_id= <unique ID>
Configure instance
mysql-js>dba.configureInstance('clusteradmin@mysql2')
Copyright © 2020 Oracle and/or its affiliates.60
MySQL Shell
binlog_checksum = NONE
enforce_gtid_consistency = ON
gtid_mode=ON
server_id= <unique ID>
Configure instance
mysql-js>dba.configureInstance('clusteradmin@mysql3')
Copyright © 2020 Oracle and/or its affiliates.61
MySQL Shell
binlog_checksum = NONE
enforce_gtid_consistency = ON
gtid_mode=ON
server_id= <unique ID>
Configure instance
mysql-js> cluster=dba.createCluster(‘FOSDEM2020')
Copyright © 2020 Oracle and/or its affiliates.62
MySQL Shell
Create cluster
mysql-js> cluster.status()
{
"clusterName": “FOSDEM2020",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql1:3306",
"ssl": "REQUIRED",
"status": "OK_NOT_TOLERANT",
"statusText": "Cluster is NOT
tolerant to any failures.",
"topology": {
…
},
"topologyMode": "Single Primary"
},
"groupInformationSourceMember": "mysql1:3306"
mysql-js> cluster.status()
Copyright © 2020 Oracle and/or its affiliates.63
MySQL Shell
FOSDEM2020
Status? NOT
FAULT TOLERANT
mysql-js> cluster.addInstance('clusteradmin@mysql2')
Copyright © 2020 Oracle and/or its affiliates.64
MySQL Shell
FOSDEM2020
CLONEAdd instance
mysql-js> cluster.addInstance('clusteradmin@mysql3')
Copyright © 2020 Oracle and/or its affiliates.65
MySQL Shell
FOSDEM2020
CLONE
Add instance
MySQL Shell : Add Instance with CLONE Progress Reporting
Copyright © 2020 Oracle and/or its affiliates.66
MySQL Shell
FOSDEM2020
FINISHED in
one second
mysql-js> cluster.status()
Copyright © 2020 Oracle and/or its affiliates.67
FOSDEM2020
mysql-js> cluster.status()
{
"clusterName": “FOSDEM2020",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql1:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE
and can tolerate up to ONE failure.",
"topology": {
…CUT…
},
"topologyMode": "Single Primary"
},
"groupInformationSourceMember": "mysql1:3306"
}
MySQL Shell
Status?
FAULT TOLERANT
# mysqlrouter --bootstrap clusteradmin@mysql1 --user=routeradmin
# systemctl start mysqlrouter
Copyright © 2020 Oracle and/or its affiliates.68
MySQL Router
R/W Load
MySQL Shell
Starting
mysqlrouter and
adding r/w load
FOSDEM2020
mysql1# kill -9 $(pidof mysqld)
Copyright © 2020 Oracle and/or its affiliates.69
MySQL Router
R/W Load
MySQL Shell
Testing...
Killing primary
mysqld...
FOSDEM2020
MySQL: New Primary
Copyright © 2020 Oracle and/or its affiliates.70
MySQL Router
R/W Load
MySQL Shell
OK, mysql1 left
the group and
mysql2 became
the new primary
FOSDEM2020
1. Automatic, self healing
• Binlog (if GTID available in group)
• CLONE (otherwise)
2. Manual fix
• Self healing failed, e.g. network failure
• rejoinInstance()
• CLONE
3. Replace with new instance (permanent failure)
• removeInstance()
• addInstance()
• CLONE
MySQL: How to regain Fault Tolerance?
Copyright © 2020 Oracle and/or its affiliates.71
FOSDEM2020
mysql-js> cluster.rejoinInstance('clusteradmin@mysql1')
Copyright © 2020 Oracle and/or its affiliates.72
MySQL Router
R/W Load
MySQL Shell
rejoinInstance()
CLONE
FOSDEM2020
MySQL: Fault Tolerant Again
Copyright © 2020 Oracle and/or its affiliates.73
MySQL Router
R/W Load
MySQL Shell
THANK YOU!
FOSDEM2020
MySQL 8 – CONNECTORS AND DRIVERS
Copyright © 2020 Oracle and/or its affiliates.74
MySQL Engineering
• Node.js Driver (Connector/Node.js)
• Python Driver (Connector/Python)
• C++ Driver (Connector/C++)
• C Driver (Connector/C)
• C API (mysqlclient)
• ADO.NET (Connector/NET)
• ODBC (Connector/ODBC)
• JDBC (Connector/J)
Community
• PHP Drivers for MySQL
– (mysqli, ext/mysqli, PDO_MYSQL,
PHP_MYSQLND)
• Perl Driver for MySQL (DBD::mysql)
• Ruby Driver for MySQL (ruby-mysql)
• C++ Wrapper for MySQL C API
(MySQL++)
• Go MySQL Driver
• NodeJS (mysql, mysql2)
MySQL 8 – SOURCE CODE
• Open Source (GPL)
• GitHub https://github.com/mysql/mysql-server
• Wide platform coverage
• C++ 14 , Use of standard constructs, e.g. std::atomic
• Cleaning up header files dependencies
• Warning-free with GCC 8 and Clang 6
• Asan and Ubsan clean
• Google C++ Style Guide
• MySQL Source Code Documentation
Copyright © 2020 Oracle and/or its affiliates.75
MySQL 8 - The complete list of new features
Copyright © 2020 Oracle and/or its affiliates.76
https://mysqlserverteam.com/the-complete-list-of-new-features-in-mysql-8-0/
MySQL Community on Slack
Copyright © 2020 Oracle and/or its affiliates.
https://lefred.be/mysql-community-on-slack/
77
MySQL on Social Media
Copyright © 2020 Oracle and/or its affiliates.
https://www.facebook.com/mysql
https://twitter.com/mysql
https://www.linkedin.com/company/mysql
78
MySQL Goes to 8!  FOSDEM 2020 Database Track, January 2nd, 2020
Ad

More Related Content

What's hot (20)

Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
Dave Stokes
 
MySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentationMySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentation
Dave Stokes
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell
Ivan Ma
 
Discover the Power of the NoSQL + SQL with MySQL
Discover the Power of the NoSQL + SQL with MySQLDiscover the Power of the NoSQL + SQL with MySQL
Discover the Power of the NoSQL + SQL with MySQL
Dave Stokes
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
Dave Stokes
 
2012 summarytables
2012 summarytables2012 summarytables
2012 summarytables
sqlhjalp
 
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & HistogramsConfoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
Dave Stokes
 
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Dave Stokes
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dave Stokes
 
Open Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational DatabaseOpen Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational Database
Dave Stokes
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015
Manyi Lu
 
Using JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQLUsing JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQL
Anders Karlsson
 
A Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document StoreA Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document Store
Dave Stokes
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
Sveta Smirnova
 
MySQL 8 for Developers
MySQL 8 for DevelopersMySQL 8 for Developers
MySQL 8 for Developers
Georgi Sotirov
 
Avoiding cursors with sql server 2005 tech republic
Avoiding cursors with sql server 2005   tech republicAvoiding cursors with sql server 2005   tech republic
Avoiding cursors with sql server 2005 tech republic
Kaing Menglieng
 
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql  - how do pdo, mysq-li, and x devapi do what they doPhp &amp; my sql  - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Dave Stokes
 
Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Execution
webhostingguy
 
Develop PHP Applications with MySQL X DevAPI
Develop PHP Applications with MySQL X DevAPIDevelop PHP Applications with MySQL X DevAPI
Develop PHP Applications with MySQL X DevAPI
Dave Stokes
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
Dave Stokes
 
MySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentationMySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentation
Dave Stokes
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell
Ivan Ma
 
Discover the Power of the NoSQL + SQL with MySQL
Discover the Power of the NoSQL + SQL with MySQLDiscover the Power of the NoSQL + SQL with MySQL
Discover the Power of the NoSQL + SQL with MySQL
Dave Stokes
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
Dave Stokes
 
2012 summarytables
2012 summarytables2012 summarytables
2012 summarytables
sqlhjalp
 
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & HistogramsConfoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
Dave Stokes
 
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Dave Stokes
 
BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7BGOUG15: JSON support in MySQL 5.7
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dave Stokes
 
Open Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational DatabaseOpen Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational Database
Dave Stokes
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015
Manyi Lu
 
Using JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQLUsing JSON with MariaDB and MySQL
Using JSON with MariaDB and MySQL
Anders Karlsson
 
A Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document StoreA Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document Store
Dave Stokes
 
MySQL 8 for Developers
MySQL 8 for DevelopersMySQL 8 for Developers
MySQL 8 for Developers
Georgi Sotirov
 
Avoiding cursors with sql server 2005 tech republic
Avoiding cursors with sql server 2005   tech republicAvoiding cursors with sql server 2005   tech republic
Avoiding cursors with sql server 2005 tech republic
Kaing Menglieng
 
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql  - how do pdo, mysq-li, and x devapi do what they doPhp &amp; my sql  - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Dave Stokes
 
Understanding Query Execution
Understanding Query ExecutionUnderstanding Query Execution
Understanding Query Execution
webhostingguy
 
Develop PHP Applications with MySQL X DevAPI
Develop PHP Applications with MySQL X DevAPIDevelop PHP Applications with MySQL X DevAPI
Develop PHP Applications with MySQL X DevAPI
Dave Stokes
 

Similar to MySQL Goes to 8! FOSDEM 2020 Database Track, January 2nd, 2020 (20)

What's New MySQL 8.0?
What's New MySQL 8.0?What's New MySQL 8.0?
What's New MySQL 8.0?
OracleMySQL
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSON
Mario Beck
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
mCloud
 
Mysql8for blr usercamp
Mysql8for blr usercampMysql8for blr usercamp
Mysql8for blr usercamp
Mysql User Camp
 
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgradeDevelopers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
mCloud
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Geir Høydalsvik
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQL
Dave Stokes
 
OSC Online MySQL Version up
OSC Online MySQL Version upOSC Online MySQL Version up
OSC Online MySQL Version up
DAISUKE INAGAKI
 
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
Dave Stokes
 
MySQL 8.0 Featured for Developers
MySQL 8.0 Featured for DevelopersMySQL 8.0 Featured for Developers
MySQL 8.0 Featured for Developers
Dave Stokes
 
Php forum2015 tomas_final
Php forum2015 tomas_finalPhp forum2015 tomas_final
Php forum2015 tomas_final
Bertrand Matthelie
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
Frederic Descamps
 
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
Geir Høydalsvik
 
MySQL 5.7 - What's new and How to upgrade
MySQL 5.7 - What's new and How to upgradeMySQL 5.7 - What's new and How to upgrade
MySQL 5.7 - What's new and How to upgrade
Abel Flórez
 
MySQL Document Store (Oracle Code Warsaw 2018)
MySQL Document Store (Oracle Code Warsaw 2018)MySQL Document Store (Oracle Code Warsaw 2018)
MySQL Document Store (Oracle Code Warsaw 2018)
Vittorio Cioe
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
Frazer Clement
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
オラクルエンジニア通信
 
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
Frederic Descamps
 
Oracle Code Event - MySQL JSON Document Store
Oracle Code Event - MySQL JSON Document StoreOracle Code Event - MySQL JSON Document Store
Oracle Code Event - MySQL JSON Document Store
Mark Swarbrick
 
What's New MySQL 8.0?
What's New MySQL 8.0?What's New MySQL 8.0?
What's New MySQL 8.0?
OracleMySQL
 
NoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSONNoSQL and MySQL: News about JSON
NoSQL and MySQL: News about JSON
Mario Beck
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
mCloud
 
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgradeDevelopers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
mCloud
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Geir Høydalsvik
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQL
Dave Stokes
 
OSC Online MySQL Version up
OSC Online MySQL Version upOSC Online MySQL Version up
OSC Online MySQL Version up
DAISUKE INAGAKI
 
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
Dave Stokes
 
MySQL 8.0 Featured for Developers
MySQL 8.0 Featured for DevelopersMySQL 8.0 Featured for Developers
MySQL 8.0 Featured for Developers
Dave Stokes
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
Frederic Descamps
 
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
2018: State of the Dolphin, MySQL Keynote at Percona Live Europe 2018, Frankf...
Geir Høydalsvik
 
MySQL 5.7 - What's new and How to upgrade
MySQL 5.7 - What's new and How to upgradeMySQL 5.7 - What's new and How to upgrade
MySQL 5.7 - What's new and How to upgrade
Abel Flórez
 
MySQL Document Store (Oracle Code Warsaw 2018)
MySQL Document Store (Oracle Code Warsaw 2018)MySQL Document Store (Oracle Code Warsaw 2018)
MySQL Document Store (Oracle Code Warsaw 2018)
Vittorio Cioe
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
Frazer Clement
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
クラウドのコストを大幅削減!事例から見るクラウド間移行の効果(Oracle Cloudウェビナーシリーズ: 2020年7月8日)
オラクルエンジニア通信
 
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20
Frederic Descamps
 
Oracle Code Event - MySQL JSON Document Store
Oracle Code Event - MySQL JSON Document StoreOracle Code Event - MySQL JSON Document Store
Oracle Code Event - MySQL JSON Document Store
Mark Swarbrick
 
Ad

Recently uploaded (20)

FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Ad

MySQL Goes to 8! FOSDEM 2020 Database Track, January 2nd, 2020

  • 1. Geir Høydalsvik, MySQL Engineering FOSDEM 2020, Database Track February 2nd, 2020, Brussels MySQL Goes to 8! Copyright © 2020 Oracle and/or its affiliates.1
  • 2. 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, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Copyright © 2020 Oracle and/or its affiliates.2
  • 3. WHAT IS MySQL? • Relational Database • Transactional, ACID • InnoDB storage engine: ARIES, MVCC • OLTP: low latency, high throughput • Replication • Read scale out, High Availability • Simple, Solid, Secure • Easy to use, Proven at scale Copyright © 2020 Oracle and/or its affiliates.3
  • 4. LAST 10 YEARS • Major investments • Reengineering • Features • Quality • Major releases • MySQL 5.5 • MySQL 5.6 • MySQL 5.7 • MySQL 8.0 Copyright © 2020 Oracle and/or its affiliates.4
  • 5. MySQL 8 - IS LIGHT YEARS AWAY FROM 5.X Copyright © 2020 Oracle and/or its affiliates.5
  • 6. The Basics SQL, JSON, GIS, Character Sets, Collations, Functions Copyright © 2020 Oracle and/or its affiliates.6
  • 7. MySQL 8 - OPTIMIZER Parse phase • Parse step • Contextualization step • Abstract Syntax Tree Optimize phase • Range optimizer • Join optimizer • Physical plan Prepare phase • Resolve step • Transform step • Logical Plan Execute phase • Produce iterator tree • Execute iterator • Resultset Copyright © 2020 Oracle and/or its affiliates.7
  • 8. MySQL 8 - HISTOGRAM Copyright © 2020 Oracle and/or its affiliates. • Provides the optimizer with information about column value distribution ANALYZE TABLE table UPDATE HISTOGRAM ON column WITH n BUCKETS; • Table sampling for efficiency 8
  • 9. MySQL 8 – ITERATOR EXECUTOR Copyright © 2020 Oracle and/or its affiliates.9  Each operation is an iterator  Execution loop reads from root node Row by row May trigger multiple read calls further down  Common interface Init() Read() HashJoinIterator TableScanIterator TableScanIterator SELECT * FROM t1 JOIN t2 ON t1.a = t2.a; t1 t2
  • 10. MySQL 8 - HASH JOIN Copyright © 2020 Oracle and/or its affiliates. • “Just another iterator” • Faster than Block Nested Loop • In-memory if possible • Spill to disk if necessary • Used for inner equi-joins in 8.0.18 • And also for outer, semi and anti joins in 8.0.20 • Hash Join replaces Block Nested Loop 10 HashJoinIterator TableScanIterator TableScanIterator SELECT * FROM t1 JOIN t2 ON t1.a = t2.a; t1 t2
  • 11. MySQL 8 - EXPLAIN ANALYZE Copyright © 2020 Oracle and/or its affiliates.11 TimingIteratorTimingIterator TimingIterator HashJoinIterator TableScanIterator TableScanIterator t1 t2 EXPLAIN ANALYZE SELECT * FROM t1 JOIN t2 ON t1.a = t2.a;  Wrap iterators in instrumentation nodes  Measurements Time (in ms) to first row Time (in ms) to last row Number of rows Number of loops  Execute the query and dump the stats  Built on EXPLAIN FORMAT=TREE -> Inner hash join (t2.a = t1.a) (cost=0.70 rows=1) (actual time=0.441..0.441 rows=0 loops=1) -> Table scan on t2 (cost=0.35 rows=1) (never executed) -> Hash -> Table scan on t1 (cost=0.35 rows=1) (actual time=0.220..0.220 rows=0 loops=1)
  • 12. MySQL 8 – CHARACTER SET AND COLLATIONS • MySQL 8 defaults to UTF-8 • Emoji, CJK characters, … • Unicode 9.0 collations with accent, case, and kana sensitivity • Unicode support for REGEXP Copyright © 2020 Oracle and/or its affiliates.12
  • 13. MySQL 8 - Common Table Expression (WITH clause) Copyright © 2020 Oracle and/or its affiliates. WITH RECURSIVE cte AS ( SELECT ... FROM table_name UNION [DISTINCT|ALL] SELECT ... FROM cte, table_name ) SELECT ... FROM cte; • Non-recursive • Recursive WITH cte AS (subquery) SELECT ... FROM cte, t1… 13 • Better readability • Can be referenced multiple times • Can refer to other CTEs • Improved performance A Common Table Expression (CTE) is just like a derived table, but its declaration is put before the query block instead of in the FROM clause
  • 14. MySQL 8 - Window Functions (OVER clause) Copyright © 2020 Oracle and/or its affiliates.14 A window function performs a calculation across a set of rows that are related to the current row, similar to an aggregate function. But unlike aggregate functions, a window function does not cause rows to become grouped into a single output row. Window functions can access values of other rows “in the vicinity” of the current row. Aggregate function Window function
  • 15. MySQL 8 - Window Functions (OVER clause) Copyright © 2020 Oracle and/or its affiliates. SELECT name, dept_id, salary, SUM(salary) OVER (PARTITION BY dept_id) AS dept_total FROM employee ORDER BY dept_id, name; 15 name dept_id salary dept_total Newt NULL 75000 75000 Dag 10 NULL 370000 Ed 10 10000 0 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 30000 0 370000 Will 30 70000 370000 Sum up total salary for each department: PARTITION == disjoint set of rows in result set
  • 16. MySQL 8 – LATERAL DERIVED TABLES • Can refer to other tables in the same FROM clause • Sometimes referred to as the SQL «for each» equivalent Copyright © 2020 Oracle and/or its affiliates. SELECT … FROM t1, LATERAL (SELECT … FROM … WHERE … = t1.col) AS derived, t2 … 16
  • 17. MySQL 8.0 - FUNCTIONAL INDEXES • Index over an expression CREATE TABLE t1 (col1 INT, col2 INT); CREATE INDEX idx1 ON t1 ((col1 + col2), (col1 - col2), col1) ; • Document content, e.g. JSON array CREATE TABLE lottery (data JSON); CREATE INDEX ticket_idx ON lottery ((CAST(data->'$.lottery_tickets' AS UNSIGNED INT ARRAY))) ; Copyright © 2020 Oracle and/or its affiliates.17
  • 18. 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: What will happen if I delete this index? • Staged Rollout: I will create this index over night and make it visible when I am at work tomorrow Copyright © 2020 Oracle and/or its affiliates.18
  • 19. MySQL 8 - CHECK CONSTRAINT • Standard SQL Syntax [ CONSTRAINT [symbol] ] CHECK ( condition) [ [ NOT ] ENFORCED ] • Example CREATE TABLE t1 (c1 INTEGER CONSTRAINT c1_chk CHECK (c1 > 0) , c2 INTEGER CONSTRAINT c2_chk CHECK (c2 > 0) , CONSTRAINT c1_c2_chk CHECK (c1 + c2 < 9999) ); Copyright © 2020 Oracle and/or its affiliates.19
  • 20. MySQL 8 - Expressions as Default Values • No longer limited to literal values CREATE TABLE t1 (uuid BINARY DEFAULT (UUID_TO_BIN(UUID())) ); CREATE TABLE t2 (a INT, b INT, c INT DEFAULT (a+b) ); CREATE TABLE t3 (a INT, b INT, c POINT DEFAULT (POINT(0,0)) ); CREATE TABLE t4 (a INT, b INT, c JSON DEFAULT (‘[]’) ); • Useful for types without literal values • GEOMETRY, POINT, LINESTRING, POLYGON, ... Copyright © 2020 Oracle and/or its affiliates.20
  • 21. MySQL 8 - NOWAIT and SKIP LOCKED 21 SELECT * FROM tickets WHERE id IN (1,2,3,4) AND order_id IS NULL FOR UPDATE NOWAIT; Error immediately if a row is already locked SELECT * FROM tickets WHERE id IN (1,2,3,4) AND order_id IS NULL FOR UPDATE SKIP LOCKED; Non deterministically skip over locked rows Copyright © 2020 Oracle and/or its affiliates.
  • 22. MySQL 8.0 - NEW FUNCTIONS • REGEXP • REGEXP_INSTR , REGEXP_LIKE, REGEXP_REPLACE, REGEXP_SUBSTR • UUID • UUID_TO_BIN, BIN_TO_UUID, IS_UUID • STATEMENT_DIGEST • STATEMENT_DIGEST , STATEMENT_DIGEST_TEXT • Bit operations are now allowed on all binary data types • BINARY, VARBINARY, BLOB, TINYBLOB, MEDIUMBLOB and LONGBLOB Copyright © 2020 Oracle and/or its affiliates.22
  • 24. MySQL 8 - JSON_TABLE() From JSON Document to SQL Table mysql> SELECT emps.* FROM JSON_TABLE(@jsonempl, "$[*]" COLUMNS (id INT PATH "$.id", name VARCHAR(45) PATH "$.name", age INT PATH "$.age")) emps; +------+------+------+ | id | name | age | +------+------+------+ | 1 | John | 34 | | 2 | Mary | 40 | | 3 | Mike | 44 | +------+------+------+ 3 rows in set (0,00 sec) 24 Copyright © 2020 Oracle and/or its affiliates.
  • 25. MySQL 8 - Full Geography Support Full Geography Support • Longitude, Latitude • Projected – Flat/Across 2 dimensions • Geographic – Spheroid • 5107 predefined SRSs from the EPSG Dataset 9.2 • 4628 projected, 479 geographic Built in and ready to use Copyright © 2020 Oracle and/or its affiliates.25
  • 26. MySQL Document Store SQL + NoSQL = MySQL Copyright © 2020 Oracle and/or its affiliates.26
  • 27. MySQL 8 – DOCUMENT STORE Copyright © 2020 Oracle and/or its affiliates.27 Client Server MySQL Server JavaScript Node.js X DEV API X Plugin X Protocol • JSON documents • Schemaless • Document collections • db.getCollections() • CRUD operations • add(), find(), modify(), remove() • Connectors (X DevAPI) • Asynchronous protocol (X Protocol) • Server front end (X Plugin)
  • 28. • Full Node.js integration – Support for “Promises” • Autocompletion support in IDEs – Due to method chaining support • Intuitive Documentation & Tutorials – Example: MySQL 8 – DOCUMENT STORE Copyright © 2020 Oracle and/or its affiliates.28 COLLECTION.add Function
  • 29. Operations Secure, Monitor, Manage, and Upgrade Copyright © 2020 Oracle and/or its affiliates.29
  • 30. MySQL 8.0 - SECURE BY DEFAULT • User should not have to “opt in” for security • Minimize attack surface • Minimize process permissions • Minimize file permissions • Minimize privileges • Strong authentication • Strong encryption methods Copyright © 2020 Oracle and/or its affiliates.30
  • 31. MySQL 8.0 - AUTHENTICATION • Strong default authentication • caching_sha2_password • Pluggable authentication • Client and server side • Support for intergation with external authentication systems • Can use the OS login to authenticate • unix sockets Copyright © 2020 Oracle and/or its affiliates.31
  • 32. MYSQL 8.0 - PASSWORD MANAGEMENT • Password rotation policies and enforcement • Password history and reuse protection • Password strength evaluation and enforcement • Password generation • Two passwords per user • Brute-force attack protection Copyright © 2020 Oracle and/or its affiliates.32
  • 33. MySQL 8.0 - AUTHORIZATION • Standards compliant user and roles management • Users, Roles, and Privileges • SQL Standard Information Schema views for SQL Roles • APPLICABLE_ROLES, ENABLED_ROLES, ROLE_TABLE_GRANTS , … • Fine grained permissions management • Admin Privileges Copyright © 2020 Oracle and/or its affiliates.33
  • 34. MYSQL 8.0 – FOCUS ON OpenSSL • OpenSSL is linked dynamically • OpenSSL versions can be patched at OS level • Support for FIPs compliance • Can reconfigure certificates without restarting the server • Encrypt over the wire, TLS 1.3 support • Encrypt data at rest Copyright © 2020 Oracle and/or its affiliates.34
  • 35. MYSQL 8.0 – MONITORING • Information Schema tables • Persistent meta data • Views on the data dictionary tables • Data dictionary is implemented as system tables in InnoDB • Performance Schema tables • Volatile meta data, lost upon restart • SYS Schema • Stored routines • Task oriented reports Copyright © 2020 Oracle and/or its affiliates.35
  • 36. MySQL 8.0 - PERFORMANCE SCHEMA • Statement latency statistics • What is the latency distribution for a given SQL statement? • Data Locks • Which user threads are waiting for which locks? Who holds them? • SQL Errors • Which errors have been sent back to clients? When? How often? • Configuration Variables • What is the current value? Who set it? When? 36 Copyright © 2020 Oracle and/or its affiliates.
  • 37. MYSQL 8.0 – MANAGEMENT • Manage over a user connection or use the MySQL Shell • Eliminate the need to access the host machine • Eliminate the need to restart the server • Configuration changes by SQL DDL • SET PERSIST (mostly online) • RESTART (still required in some cases) • Auto Upgrade • The system reads the «on disk» version • Execute upgrade code if needed Copyright © 2020 Oracle and/or its affiliates.37
  • 38. MySQL Shell Ease of Use - To a new level Copyright © 2020 Oracle and/or its affiliates.38
  • 39. Meet Ada Copyright © 2020 Oracle and/or its affiliates.39 • Meet Ada, the DevOps • Ada is smart • Ada is using the MySQL Shell Ada Hello!
  • 40. MySQL Shell : Modern Copyright © 2020 Oracle and/or its affiliates.40 • Colorful Prompt Themes • Autocompletion • Syntax Highlighting • Context Sensitive Help • Command History • Pager, less/more • Output Formats
  • 41. MySQL Shell : Flexible Copyright © 2020 Oracle and/or its affiliates.41 • SQL, JavaScript, Python • Interactive & Batch • SQL Client • Document Store • InnoDB Cluster Admin • InnoDB ReplicaSet Admin
  • 42. MySQL Shell : Extendible Copyright © 2020 Oracle and/or its affiliates.42 • Utilities – upgradeChecker() – importJSON() – importTable() • Reporting Framework – show watch • User Defined Plugins – JS or Python Ada I adapted it to my prod environment!
  • 43. MySQL CLONE Fast instance provisioning Copyright © 2020 Oracle and/or its affiliates.43
  • 44. MySQL 8 – CLONE Copyright © 2020 Oracle and/or its affiliates.44 WHY IS CLONE SUCH A BIG DEAL? • Puts the power of fast instance provisioning into the hands of everybody • Reduces the complex provisioning procedure to a few simple steps • Even happens automatically when needed when using InnoDB Cluster • Can be done fully remotely Ada CLONE makes my life easy!
  • 45. MySQL 8 - CLONE Directly from SQL Copyright © 2020 Oracle and/or its affiliates.45 “User traffic is growing and I need a new read replica” Provision a new slave (RECIPIENT) from an existing master (DONOR) R/W Load MySQL Shell Are you ready? DONOR RECIPIENT
  • 46. MySQL – 8 CLONE Setup the DONOR Copyright © 2020 Oracle and/or its affiliates.46 mysql> INSTALL PLUGIN CLONE SONAME "mysql_clone.so"; mysql> CREATE USER clone_user IDENTIFIED BY "clone_password"; mysql> GRANT BACKUP_ADMIN ON *.* to clone_user; MySQL Shell INSTALL PLUGIN
  • 47. MySQL 8 - CLONE Setup the RECIPIENT Copyright © 2020 Oracle and/or its affiliates.47 mysql> INSTALL PLUGIN CLONE SONAME "mysql_clone.so"; mysql> SET GLOBAL clone_valid_donor_list = "donor.host.com:3306"; mysql> CREATE USER clone_user IDENTIFIED BY "clone_password"; mysql> GRANT BACKUP_ADMIN ON *.* to clone_user; MySQL Shell INSTALL PLUGIN
  • 48. MySQL 8 - Connect to RECIPIENT and execute CLONE SQL statement Copyright © 2020 Oracle and/or its affiliates.48 mysql> CLONE INSTANCE -> FROM [email protected]:3306 -> IDENTIFIED BY "clone_password"; R/W Load MySQL Shell CLONE INSTANCE
  • 49. MySQL 8 - CLONE Check Status Copyright © 2020 Oracle and/or its affiliates.49 mysql> select STATE, … > from performance_schema.clone_status; +-------------+---------------------+------------+ | STATE | START TIME | DURATION | +-------------+---------------------+------------+ | In Progress | 2019-07-17 17:23:26 | 4.84 m | +-------------+---------------------+------------+
  • 50. MySQL 8 - CLONE Check Progress Copyright © 2020 Oracle and/or its affiliates.50 mysql> select STATE, … > from performance_schema.clone_progress; +-----------+-------------+------------+----------+------------+---------+ | STAGE | STATE | START TIME | DURATION | Estimate | Done(%) | +-----------+-------------+------------+----------+------------+---------+ | DROP DATA | Completed | 17:23:26 | 790.86 ms | 0 MB | 100% | | FILE COPY | Completed | 17:23:27 | 10.33 m | 94,729 MB | 100% | | PAGE COPY | Completed | 17:33:47 | 15.91 s | 11,885 MB | 100% | | REDO COPY | Completed | 17:34:03 | 1.07 s | 293 MB | 100% | | FILE SYNC | In Progress | 17:34:04 | 51.68 s | 0 MB | 0% | | RESTART | Not Started | NULL | NULL | 0 MB | 0% | | RECOVERY | Not Started | NULL | NULL | 0 MB | 0% | +-----------+-------------+------------+-----------+-----------+---------+
  • 51. MySQL InnoDB Cluster High Availability - Out of the Box Copyright © 2020 Oracle and/or its affiliates.51
  • 52. MySQL 8 - MySQL InnoDB Cluster 52 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate • MySQL Group Replication – High Availability – Elastic, Fault Tolerant, Self Healing • MySQL Router – Connection Routing, Load Balancing • MySQL Shell – Easy Setup & Administration Copyright © 2020 Oracle and/or its affiliates.
  • 53. MySQL 8 – GROUP REPLICATION Initialize group Detect node failure Reestablish group Elect new primary Recover from failure Rejoin group Grow and shrink group Provision new members Topology Meta-data Router Notification Observability Copyright © 2020 Oracle and/or its affiliates.53 A B C D E
  • 54. MySQL 8 – REPLICATION TECHNOLOGY • Multi-threaded Replication Applier With WRITESETs • Faster Slaves - higher end-to-end throughput • Global Transaction Identifiers (GTIDs) • Track replication changes seamlessly across replication chains • Replicated state machines • Coordinate, synchronize and execute distributed operations using well known and proven distributed algorithms such as Paxos Copyright © 2020 Oracle and/or its affiliates.54
  • 55. MySQL 8 – DISTRIBUTED AND COORDINATED AUTOMATION • Fault-detection • Automatic detection of failed servers in the cluster • Server fencing • Automatic isolation of faulty servers from the app and the cluster • Data consistency levels • Distributed commit protocol enabling reading your own writes • Distributed recovery • Automatic (re)syncing procedure for servers joining a cluster • Flow control • Automatic server throttling preventing unbounded secondary lag • Membership services • Automatic, dynamic list of servers in the cluster and their status Copyright © 2020 Oracle and/or its affiliates.55
  • 56. MySQL InnoDB Cluster Mini-tutorial Copyright © 2020 Oracle and/or its affiliates.56
  • 57. MySQL InnoDB Cluster Copyright © 2020 Oracle and/or its affiliates.57 Primary Secondary • configureInstance() • createCluster() • addInstance() • removeInstance() • rejoinInstance() MySQL Router MySQL Shell R/W Load And here CLONE is fully automated!
  • 58. Pre-requisites : Install and start MySQL on 3 servers Copyright © 2020 Oracle and/or its affiliates.58 MySQL Shell Install and start Note: mysqld is managed by Linux systemd
  • 59. mysql-js>dba.configureInstance('clusteradmin@mysql1') Copyright © 2020 Oracle and/or its affiliates.59 MySQL Shell binlog_checksum = NONE enforce_gtid_consistency = ON gtid_mode=ON server_id= <unique ID> Configure instance
  • 60. mysql-js>dba.configureInstance('clusteradmin@mysql2') Copyright © 2020 Oracle and/or its affiliates.60 MySQL Shell binlog_checksum = NONE enforce_gtid_consistency = ON gtid_mode=ON server_id= <unique ID> Configure instance
  • 61. mysql-js>dba.configureInstance('clusteradmin@mysql3') Copyright © 2020 Oracle and/or its affiliates.61 MySQL Shell binlog_checksum = NONE enforce_gtid_consistency = ON gtid_mode=ON server_id= <unique ID> Configure instance
  • 62. mysql-js> cluster=dba.createCluster(‘FOSDEM2020') Copyright © 2020 Oracle and/or its affiliates.62 MySQL Shell Create cluster
  • 63. mysql-js> cluster.status() { "clusterName": “FOSDEM2020", "defaultReplicaSet": { "name": "default", "primary": "mysql1:3306", "ssl": "REQUIRED", "status": "OK_NOT_TOLERANT", "statusText": "Cluster is NOT tolerant to any failures.", "topology": { … }, "topologyMode": "Single Primary" }, "groupInformationSourceMember": "mysql1:3306" mysql-js> cluster.status() Copyright © 2020 Oracle and/or its affiliates.63 MySQL Shell FOSDEM2020 Status? NOT FAULT TOLERANT
  • 64. mysql-js> cluster.addInstance('clusteradmin@mysql2') Copyright © 2020 Oracle and/or its affiliates.64 MySQL Shell FOSDEM2020 CLONEAdd instance
  • 65. mysql-js> cluster.addInstance('clusteradmin@mysql3') Copyright © 2020 Oracle and/or its affiliates.65 MySQL Shell FOSDEM2020 CLONE Add instance
  • 66. MySQL Shell : Add Instance with CLONE Progress Reporting Copyright © 2020 Oracle and/or its affiliates.66 MySQL Shell FOSDEM2020 FINISHED in one second
  • 67. mysql-js> cluster.status() Copyright © 2020 Oracle and/or its affiliates.67 FOSDEM2020 mysql-js> cluster.status() { "clusterName": “FOSDEM2020", "defaultReplicaSet": { "name": "default", "primary": "mysql1:3306", "ssl": "REQUIRED", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": { …CUT… }, "topologyMode": "Single Primary" }, "groupInformationSourceMember": "mysql1:3306" } MySQL Shell Status? FAULT TOLERANT
  • 68. # mysqlrouter --bootstrap clusteradmin@mysql1 --user=routeradmin # systemctl start mysqlrouter Copyright © 2020 Oracle and/or its affiliates.68 MySQL Router R/W Load MySQL Shell Starting mysqlrouter and adding r/w load FOSDEM2020
  • 69. mysql1# kill -9 $(pidof mysqld) Copyright © 2020 Oracle and/or its affiliates.69 MySQL Router R/W Load MySQL Shell Testing... Killing primary mysqld... FOSDEM2020
  • 70. MySQL: New Primary Copyright © 2020 Oracle and/or its affiliates.70 MySQL Router R/W Load MySQL Shell OK, mysql1 left the group and mysql2 became the new primary FOSDEM2020
  • 71. 1. Automatic, self healing • Binlog (if GTID available in group) • CLONE (otherwise) 2. Manual fix • Self healing failed, e.g. network failure • rejoinInstance() • CLONE 3. Replace with new instance (permanent failure) • removeInstance() • addInstance() • CLONE MySQL: How to regain Fault Tolerance? Copyright © 2020 Oracle and/or its affiliates.71 FOSDEM2020
  • 72. mysql-js> cluster.rejoinInstance('clusteradmin@mysql1') Copyright © 2020 Oracle and/or its affiliates.72 MySQL Router R/W Load MySQL Shell rejoinInstance() CLONE FOSDEM2020
  • 73. MySQL: Fault Tolerant Again Copyright © 2020 Oracle and/or its affiliates.73 MySQL Router R/W Load MySQL Shell THANK YOU! FOSDEM2020
  • 74. MySQL 8 – CONNECTORS AND DRIVERS Copyright © 2020 Oracle and/or its affiliates.74 MySQL Engineering • Node.js Driver (Connector/Node.js) • Python Driver (Connector/Python) • C++ Driver (Connector/C++) • C Driver (Connector/C) • C API (mysqlclient) • ADO.NET (Connector/NET) • ODBC (Connector/ODBC) • JDBC (Connector/J) Community • PHP Drivers for MySQL – (mysqli, ext/mysqli, PDO_MYSQL, PHP_MYSQLND) • Perl Driver for MySQL (DBD::mysql) • Ruby Driver for MySQL (ruby-mysql) • C++ Wrapper for MySQL C API (MySQL++) • Go MySQL Driver • NodeJS (mysql, mysql2)
  • 75. MySQL 8 – SOURCE CODE • Open Source (GPL) • GitHub https://github.com/mysql/mysql-server • Wide platform coverage • C++ 14 , Use of standard constructs, e.g. std::atomic • Cleaning up header files dependencies • Warning-free with GCC 8 and Clang 6 • Asan and Ubsan clean • Google C++ Style Guide • MySQL Source Code Documentation Copyright © 2020 Oracle and/or its affiliates.75
  • 76. MySQL 8 - The complete list of new features Copyright © 2020 Oracle and/or its affiliates.76 https://mysqlserverteam.com/the-complete-list-of-new-features-in-mysql-8-0/
  • 77. MySQL Community on Slack Copyright © 2020 Oracle and/or its affiliates. https://lefred.be/mysql-community-on-slack/ 77
  • 78. MySQL on Social Media Copyright © 2020 Oracle and/or its affiliates. https://www.facebook.com/mysql https://twitter.com/mysql https://www.linkedin.com/company/mysql 78