SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
The Quick and Easy Guide to
    Speeding up MySQL
      For Website Developers
The Quick and Easy Guide to
Speeding up MySQL
Introduction

 Presentation for developers who only
 tune up MySQL when they really have to.
 Basic steps and good practices for using
 and speeding up MySQL - so that
 MySQL will work better for you.
Introduction

 90% of the reasons why MySQL is slow
 is due to bad schema design.. or in other
 words how the database is setup vs how
 you use it.
 MySQL is fast. No really, it is. It just
 needs some attention every now and
 then.
Monitoring

 We use Nagios to monitor MySQL. Some
 examples..
   What you can't measure, you can't
   improve
 EXPLAIN SELECT. Some examples..
 Benchmarking
   Whole application or some scripts?
 Profiling (and slowlog)
Choosing the Right Data Type

 Int/Decimal/Char/Varchar/.....
 Text/BLOB
 Enum/Set
 DateTime /Timestamp 
   (..update current_timestamp)
 Unsigned/Signed
 Null/Not Null
 Procedure Analyse()
Choosing the Right Storage Engine

 MyISAM vs InnoDB
 Table Locking Vs Row-level Locking
 Memory
 Archive
 CSV
Some MySQL Internals

 Key Buffer
 Innodb Buffer Pool Size
 Query Cache
 Thread Cache
 Temp Tables (Memory Vs on-Disk)
 Optimize tables
 Partitioning (MySQL 5.1)
Replication

  Mostly Reads
    Master-Slave
  Mostly Writes
    Master-Master
  Backups
  High Availability
Application Side Improvements

 Storing Duplicate Data
   De-normalize
 Stored Results (Summary/Cache Table)
   Count() in its own Table
 Stored Conditions
 Stored Reports
 Involving the database much more with
 your application
Application Side Improvements

Unix Philosophy - Rule of Representation
  quot;Fold knowledge into data, so program logic can be stupid
  and robust.quot;
  quot;Even the simplest procedural logic is hard for humans to
  verify, but quite complex data structures are fairly easy
  to model and reason about.quot;
     John Bently
The End
      Q&A

    hope you found 
the presentation useful

Contenu connexe

Tendances

Scaling Your Web Application
Scaling Your Web ApplicationScaling Your Web Application
Scaling Your Web Application
Ketan Deshmukh
 
Caching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant VashishthaCaching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant Vashishtha
ShriKant Vashishtha
 

Tendances (12)

Architecture Of Large Scale Websites
Architecture Of Large Scale WebsitesArchitecture Of Large Scale Websites
Architecture Of Large Scale Websites
 
Regression Test Old ETL
Regression Test Old ETLRegression Test Old ETL
Regression Test Old ETL
 
Scaling Your Web Application
Scaling Your Web ApplicationScaling Your Web Application
Scaling Your Web Application
 
Stacktrace Berlin RC.2
Stacktrace Berlin RC.2Stacktrace Berlin RC.2
Stacktrace Berlin RC.2
 
How to Boost WordPress Site Speed in 10 Steps
How to Boost WordPress Site Speed in 10 StepsHow to Boost WordPress Site Speed in 10 Steps
How to Boost WordPress Site Speed in 10 Steps
 
NoSQL isn't NO SQL
NoSQL isn't NO SQLNoSQL isn't NO SQL
NoSQL isn't NO SQL
 
Ohio Valley Oracle Application User Group
Ohio Valley Oracle Application User GroupOhio Valley Oracle Application User Group
Ohio Valley Oracle Application User Group
 
admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)
 
Running MySQL in AWS
Running MySQL in AWSRunning MySQL in AWS
Running MySQL in AWS
 
Elasticsearch in production
Elasticsearch in productionElasticsearch in production
Elasticsearch in production
 
Caching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant VashishthaCaching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant Vashishtha
 
Ajax
AjaxAjax
Ajax
 

Similaire à Quick And Easy Guide To Speeding Up MySQL for web developers

Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
Liran Zelkha
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
Aaron Shilo
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 

Similaire à Quick And Easy Guide To Speeding Up MySQL for web developers (20)

My sql performance tuning course
My sql performance tuning courseMy sql performance tuning course
My sql performance tuning course
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
Understanding AWS Database Options (DAT201) | AWS re:Invent 2013
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
 
Speed up sql
Speed up sqlSpeed up sql
Speed up sql
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the field
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
Os Solomon
Os SolomonOs Solomon
Os Solomon
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Python
 
Making MySQL Great For Business Intelligence
Making MySQL Great For Business IntelligenceMaking MySQL Great For Business Intelligence
Making MySQL Great For Business Intelligence
 
World-class Data Engineering with Amazon Redshift
World-class Data Engineering with Amazon RedshiftWorld-class Data Engineering with Amazon Redshift
World-class Data Engineering with Amazon Redshift
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQL
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Quick And Easy Guide To Speeding Up MySQL for web developers

  • 1. The Quick and Easy Guide to Speeding up MySQL For Website Developers
  • 2. The Quick and Easy Guide to Speeding up MySQL
  • 3. Introduction Presentation for developers who only tune up MySQL when they really have to. Basic steps and good practices for using and speeding up MySQL - so that MySQL will work better for you.
  • 4. Introduction 90% of the reasons why MySQL is slow is due to bad schema design.. or in other words how the database is setup vs how you use it. MySQL is fast. No really, it is. It just needs some attention every now and then.
  • 5. Monitoring We use Nagios to monitor MySQL. Some examples.. What you can't measure, you can't improve EXPLAIN SELECT. Some examples.. Benchmarking Whole application or some scripts? Profiling (and slowlog)
  • 6. Choosing the Right Data Type Int/Decimal/Char/Varchar/..... Text/BLOB Enum/Set DateTime /Timestamp  (..update current_timestamp) Unsigned/Signed Null/Not Null Procedure Analyse()
  • 7. Choosing the Right Storage Engine MyISAM vs InnoDB Table Locking Vs Row-level Locking Memory Archive CSV
  • 8. Some MySQL Internals Key Buffer Innodb Buffer Pool Size Query Cache Thread Cache Temp Tables (Memory Vs on-Disk) Optimize tables Partitioning (MySQL 5.1)
  • 9. Replication Mostly Reads Master-Slave Mostly Writes Master-Master Backups High Availability
  • 10. Application Side Improvements Storing Duplicate Data De-normalize Stored Results (Summary/Cache Table) Count() in its own Table Stored Conditions Stored Reports Involving the database much more with your application
  • 11. Application Side Improvements Unix Philosophy - Rule of Representation quot;Fold knowledge into data, so program logic can be stupid and robust.quot; quot;Even the simplest procedural logic is hard for humans to verify, but quite complex data structures are fairly easy to model and reason about.quot; John Bently
  • 12. The End Q&A hope you found  the presentation useful