SlideShare a Scribd company logo
Getting Modern With MySQL
Who am I and why do I think I know about it?
Jakob Lorberblatt
Open source database consultant and enthusiast
- Teaches for a triangle area (here) girls coding club (shameless plug)
- Has a 20 year long obsession with open source technology.
- Loves to talk about software and linux
- Works as a database consultant for Pythian a top global provider for
database management services and cloud enablement that totally
loves your data!
The confusion with versions
Major Versions:
Surprise! They aren’t all that logical!
5.1 - no longer supported
5.5 - Oldest version still officially supported
5.6 - Current Stable (most common)
5.7 - First in the newer series, less
compatible with older usage.
8.0 - Latest Release, great feature set,
complete redesign, not all tools work here
yet.
MariaDB versions do not
directly correspond to
MySQL versions.
10.0 - is 5.5 with some extras
10.1 - is 5.6 ish for most
considerations.
10.2 - has some 5.7 in it.
10.3 - 5.7 and 8.0 as well as
mariadb specific functionality
beyond the scope of this
document
Percona Server versions correspond
directly to MySQL Versions
The types of dangers you may encounter
Deprecated / changed
Configuration parameters
-
Will prevent server startup
New reserved keywords
-
Errors on execution
Deprecated Syntax
-
Warnings
Eliminated Syntax
-
Failed statements
Performance Issues with specific
queries
New configuration required
Old configuration no longer valid
in new version
Removed functionality or storage
types referenced (myisam
support is removed in 8.0!)
-
What did we start with to get in this mess?
Your old software was great! Upgrading
doesn’t mean losing what you had.
- Ease of repair
- Efficiency with existing usage pattern
- Connectivity through the same libraries
- Software security and stability
- Sleek originality your not currently in
search of new solution
What are you trying to get too?
- Modern Feature Set
- Current patches and update cycle
- Efficiency gains and improvements
- Specific features and enablements
- Support for modern hardware or
cloud based hosting
- Continued odds of finding your
problem’s solution on stackoverflow
or at least a group of others to rant
about it with online
The Basics, how do you get there?
ALWAYS BACKUP YOUR DATA FIRST!!
1) Remove or unlink your existing
mysql install.
2) Install Upgraded packages, at this
point you may only advance 1 version
eg: 5.1 to 5.5 or 5.5 to 5.6
3) Start mysql, examine the error log as
some my.cnf options may have been
deprecated or changed, preventing
system startup.
4) Adjust until fixed
5) Run
‘mysql_upgrade -u root_like_user -p’
6) Although not absolutely required for
all versions it is needed for some so I
recommend restarting mysql again at
this point.
What’s Stopping you?
- Version Compatibility
- Infrastructure Compatibility
- Replication Compatibility
- Business Process Changes
- Development cycles
- Confusion about any of the above
- Inability to resolve issues with any of
the above
- Difficulty in testing any of the above.
- Pt-upgrade
- proxySQL
- Pt-query-digest
- Higher version replicas
- Lower testing environments for
applications
- PMM or other time series analysis
- Black hole relays, in special
circumstances.
How to bridge the gap to address these issues?
pt-upgrade fundamentals
- Create a clone of your existing data.
- Setup clone server with a newer
version of mysql
- Run mysql_upgrade on clone
- Set long_query_time set to 0
- Collect a slow query log
- Transfer the slow log to the clone
- Run pt-upgrade on the clone
- Keep in mind the queries are run in
serial, this will take some time
- Analyze the differences.
Additional Information:
Official Site:
https://www.percona.com/doc/percona-toolkit/LATEST/pt-upgrade.html
Required Configuration:
https://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html
What they don’t tell you
What it does do:
- Provides a one to one
comparison between queries on
one version of the software to a
newer one
- Provides content of error
messages if they occur
- Helps scan code for issues with
new keywords or deprecated
statements
What it doesn’t do:
- Provide any sort of load
testing.
- Have any ability to analyze
queries that were not
supplied in the log file.
- Provide the results in an
easy to parse format
- Slow log is applied in a single threaded fashion
- Results are based on a 1-1 basis and dumped to the filesystem
- Many samples of the same query are all compared separately
Things to watch out for:
Saving results will save the ENTIRE result set for
each iteration of a query, if this is the intended
Effect make sure you have enough space in the
target volume.
PT-QUERY-DIGEST for simplification
https://blog.pythian.com/increasing-functional-testing-velocity-pt-query-digest/
Filters by query pattern
Example:
pt-query-digest --limit=100% --sample 1 --no-report --output slowlog ./testslow.log
- Outputs only first pattern match
- Minimizes overall number of queries needed to perform a functional test
Interpreting the Results
Where do I look for the results of
pt-query-digest?
All of the output is dumped into a
directory, the lines are mapped one for
one, statement executed to result.
“grep ERROR results” should give you
a lot of feedback.
What do I do with what went
wrong?
- Sql_mode is a powerful
variable, it can revert
behaviors.
- Rewrite queries
- Remove deprecated
syntax usage
- quote in backticks any
usages of newly
introduced reserved
keywords.
ProxySQL
- Amazing Mirror functionality, allows a complete copy of traffic in real time to be applied to a second
server, real life load testing!
- Dynamic routing of traffic based on custom rule sets allowing read to be directed to a newer version
- New and cool ways to test and move upgrades into production.
http://proxysql.com
How Mirroring works and why it is so cool
- Provides a real time duplication of traffic to the new server
- Allows you to collect data about the new version under realistic
loads using your real schema and data without affecting existing
production servers!
- Does not checks the results or guarantee every transaction is
mirrored!
Half way betwixt and testing environments
And through the drifts the snowy clifts
Did send a dismal sheen:
Nor shapes of men nor beasts we ken—
The ice was all between.
- Samuel Taylor Coleridge
Things to remember:
- You can always replicate from an older version to the next
newest version, this is a fully supported behavior.
-
- Data formats may change, once upgraded there is no going
back for the physical data, it would require a logical dump.
-
- Replication format can strongly affect behavior, MIXED or ROW
format replication is STRONGLY recommended
-
- Tables without primary keys in combination with ROW based
replication can result in high lag on the slave server
-
Black Hole Relays
What is a black hole relay? Why would you want
to blackhole your data
- A black hole table will allow insert but
contains no data (like /dev/null)
- The black hole insert will still get written to
the binary log, allowing a slave to duplicate
the transaction.
- The binary log is read and written by the
version of the server hosting the black hole
tables.
- Version to version replication is officially
supported only to the next major version. If
you are intending to jump from 5.1 to 5.7
you would have a “blackhole” instance for
5.5. And 5.6 inbetween.
How to build a relay and how it works
- Take a full backup of the 5.1 server, expand it on
the 5.7 slave, upgrade it for 5.5 then 5.6 and finally
5.7
- “mysqldump --no-data --all-databases” will get you
a schema dump from the 5.1 master, sed -i
‘s/INNODB/BLACKHOLE/’ yourdumpfile.sql
- Load this schema dump into the 5.5 and 5.6
servers with log-slave-updates on.
- Setup 5.5 with the replication positions from the
backup
- Setup 5.6 with the show master status from 5.5
- Setup 5.7 with the show master status from 5.6
- Now start replication on each.
Using PMM to track down issues
https://www.percona.com/doc/percona-monitoring-and-management/index.html
PMM is a tool that collects metrics on
the database instance every second
This is done using an agent on the
database server called an exporter
Its collected in prometheus time series
database
The results are then displayed using
grafana for very pretty visualizations
It also does real time query analytics!
Somethings are going to break, what do I do?
Sql_mode - many things that are “deprecated” are
actually just disabled by a flag here.
Keywords can be wrapped in backticks
Default values can be changed
Queries can be restructured
FORCE INDEX can be a way to reverse optimizer
plan changes
Indexes can be added / removed
Performance can be tuned through configuration

