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

Architecture Of Large Scale Websites
Architecture Of Large Scale WebsitesArchitecture Of Large Scale Websites
Architecture Of Large Scale WebsitesFeng Yu
 
Regression Test Old ETL
Regression Test Old ETLRegression Test Old ETL
Regression Test Old ETLspredslide
 
Scaling Your Web Application
Scaling Your Web ApplicationScaling Your Web Application
Scaling Your Web ApplicationKetan Deshmukh
 
Stacktrace Berlin RC.2
Stacktrace Berlin RC.2Stacktrace Berlin RC.2
Stacktrace Berlin RC.2Oliver Seemann
 
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 StepsLazylord
 
Ohio Valley Oracle Application User Group
Ohio Valley Oracle Application User GroupOhio Valley Oracle Application User Group
Ohio Valley Oracle Application User GroupKyle Goodfriend
 
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)Anower Perves
 
Elasticsearch in production
Elasticsearch in productionElasticsearch in production
Elasticsearch in productionfoundsearch
 
Caching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant VashishthaCaching fundamentals by Shrikant Vashishtha
Caching fundamentals by Shrikant VashishthaShriKant 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

My sql performance tuning course
My sql performance tuning courseMy sql performance tuning course
My sql performance tuning courseAlberto Centanni
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysqlliufabin 66688
 
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 2013Amazon Web Services
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the fieldInnoTech
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive WritesLiran Zelkha
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016Aaron Shilo
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
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
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and ScalabilityMediacurrent
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch ProcessingChris Adkin
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Pythondidip
 
Making MySQL Great For Business Intelligence
Making MySQL Great For Business IntelligenceMaking MySQL Great For Business Intelligence
Making MySQL Great For Business IntelligenceCalpont
 
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 RedshiftLars Kamp
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability ConsiderationsNavid Malek
 
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 2012Amazon Web Services
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQLUlf Wendel
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMariaDB plc
 

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

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

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