SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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