SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Scaling MySQL in 2014?
Przemysław Malkowski
Atmosphere 2014
www.percona.com
What is this talk about?
●
Is MySQL still a good choice for today's web
projects?
●
Does it work on scale?
●
Does it work in cloud?
●
How MySQL is evolving to keep up with
changes?
●
What are the best practices to scale?
●
Improved replication and clustering
www.percona.com
Still right choice?
●
MySQL first released in 1995
●
Open Source/GPL (3.23) since 2000/2001
●
Owner changes – MySQL AB, Sun, Oracle
●
Competition – Percona, MariaDB
●
NoSQL movement
●
Cloud boom
www.percona.com
Most popular database for web
●
'M' in LAMP
●
Default database for webhosting offers
●
Most popular CMS/blog/forum software supports
mainly MySQL
●
Top world biggest web sites use MySQL
●
OpenStack: default DBaaS provider
www.percona.com
Can you scale with MySQL?
●
Do you plan to reach the scale of Facebook?
●
From Harrison Fisk talk in 2013:
– many petabytes of data (real time access)
– 11M row changes /s
– 60M selects /s
– 2.5B rows read /s
●
WebScaleSQL
●
Not IF but HOW
www.percona.com
Scaling for the web
●
Stay fast and reliable as you grow
●
More visitors/users
●
More features/products
●
Continuous performance optimization
●
How fast you can serve client request?
●
You may not know how bad your application or
configuration is until...
www.percona.com
Best practices
●
Design your schema well
●
Primary key in each table!
●
Secondary keys designed with application
●
Do the fancy stuff asynchronously!
●
Advanced reports, statistics?
●
Remember the OLTP principles
www.percona.com
Best practices
●
Cache
●
Use the right tools!
●
Percona XtraBackup
●
Percona Toolkit
~ 30 tools including pt-online-schema-change, pt-query-
digest, pt-table-checksum, and more
●
Percona Monitoring Plugins
– Nagios, Cacti, Zabbix
www.percona.com
Do my queries scale?
●
Percona Cloud Tools
cloud.percona.com
www.percona.com
Scalability areas
www.percona.com
Not quite that simple
●
Number of connections
●
Total active
●
New connections per second
●
Write conflicts (deadlocks)
●
Stale data
●
Large data management
●
Backups
●
Node provisioning
●
Number of databases and tables
www.percona.com
Scale up
www.percona.com
Scale up
●
More/faster CPU cores
●
More memory
●
Bigger disks
●
Faster disks
●
Application optimization/redesign
●
MySQL optimization!
●
Default is not good
www.percona.com
Scale up – MySQL version matters!
http://dimitrik.free.fr/
http://mikaelronstrom.blogspot.com/
www.percona.com
Scale up – use the right engine
●
Forget MyISAM!
https://blogs.oracle.com/MySQL/entry/comparing_innodb_to_myisam_performance
www.percona.com
Scale up – use right engine
●
InnoDB - business standard
●
Hot backups (MEB, Percona XtraBackup)
●
Online schema change (pt-osc or in 5.6+)
●
Compression (Facebook++)
●
TokuDB
●
Excellent compression
●
Impressive write throughput
●
Will be shipped with Percona Server 5.6 soon (beta
builds available)
www.percona.com
Data growth
●
How fast can you make a full backup?
No! How fast can you restore from backup!
●
How fast can you provision number of nodes
capable of handling the traffic (worst case
scenario)?
●
How fast can you alter table
●
Query performance (fit hot data in memory)
www.percona.com
Scale out
www.percona.com
Scaling out - replication
●
Cons
●
Complexity – application and DBA
●
Data consistency issues
●
Slave lag
●
Writes are a bottleneck
writes
reads
replication
master
slaves
MySQL replication (async)
●
Pros
●
Easy to deploy
●
Flexible replication topology
●
Unlimited slaves
●
No write latency on master
www.percona.com
Scaling out – MySQL replication
●
Replication improvements:
●
GTID (5.6, MariaDB 10)
●
Semi-sync replication (5.5+)
●
Multi-threaded slaves per-database (5.6+)
●
Multi-threaded slaves intra-database (5.7)
●
Multi-Source replication (MySQL 5.7, Maria 5.5)
●
Still master -> slave(s)
www.percona.com
Make it simple
●
Does complexity scale? ;)
●
Team experience
●
How fast can you make changes?
●
Humans make errors
●
Demand for HA increases as you grow
●
Simpler management -> higher availability
www.percona.com
Scaling out made easy –
Percona XtraDB Cluster
●
Complete HA solution:
●
Percona Server (5.5 or 5.6)
●
Galera library from Codership
●
Percona XtraBackup
●
Core features
●
Synchronous replication
●
Multi-master replication
●
Parallel replication
●
Automatic node provisioning
●
No need for application change - keep using InnoDB
www.percona.com
PXC – how does it work
GALERA
REPLICATION
node1 node2
node3
Reads
Writes
Reads
Writes
Reads
Writes
●
No SPOF - availability
●
Data consistency
●
No partitioning tolerance
●
Reasonable overhead
●
Transactions pass certification test before
returning to the client but applying is done
asynchronously
●
Row based, parallel replication
●
No slave lag
www.percona.com
PXC - Data consistency is priority
Node partitioned from the cluster
www.percona.com
PXC - Syncing nodes
●
Incremental State Transfer (IST)
●
Gcache (Writeset Cache)
●
State Snapshot Transfer (SST)
●
Adding a new node
●
Rebuilding failed node
●
Node's consistency was compromised
www.percona.com
GALERA
REPLICATION
PXC - Automatic node provisioning
Fast and non-blocking
with Percona XtraBackup
node1
node2
JOINER
node4
DONOR
node3
SST
www.percona.com
GALERA
PXC – replication flexibility
Async master
Async slave
GTID
www.percona.com
PXC – WAN awareness
●
WAN segments (Galera 3+)
DC1
DC2
DC3 DC3
DC2
DC1
●
Smart donor selection
●
Less network traffic
www.percona.com
Scaling out (writes)
●
Functional Partitioning
●
Sharding
Cluster A
Cluster B
ID 1-1000
ID 1001-2000
www.percona.com
Sharding/partitioning – solutions
●
Make your application shard aware (design
your own logic)
●
Use existing solutions
●
MySQL Fabric
●
Shard-Query
www.percona.com
Cloud
●
Scaling on demand, unlimited
●
“MySQLaaS”
●
Amazon RDS
●
Google Cloud SQL (MySQL only)
●
Rackspace Cloud Databases (MySQL only)
●
HP Cloud Relational Database (MySQL only)
www.percona.com
References
Benchmarks
http://mikaelronstrom.blogspot.com/2013/09/mysql-57-improves-cpu-scaling-further.html
http://dimitrik.free.fr/blog/
Large scale
https://www.youtube.com/watch?v=kbYdvHB-l0s
New cool stuff
http://www.mysqlperformanceblog.com/2014/03/27/percona-server-5-6-16-64-2-tokudb-engine-beta-now-available/
http://www.mysqlperformanceblog.com/2014/01/16/analyzing-wordpress-mysql-queries-query-analytics/
http://geek.rohitkalhans.com/2013/09/enhancedMTS-deepdive.html
Cloud
http://www.percona.com/live/mysql-conference-2013/sessions/using-percona-server-database-service-openstack
http://www.hpcloud.com/products-services/relational-database
http://www.rackspace.com/cloud/databases/
https://cloud.google.com/products/cloud-sql/
https://aws.amazon.com/rds/mysql/
http://www.hastexo.com/resources/presentations/hands-trove-database-service-openstack
Sharding
http://www.percona.com/live/mysql-conference-2014/sessions/sharding-and-scale-out-using-mysql-fabric
https://github.com/greenlion/swanhart-tools/tree/master/shard-query
PXC use cases
http://capttofu.livejournal.com/29380.html
http://www.acquia.com/resources/case-study/kpn-corporate-market
http://marketplace.redhat.com/openstack/21615-Percona-XtraDB-Cluster-5-6
www.percona.com
Learn from MySQL Community
przemyslaw.malkowski@percona.com
przemek@mysqlmaniac.com
We're Hiring! www.percona.com/about-us/careers/

