22. Where do we use MySQL?
● browsing the web looking at hotels
● accessing the site from your mobile phone
● looking at hotel reviews
● making the reservation
● handling credit cards
● managing payments
● analytics
● internal systems
● and lots more...
They all use MySQL as a backend to retrieve or store data
[ We use a few other systems for storing data, including hadoop for complex analytics: everything else uses MySQL ]
The business:
● 1.5 million room nights booked every day
○ That is ~1,000 per minute
● We are still growing...
23. ● Easy scale out of reads using replication to server customer growth
● Increasing better performance with each new MySQL version
● It has allowed us to scale while covering more demanding business needs
● Relational model makes it easier to do more complex queries
● ….
Why we use MySQL? Growth
Scale out
24. Our MySQL installation?
Where have we come from?
● 11 years ago we had ~40 MySQL servers, ~5 clusters and ran MySQL 5.0
Where are we now?
● thousands of MySQL servers spread over several data centres
● hundreds of MySQL replication clusters ranging in size from 5-10 to over 500 servers
● MySQL versions used are 5.7, 8.0 with a few 5.6 stragglers1
○ 96% of 5.7 servers, 97% of 8.0 servers run the latest GA version
● We are starting to use MySQL NDB Cluster
● individual servers' databases range from 100s of GB to tens of TB
● managed by a team of 7
1 Some external applications prevent these upgrades
25. MySQL @Twitter - Intro
• 2 versions; Twitter version: 5.6 and
Community: 5.7
• Runs on thousands of production servers
• We support it via automation + 5 Engineers
26. MySQL @Twitter - How we use it?
5.6 Twitter Version
• Data: ~ PB’s of data
• Servers: Thousands of commodity
servers across 2 DC’s
• QPS: ~ 50M mostly reads
27. MySQL @Twitter - How we use it?
5.7 MySQL Community Version
• Clusters: Hundred of clusters
(Master/Replica)
• Total QPS: ~ 1M r/w
• Highest # of replicas: ~ 150 on one cluster
• Highest QPS (replica): ~ 20K r/w at peak
• Highest QPS (master): ~ 10K r/w at peak
• Supports most of Twitter internal services
28. Workloads on MySQL
▪ User Database (UDB)
▪ Social graph workload
▪ Pure flash
▪ Heavily sharded
▪ Automated management
▪ Facebook Messenger
▪ 1B+ people use the application
▪ Petabytes of information