SlideShare a Scribd company logo
MySQL Optimization
                     Tips to increase performance




Sachin Khosla
Founder, Digimantra.com
What’s next ?
 MySQL – What’s that ?
 Optimize ? Where and What ?
 Quick Glance at the famous MySQL Storage Engines
 Many ways but we talk about Cache systems
     Query Cache
     File Cache
     MemCached
     Solr/Lucene
Let’s Go !

Have a question ?

   • If it’s a short – Shoot it ?
   • If it’s a long – Save it till end of the session :)
As many of you know !
•MySQL is a relational database
•Community Edition is free of cost
•Free GUI tools for Server Administration
•Support by the community, forums, manual/docs etc.
Why Optimize
• Cost
    • Tuned system = less resources = less investment.
    • After tuning the system, you get a real usage stat.

• Performance
     • Performance of the system increases the output :)
     • Happy developers = Happy end users

• Stay in the game
     • Undoubtedly you want to keep pace with the latest technology
     • Faster systems showcase helps bring in more business
Who Should Optimize?
Ecosystem – Who are responsible in developing that very application.

    1.   Designers – The documenting guys :)
    2.   Developers – Geeks :D
    3.   System/DB Administrators – The machines :P
Optimized, Really ?

• Benchmarking
• Profiling
• Difference between the Benchmark & Profiling


Ref - http://dev.mysql.com/tech-resources/articles/pro-mysql-ch6.html
MySQL flavors

•MyISAM – The ideal son
•InnoDB – Clever but expensive*
•Memory (Heap)
MyISAM                          InnoDB
•Of course, there is no        •Of course, there is no
difference. It’s just you !    difference. It’s just you !
•You need speed and term       •You understand, what
“transaction” is martian for   transactions are and how are
you.                           they going to effect.
•You sure about the size of    •Sky is the limit – did you
the data in your database.     smell cloud computing,eh?
•Data is stored in insertion   •Rows are physically ordered
order. (no clustered index)    by the primary key
Memory (Heap)
• Faster, Performance booster
• Intermediary table
• Use it when you have more select than insert
• Table Structure remains not the data
• Fixed length for data types like varchar
• No support for text, blob
Finally, ways to boost performance
• Mysql Query Cache
• File Cache system
• Memcached
• Solr / Lucene
Mysql Query Cache
• Internal cache system of MySQL
• Caches the queries being fired
• Never returns stale data
• Good when you have less or almost no inserts
• Be sure to choose an optimum size for cache
   (query_cache_size)
File Cache system

• Traditional way of caching with files.
• Saves database server ping.
• Still accesses the file structure.
• No Big Deal !
Memcached
• How is it different than traditional cache ?
• Can it improve my site’s application’s performance ?
• How ?
          $mem = new Memcache(); //PECL extn in PHP
          $mem->connect(‘SERVER_NAME’,’PORT_NO’); //connect
          $mem->set(‘key’,’data’);   //set memcached KV pair
          $mem->get(‘key’);          //get data
Solr / Lucene
•Hit highlighting, faceted search, caching, replication,
and a web administration interface – Heavy terms ?

•In simple terms it’s a server which has indexes of the
database and when you send a request to it, it return
you data in the form of XML/JSON
Other ways
• Query Optimization
    • Using Explain
    • Show table status (InnoDB / MySQL)
    • Show InnoDB status (indexes and all )
•Table level Optimization
    • Normalization
• DB Server Level
    • mysqld status
    • Process monitoring tools
Q&A
Thank you !



    www.digimantra.com
      Twitter - @realin
FB – http://fb.me/sachinkhosla

More Related Content

What's hot

High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
Barry Abrahamson
 
Zarafa SummerCamp 2012 - Exchange Web Services on Zarafa
Zarafa SummerCamp 2012 - Exchange Web Services on ZarafaZarafa SummerCamp 2012 - Exchange Web Services on Zarafa
Zarafa SummerCamp 2012 - Exchange Web Services on ZarafaZarafa
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010Barry Abrahamson
 
SPCA2013 - Automating SharePoint
SPCA2013 - Automating SharePointSPCA2013 - Automating SharePoint
SPCA2013 - Automating SharePoint
NCCOMMS
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
Chris Westin
 
Multi-tenant Database Design for SaaS
Multi-tenant Database Design for SaaSMulti-tenant Database Design for SaaS
Multi-tenant Database Design for SaaS
Võ Duy Tuấn
 