More Related Content

What's hot

From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Clusterguestd34230
 
Moving to moodle 2
Moving to moodle 2Moving to moodle 2
Moving to moodle 2
JISC RSC Eastern
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Frederic Descamps
 
Releases - CFEngine presentation - Configuration Management Camp 2015
Releases - CFEngine presentation - Configuration Management Camp 2015Releases - CFEngine presentation - Configuration Management Camp 2015
Releases - CFEngine presentation - Configuration Management Camp 2015
kacfengine
 
RedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
RedisConf17 - Too Big to Failover - A cautionary tale of scaling RedisRedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
RedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
Redis Labs
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
Lars Östling
 
PostgreSQL: meet your queue
PostgreSQL: meet your queuePostgreSQL: meet your queue
PostgreSQL: meet your queue
Theo Schlossnagle
 
Mule quartz hari_gatadi
Mule quartz hari_gatadiMule quartz hari_gatadi
Mule quartz hari_gatadi
Hari Gatadi
 
Wps ol client_tutorial-1
Wps ol client_tutorial-1Wps ol client_tutorial-1
Wps ol client_tutorial-1goodmanding1
 
Flyway: The agile database migration framework for Java
Flyway: The agile database migration framework for JavaFlyway: The agile database migration framework for Java
Flyway: The agile database migration framework for JavaAxel Fontaine
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Tim Callaghan
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Chris Tankersley
 