Mais conteúdo relacionado

Último

Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrsaastr
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...NETWAYS
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 

Último (20)

Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStrSaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
SaaStr Workshop Wednesday w: Jason Lemkin, SaaStr
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 

Destaque

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Atmosphere 2014: Scaling MySQL in 2014? - Przemyslaw Malkowski

  • 1. Scaling MySQL in 2014? Przemysław Malkowski Atmosphere 2014
  • 2. www.percona.com What is this talk about? ● Is MySQL still a good choice for today's web projects? ● Does it work on scale? ● Does it work in cloud? ● How MySQL is evolving to keep up with changes? ● What are the best practices to scale? ● Improved replication and clustering
  • 3. www.percona.com Still right choice? ● MySQL first released in 1995 ● Open Source/GPL (3.23) since 2000/2001 ● Owner changes – MySQL AB, Sun, Oracle ● Competition – Percona, MariaDB ● NoSQL movement ● Cloud boom
  • 4. www.percona.com Most popular database for web ● 'M' in LAMP ● Default database for webhosting offers ● Most popular CMS/blog/forum software supports mainly MySQL ● Top world biggest web sites use MySQL ● OpenStack: default DBaaS provider
  • 5. www.percona.com Can you scale with MySQL? ● Do you plan to reach the scale of Facebook? ● From Harrison Fisk talk in 2013: – many petabytes of data (real time access) – 11M row changes /s – 60M selects /s – 2.5B rows read /s ● WebScaleSQL ● Not IF but HOW
  • 6. www.percona.com Scaling for the web ● Stay fast and reliable as you grow ● More visitors/users ● More features/products ● Continuous performance optimization ● How fast you can serve client request? ● You may not know how bad your application or configuration is until...
  • 7. www.percona.com Best practices ● Design your schema well ● Primary key in each table! ● Secondary keys designed with application ● Do the fancy stuff asynchronously! ● Advanced reports, statistics? ● Remember the OLTP principles
  • 8. www.percona.com Best practices ● Cache ● Use the right tools! ● Percona XtraBackup ● Percona Toolkit ~ 30 tools including pt-online-schema-change, pt-query- digest, pt-table-checksum, and more ● Percona Monitoring Plugins – Nagios, Cacti, Zabbix
  • 9. www.percona.com Do my queries scale? ● Percona Cloud Tools cloud.percona.com
  • 11. www.percona.com Not quite that simple ● Number of connections ● Total active ● New connections per second ● Write conflicts (deadlocks) ● Stale data ● Large data management ● Backups ● Node provisioning ● Number of databases and tables
  • 13. www.percona.com Scale up ● More/faster CPU cores ● More memory ● Bigger disks ● Faster disks ● Application optimization/redesign ● MySQL optimization! ● Default is not good
  • 14. www.percona.com Scale up – MySQL version matters! http://dimitrik.free.fr/ http://mikaelronstrom.blogspot.com/
  • 15. www.percona.com Scale up – use the right engine ● Forget MyISAM! https://blogs.oracle.com/MySQL/entry/comparing_innodb_to_myisam_performance
  • 16. www.percona.com Scale up – use right engine ● InnoDB - business standard ● Hot backups (MEB, Percona XtraBackup) ● Online schema change (pt-osc or in 5.6+) ● Compression (Facebook++) ● TokuDB ● Excellent compression ● Impressive write throughput ● Will be shipped with Percona Server 5.6 soon (beta builds available)
  • 17. www.percona.com Data growth ● How fast can you make a full backup? No! How fast can you restore from backup! ● How fast can you provision number of nodes capable of handling the traffic (worst case scenario)? ● How fast can you alter table ● Query performance (fit hot data in memory)
  • 19. www.percona.com Scaling out - replication ● Cons ● Complexity – application and DBA ● Data consistency issues ● Slave lag ● Writes are a bottleneck writes reads replication master slaves MySQL replication (async) ● Pros ● Easy to deploy ● Flexible replication topology ● Unlimited slaves ● No write latency on master
  • 20. www.percona.com Scaling out – MySQL replication ● Replication improvements: ● GTID (5.6, MariaDB 10) ● Semi-sync replication (5.5+) ● Multi-threaded slaves per-database (5.6+) ● Multi-threaded slaves intra-database (5.7) ● Multi-Source replication (MySQL 5.7, Maria 5.5) ● Still master -> slave(s)
  • 21. www.percona.com Make it simple ● Does complexity scale? ;) ● Team experience ● How fast can you make changes? ● Humans make errors ● Demand for HA increases as you grow ● Simpler management -> higher availability
  • 22. www.percona.com Scaling out made easy – Percona XtraDB Cluster ● Complete HA solution: ● Percona Server (5.5 or 5.6) ● Galera library from Codership ● Percona XtraBackup ● Core features ● Synchronous replication ● Multi-master replication ● Parallel replication ● Automatic node provisioning ● No need for application change - keep using InnoDB
  • 23. www.percona.com PXC – how does it work GALERA REPLICATION node1 node2 node3 Reads Writes Reads Writes Reads Writes ● No SPOF - availability ● Data consistency ● No partitioning tolerance ● Reasonable overhead ● Transactions pass certification test before returning to the client but applying is done asynchronously ● Row based, parallel replication ● No slave lag
  • 24. www.percona.com PXC - Data consistency is priority Node partitioned from the cluster
  • 25. www.percona.com PXC - Syncing nodes ● Incremental State Transfer (IST) ● Gcache (Writeset Cache) ● State Snapshot Transfer (SST) ● Adding a new node ● Rebuilding failed node ● Node's consistency was compromised
  • 26. www.percona.com GALERA REPLICATION PXC - Automatic node provisioning Fast and non-blocking with Percona XtraBackup node1 node2 JOINER node4 DONOR node3 SST
  • 27. www.percona.com GALERA PXC – replication flexibility Async master Async slave GTID
  • 28. www.percona.com PXC – WAN awareness ● WAN segments (Galera 3+) DC1 DC2 DC3 DC3 DC2 DC1 ● Smart donor selection ● Less network traffic
  • 29. www.percona.com Scaling out (writes) ● Functional Partitioning ● Sharding Cluster A Cluster B ID 1-1000 ID 1001-2000
  • 30. www.percona.com Sharding/partitioning – solutions ● Make your application shard aware (design your own logic) ● Use existing solutions ● MySQL Fabric ● Shard-Query
  • 31. www.percona.com Cloud ● Scaling on demand, unlimited ● “MySQLaaS” ● Amazon RDS ● Google Cloud SQL (MySQL only) ● Rackspace Cloud Databases (MySQL only) ● HP Cloud Relational Database (MySQL only)
  • 32. www.percona.com References Benchmarks http://mikaelronstrom.blogspot.com/2013/09/mysql-57-improves-cpu-scaling-further.html http://dimitrik.free.fr/blog/ Large scale https://www.youtube.com/watch?v=kbYdvHB-l0s New cool stuff http://www.mysqlperformanceblog.com/2014/03/27/percona-server-5-6-16-64-2-tokudb-engine-beta-now-available/ http://www.mysqlperformanceblog.com/2014/01/16/analyzing-wordpress-mysql-queries-query-analytics/ http://geek.rohitkalhans.com/2013/09/enhancedMTS-deepdive.html Cloud http://www.percona.com/live/mysql-conference-2013/sessions/using-percona-server-database-service-openstack http://www.hpcloud.com/products-services/relational-database http://www.rackspace.com/cloud/databases/ https://cloud.google.com/products/cloud-sql/ https://aws.amazon.com/rds/mysql/ http://www.hastexo.com/resources/presentations/hands-trove-database-service-openstack Sharding http://www.percona.com/live/mysql-conference-2014/sessions/sharding-and-scale-out-using-mysql-fabric https://github.com/greenlion/swanhart-tools/tree/master/shard-query PXC use cases http://capttofu.livejournal.com/29380.html http://www.acquia.com/resources/case-study/kpn-corporate-market http://marketplace.redhat.com/openstack/21615-Percona-XtraDB-Cluster-5-6