SPCA2013 - Taming BIG SharePoint
SPCA2013 - Taming BIG SharePointSPCA2013 - Taming BIG SharePoint
SPCA2013 - Taming BIG SharePoint
NCCOMMS
 
Microsoft Azure SQL Premium
Microsoft Azure SQL PremiumMicrosoft Azure SQL Premium
Microsoft Azure SQL Premium
Tallan
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
Tekno Point
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
Eric Landmann
 
Introduction to maya
Introduction to mayaIntroduction to maya
Introduction to maya
ManamiIshimura
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScalemmoline
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
arya krazydude
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
Steve Fort
 
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningSQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningPolish SQL Server User Group
 
Learn css step by step online course
Learn css step by step online course Learn css step by step online course
Learn css step by step online course
Naeem Hussain
 
Memcache
MemcacheMemcache
Memcache
Abhinav Singh
 
Sql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldSql Server Service Broker In The Real World
Sql Server Service Broker In The Real World
Quest Software
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101Mike Willbanks
 

What's hot (20)

High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
 
Zarafa SummerCamp 2012 - Exchange Web Services on Zarafa
Zarafa SummerCamp 2012 - Exchange Web Services on ZarafaZarafa SummerCamp 2012 - Exchange Web Services on Zarafa
Zarafa SummerCamp 2012 - Exchange Web Services on Zarafa
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
 
SPCA2013 - Automating SharePoint
SPCA2013 - Automating SharePointSPCA2013 - Automating SharePoint
SPCA2013 - Automating SharePoint
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
 
Multi-tenant Database Design for SaaS
Multi-tenant Database Design for SaaSMulti-tenant Database Design for SaaS
Multi-tenant Database Design for SaaS
 
SPCA2013 - Taming BIG SharePoint
SPCA2013 - Taming BIG SharePointSPCA2013 - Taming BIG SharePoint
SPCA2013 - Taming BIG SharePoint
 
Microsoft Azure SQL Premium
Microsoft Azure SQL PremiumMicrosoft Azure SQL Premium
Microsoft Azure SQL Premium
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
 
Introduction to maya
Introduction to mayaIntroduction to maya
Introduction to maya
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
 
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningSQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
 
Learn css step by step online course
Learn css step by step online course Learn css step by step online course
Learn css step by step online course
 
Memcache
MemcacheMemcache
Memcache
 
Sql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldSql Server Service Broker In The Real World
Sql Server Service Broker In The Real World
 
SQL Azure
SQL AzureSQL Azure
SQL Azure
 
Scalable Architecture 101
Scalable Architecture 101Scalable Architecture 101
Scalable Architecture 101
 

Similar to MySQL Optimization from a Developer's point of view

Breaking data
Breaking dataBreaking data
Breaking data
Terry Bunio
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systemselliando dias
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
Ryusuke Kajiyama
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
Malin Weiss
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
Speedment, Inc.
 
Meta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinarMeta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinarKognitio
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
Steve Knutson
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser Architecture
DAGEOP LTD
 
Hard Coding as a design approach
Hard Coding as a design approachHard Coding as a design approach
Hard Coding as a design approach
Oren Eini
 
Meta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinarMeta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinar
Michael Hiskey
 
NYJavaSIG - Big Data Microservices w/ Speedment
NYJavaSIG - Big Data Microservices w/ SpeedmentNYJavaSIG - Big Data Microservices w/ Speedment
NYJavaSIG - Big Data Microservices w/ Speedment
Speedment, Inc.
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
Kenny Buntinx
 
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Dylan Butler
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
e-Learning Delivery System : The Challenges
e-Learning Delivery System : The Challengese-Learning Delivery System : The Challenges
e-Learning Delivery System : The Challenges
Denpong Soodphakdee
 
Redshift deep dive
Redshift deep diveRedshift deep dive
Redshift deep dive
Amazon Web Services LATAM
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
Concentric Sky
 

Similar to MySQL Optimization from a Developer's point of view (20)

Breaking data
Breaking dataBreaking data
Breaking data
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
Meta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinarMeta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinar
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
Optimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser ArchitectureOptimising Queries - Series 1 Query Optimiser Architecture
Optimising Queries - Series 1 Query Optimiser Architecture
 
Hard Coding as a design approach
Hard Coding as a design approachHard Coding as a design approach
Hard Coding as a design approach
 