Flyway
FlywayFlyway
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
Pranith Karampuri
 
“Bootify your app - from zero to hero
“Bootify  your app - from zero to hero“Bootify  your app - from zero to hero
“Bootify your app - from zero to hero
Izzet Mustafaiev
 
1. Scaling PHP/MySQL...Presentation from Flickr
	
1.	
Scaling PHP/MySQL...Presentation from Flickr	
1.	
Scaling PHP/MySQL...Presentation from Flickr
1. Scaling PHP/MySQL...Presentation from Flickrakshat
 
2021.laravelconf.tw.slides1
2021.laravelconf.tw.slides12021.laravelconf.tw.slides1
2021.laravelconf.tw.slides1
LiviaLiaoFontech
 
Sutol How To Be A Lion Tamer
Sutol How To Be A Lion TamerSutol How To Be A Lion Tamer
Sutol How To Be A Lion Tamer
Sharon James
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydb
Girish Bapat
 
Filas com php
Filas com phpFilas com php
Filas com php
Ivan Rosolen
 

What's hot (20)

From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
Moving to moodle 2
Moving to moodle 2Moving to moodle 2
Moving to moodle 2
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadmin
 
Releases - CFEngine presentation - Configuration Management Camp 2015
Releases - CFEngine presentation - Configuration Management Camp 2015Releases - CFEngine presentation - Configuration Management Camp 2015
Releases - CFEngine presentation - Configuration Management Camp 2015
 
RedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
RedisConf17 - Too Big to Failover - A cautionary tale of scaling RedisRedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
RedisConf17 - Too Big to Failover - A cautionary tale of scaling Redis
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
 
PostgreSQL: meet your queue
PostgreSQL: meet your queuePostgreSQL: meet your queue
PostgreSQL: meet your queue
 
Mule quartz hari_gatadi
Mule quartz hari_gatadiMule quartz hari_gatadi
Mule quartz hari_gatadi
 
Wps ol client_tutorial-1
Wps ol client_tutorial-1Wps ol client_tutorial-1
Wps ol client_tutorial-1
 
Flyway: The agile database migration framework for Java
Flyway: The agile database migration framework for JavaFlyway: The agile database migration framework for Java
Flyway: The agile database migration framework for Java
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
 
Flyway
FlywayFlyway
Flyway
 
Glusterfs session #14 replication update fops
Glusterfs session #14   replication update fopsGlusterfs session #14   replication update fops
Glusterfs session #14 replication update fops
 
“Bootify your app - from zero to hero
“Bootify  your app - from zero to hero“Bootify  your app - from zero to hero
“Bootify your app - from zero to hero
 
1. Scaling PHP/MySQL...Presentation from Flickr
	
1.	
Scaling PHP/MySQL...Presentation from Flickr	
1.	
Scaling PHP/MySQL...Presentation from Flickr
1. Scaling PHP/MySQL...Presentation from Flickr
 
2021.laravelconf.tw.slides1
2021.laravelconf.tw.slides12021.laravelconf.tw.slides1
2021.laravelconf.tw.slides1
 
Sutol How To Be A Lion Tamer
Sutol How To Be A Lion TamerSutol How To Be A Lion Tamer
Sutol How To Be A Lion Tamer
 
Getting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydbGetting started with agile database migrations for java flywaydb
Getting started with agile database migrations for java flywaydb
 
Filas com php
Filas com phpFilas com php
Filas com php
 

Similar to Getting modern with my sql

Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
drupalindia
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
Mario Beck
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
Olivier DASINI
 
MySQL HA Presentation
MySQL HA PresentationMySQL HA Presentation
MySQL HA Presentation
papablues
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
55020
 
Become a MySQL DBA: performing live database upgrades - webinar slides
Become a MySQL DBA: performing live database upgrades - webinar slidesBecome a MySQL DBA: performing live database upgrades - webinar slides
Become a MySQL DBA: performing live database upgrades - webinar slides
Severalnines
 
PoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAPoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HA
Ulf Wendel
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
Zhaoyang Wang
 
Automated Deployment
Automated DeploymentAutomated Deployment
Automated Deployment
phpne
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated DeploymentMichael Peacock
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
Synapseindiappsdevelopment
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
Ricky Setyawan
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015
Dave Stokes
 
Sql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen Nedaskivskyi
Alex Tumanoff
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
Jean-François Gagné
 