Meta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinarMeta scale kognitio hadoop webinar
Meta scale kognitio hadoop webinar
 
NYJavaSIG - Big Data Microservices w/ Speedment
NYJavaSIG - Big Data Microservices w/ SpeedmentNYJavaSIG - Big Data Microservices w/ Speedment
NYJavaSIG - Big Data Microservices w/ Speedment
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
 
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
e-Learning Delivery System : The Challenges
e-Learning Delivery System : The Challengese-Learning Delivery System : The Challenges
e-Learning Delivery System : The Challenges
 
Top ten-list
Top ten-listTop ten-list
Top ten-list
 
Perf tuning2
Perf tuning2Perf tuning2
Perf tuning2
 
Redshift deep dive
Redshift deep diveRedshift deep dive
Redshift deep dive
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
 

Recently uploaded

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 

Recently uploaded (20)

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 

MySQL Optimization from a Developer's point of view

  • 1.
  • 2. MySQL Optimization Tips to increase performance Sachin Khosla Founder, Digimantra.com
  • 3. What’s next ?  MySQL – What’s that ?  Optimize ? Where and What ?  Quick Glance at the famous MySQL Storage Engines  Many ways but we talk about Cache systems  Query Cache  File Cache  MemCached  Solr/Lucene
  • 4. Let’s Go ! Have a question ? • If it’s a short – Shoot it ? • If it’s a long – Save it till end of the session :)
  • 5. As many of you know ! •MySQL is a relational database •Community Edition is free of cost •Free GUI tools for Server Administration •Support by the community, forums, manual/docs etc.
  • 6. Why Optimize • Cost • Tuned system = less resources = less investment. • After tuning the system, you get a real usage stat. • Performance • Performance of the system increases the output :) • Happy developers = Happy end users • Stay in the game • Undoubtedly you want to keep pace with the latest technology • Faster systems showcase helps bring in more business
  • 7. Who Should Optimize? Ecosystem – Who are responsible in developing that very application. 1. Designers – The documenting guys :) 2. Developers – Geeks :D 3. System/DB Administrators – The machines :P
  • 8. Optimized, Really ? • Benchmarking • Profiling • Difference between the Benchmark & Profiling Ref - http://dev.mysql.com/tech-resources/articles/pro-mysql-ch6.html
  • 9. MySQL flavors •MyISAM – The ideal son •InnoDB – Clever but expensive* •Memory (Heap)
  • 10. MyISAM InnoDB •Of course, there is no •Of course, there is no difference. It’s just you ! difference. It’s just you ! •You need speed and term •You understand, what “transaction” is martian for transactions are and how are you. they going to effect. •You sure about the size of •Sky is the limit – did you the data in your database. smell cloud computing,eh? •Data is stored in insertion •Rows are physically ordered order. (no clustered index) by the primary key
  • 11. Memory (Heap) • Faster, Performance booster • Intermediary table • Use it when you have more select than insert • Table Structure remains not the data • Fixed length for data types like varchar • No support for text, blob
  • 12. Finally, ways to boost performance • Mysql Query Cache • File Cache system • Memcached • Solr / Lucene
  • 13. Mysql Query Cache • Internal cache system of MySQL • Caches the queries being fired • Never returns stale data • Good when you have less or almost no inserts • Be sure to choose an optimum size for cache (query_cache_size)
  • 14. File Cache system • Traditional way of caching with files. • Saves database server ping. • Still accesses the file structure. • No Big Deal !
  • 15. Memcached • How is it different than traditional cache ? • Can it improve my site’s application’s performance ? • How ? $mem = new Memcache(); //PECL extn in PHP $mem->connect(‘SERVER_NAME’,’PORT_NO’); //connect $mem->set(‘key’,’data’); //set memcached KV pair $mem->get(‘key’); //get data
  • 16.
  • 17. Solr / Lucene •Hit highlighting, faceted search, caching, replication, and a web administration interface – Heavy terms ? •In simple terms it’s a server which has indexes of the database and when you send a request to it, it return you data in the form of XML/JSON
  • 18. Other ways • Query Optimization • Using Explain • Show table status (InnoDB / MySQL) • Show InnoDB status (indexes and all ) •Table level Optimization • Normalization • DB Server Level • mysqld status • Process monitoring tools
  • 19. Q&A
  • 20. Thank you ! www.digimantra.com Twitter - @realin FB – http://fb.me/sachinkhosla