Rock Solid Sametime for High Availability
Rock Solid Sametime for High AvailabilityRock Solid Sametime for High Availability
Rock Solid Sametime for High Availability
Gabriella Davis
 
Next Generation Hadoop Operations
Next Generation Hadoop OperationsNext Generation Hadoop Operations
Next Generation Hadoop Operations
Owen O'Malley
 

Similar to Getting modern with my sql (20)

Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
 
MySQL HA Presentation
MySQL HA PresentationMySQL HA Presentation
MySQL HA Presentation
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
 
Become a MySQL DBA: performing live database upgrades - webinar slides
Become a MySQL DBA: performing live database upgrades - webinar slidesBecome a MySQL DBA: performing live database upgrades - webinar slides
Become a MySQL DBA: performing live database upgrades - webinar slides
 
PoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAPoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HA
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
Automated Deployment
Automated DeploymentAutomated Deployment
Automated Deployment
 
PHP North-East - Automated Deployment
PHP North-East - Automated DeploymentPHP North-East - Automated Deployment
PHP North-East - Automated Deployment
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015
 
Sql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen Nedaskivskyi
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
Rock Solid Sametime for High Availability
Rock Solid Sametime for High AvailabilityRock Solid Sametime for High Availability
Rock Solid Sametime for High Availability
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
Next Generation Hadoop Operations
Next Generation Hadoop OperationsNext Generation Hadoop Operations
Next Generation Hadoop Operations
 

Recently uploaded

一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
GetInData
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
AnirbanRoy608946
 

Recently uploaded (20)

一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdfEnhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
Enhanced Enterprise Intelligence with your personal AI Data Copilot.pdf
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
 

Getting modern with my sql

  • 2. Who am I and why do I think I know about it? Jakob Lorberblatt Open source database consultant and enthusiast - Teaches for a triangle area (here) girls coding club (shameless plug) - Has a 20 year long obsession with open source technology. - Loves to talk about software and linux - Works as a database consultant for Pythian a top global provider for database management services and cloud enablement that totally loves your data!
  • 3. The confusion with versions Major Versions: Surprise! They aren’t all that logical! 5.1 - no longer supported 5.5 - Oldest version still officially supported 5.6 - Current Stable (most common) 5.7 - First in the newer series, less compatible with older usage. 8.0 - Latest Release, great feature set, complete redesign, not all tools work here yet. MariaDB versions do not directly correspond to MySQL versions. 10.0 - is 5.5 with some extras 10.1 - is 5.6 ish for most considerations. 10.2 - has some 5.7 in it. 10.3 - 5.7 and 8.0 as well as mariadb specific functionality beyond the scope of this document Percona Server versions correspond directly to MySQL Versions
  • 4. The types of dangers you may encounter Deprecated / changed Configuration parameters - Will prevent server startup New reserved keywords - Errors on execution Deprecated Syntax - Warnings Eliminated Syntax - Failed statements Performance Issues with specific queries New configuration required Old configuration no longer valid in new version Removed functionality or storage types referenced (myisam support is removed in 8.0!)
  • 5. - What did we start with to get in this mess? Your old software was great! Upgrading doesn’t mean losing what you had. - Ease of repair - Efficiency with existing usage pattern - Connectivity through the same libraries - Software security and stability - Sleek originality your not currently in search of new solution
  • 6. What are you trying to get too? - Modern Feature Set - Current patches and update cycle - Efficiency gains and improvements - Specific features and enablements - Support for modern hardware or cloud based hosting - Continued odds of finding your problem’s solution on stackoverflow or at least a group of others to rant about it with online
  • 7. The Basics, how do you get there? ALWAYS BACKUP YOUR DATA FIRST!! 1) Remove or unlink your existing mysql install. 2) Install Upgraded packages, at this point you may only advance 1 version eg: 5.1 to 5.5 or 5.5 to 5.6 3) Start mysql, examine the error log as some my.cnf options may have been deprecated or changed, preventing system startup. 4) Adjust until fixed 5) Run ‘mysql_upgrade -u root_like_user -p’ 6) Although not absolutely required for all versions it is needed for some so I recommend restarting mysql again at this point.
  • 8. What’s Stopping you? - Version Compatibility - Infrastructure Compatibility - Replication Compatibility - Business Process Changes - Development cycles - Confusion about any of the above - Inability to resolve issues with any of the above - Difficulty in testing any of the above.
  • 9. - Pt-upgrade - proxySQL - Pt-query-digest - Higher version replicas - Lower testing environments for applications - PMM or other time series analysis - Black hole relays, in special circumstances. How to bridge the gap to address these issues?
  • 10. pt-upgrade fundamentals - Create a clone of your existing data. - Setup clone server with a newer version of mysql - Run mysql_upgrade on clone - Set long_query_time set to 0 - Collect a slow query log - Transfer the slow log to the clone - Run pt-upgrade on the clone - Keep in mind the queries are run in serial, this will take some time - Analyze the differences. Additional Information: Official Site: https://www.percona.com/doc/percona-toolkit/LATEST/pt-upgrade.html Required Configuration: https://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html
  • 11. What they don’t tell you What it does do: - Provides a one to one comparison between queries on one version of the software to a newer one - Provides content of error messages if they occur - Helps scan code for issues with new keywords or deprecated statements What it doesn’t do: - Provide any sort of load testing. - Have any ability to analyze queries that were not supplied in the log file. - Provide the results in an easy to parse format - Slow log is applied in a single threaded fashion - Results are based on a 1-1 basis and dumped to the filesystem - Many samples of the same query are all compared separately Things to watch out for: Saving results will save the ENTIRE result set for each iteration of a query, if this is the intended Effect make sure you have enough space in the target volume.
  • 12. PT-QUERY-DIGEST for simplification https://blog.pythian.com/increasing-functional-testing-velocity-pt-query-digest/ Filters by query pattern Example: pt-query-digest --limit=100% --sample 1 --no-report --output slowlog ./testslow.log - Outputs only first pattern match - Minimizes overall number of queries needed to perform a functional test
  • 13. Interpreting the Results Where do I look for the results of pt-query-digest? All of the output is dumped into a directory, the lines are mapped one for one, statement executed to result. “grep ERROR results” should give you a lot of feedback. What do I do with what went wrong? - Sql_mode is a powerful variable, it can revert behaviors. - Rewrite queries - Remove deprecated syntax usage - quote in backticks any usages of newly introduced reserved keywords.
  • 14. ProxySQL - Amazing Mirror functionality, allows a complete copy of traffic in real time to be applied to a second server, real life load testing! - Dynamic routing of traffic based on custom rule sets allowing read to be directed to a newer version - New and cool ways to test and move upgrades into production. http://proxysql.com
  • 15. How Mirroring works and why it is so cool - Provides a real time duplication of traffic to the new server - Allows you to collect data about the new version under realistic loads using your real schema and data without affecting existing production servers! - Does not checks the results or guarantee every transaction is mirrored!
  • 16. Half way betwixt and testing environments And through the drifts the snowy clifts Did send a dismal sheen: Nor shapes of men nor beasts we ken— The ice was all between. - Samuel Taylor Coleridge Things to remember: - You can always replicate from an older version to the next newest version, this is a fully supported behavior. - - Data formats may change, once upgraded there is no going back for the physical data, it would require a logical dump. - - Replication format can strongly affect behavior, MIXED or ROW format replication is STRONGLY recommended - - Tables without primary keys in combination with ROW based replication can result in high lag on the slave server -
  • 17. Black Hole Relays What is a black hole relay? Why would you want to blackhole your data - A black hole table will allow insert but contains no data (like /dev/null) - The black hole insert will still get written to the binary log, allowing a slave to duplicate the transaction. - The binary log is read and written by the version of the server hosting the black hole tables. - Version to version replication is officially supported only to the next major version. If you are intending to jump from 5.1 to 5.7 you would have a “blackhole” instance for 5.5. And 5.6 inbetween.
  • 18. How to build a relay and how it works - Take a full backup of the 5.1 server, expand it on the 5.7 slave, upgrade it for 5.5 then 5.6 and finally 5.7 - “mysqldump --no-data --all-databases” will get you a schema dump from the 5.1 master, sed -i ‘s/INNODB/BLACKHOLE/’ yourdumpfile.sql - Load this schema dump into the 5.5 and 5.6 servers with log-slave-updates on. - Setup 5.5 with the replication positions from the backup - Setup 5.6 with the show master status from 5.5 - Setup 5.7 with the show master status from 5.6 - Now start replication on each.
  • 19. Using PMM to track down issues https://www.percona.com/doc/percona-monitoring-and-management/index.html PMM is a tool that collects metrics on the database instance every second This is done using an agent on the database server called an exporter Its collected in prometheus time series database The results are then displayed using grafana for very pretty visualizations It also does real time query analytics!
  • 20. Somethings are going to break, what do I do? Sql_mode - many things that are “deprecated” are actually just disabled by a flag here. Keywords can be wrapped in backticks Default values can be changed Queries can be restructured FORCE INDEX can be a way to reverse optimizer plan changes Indexes can be added / removed Performance can be tuned through configuration