MySQL In The Cloud



1. MySQL In the Cloud Migration, Best Practices, High Availability, Scaling Peter Zaitsev CEO Moscow MySQL Users Group Meetup July 11th, 2017 1 © 2017 Percona

2.Let me start…. With some Questions! 2 © 2017 Percona

3.Question One How Many of you are running MySQL In the Cloud ? 3 © 2017 Percona

4.Question Two Are you running it in Public Cloud ? Private Cloud ? Both ? 4 © 2017 Percona

5.Question Three ? Are you using DBaaS such as Amazon RDS or Google CloudSQL or running your own ? 5 © 2017 Percona

6.Question Four Are you using Containers ? (Such as Docker) 6 © 2017 Percona

7.Lets Cover some Basics 7 © 2017 Percona

8.What is “Cloud” Dynamic Programmable Infrastructure 8 © 2017 Percona

9.Public and Private Public Private •Infrastructure Shared •Infrastructure Private with other Users for company •Amazon AWS typical •OpenStack installation example typical example 9 © 2017 Percona

10.All of those XaaS IaaS (Infrastructure • Works in Infrastructure level: “Compute”, “Storage”, “Network” as a service) • Examples: AWS EC2, S3, EBS DBaaS (Database as • Provides Database Service (Instances or Clusters) to use a service) • Examples: Amazon RDS, Google Spanner PaaS (Platform as a • Provides full platform for your application development service) • Examples: Heroku, Amazon Elastic Beanstalk, OpenShift 10 © 2017 Percona

11.Regions and Availability Zones Region Availability Zone • Specifies Geographic Region • Is located in the region • Hierarchy - North America – • Reasonably isolated from West – California each other • High Latency between • Medium Latency between Regions AZ • Complete Isolation 11 © 2017 Percona

12.Making it Visual Source: 12 © 2017 Percona

13.Top Cloud Providers 13 © 2017 Percona

14.Technologies to be aware of 14 © 2017 Percona

15.Decisions to Make 15 © 2017 Percona

16.Should you move to the cloud ? This is decision you rarely have Programmable infrastructure is the future Virtualization overhead is going down Some clouds providers support Bare Metal 16 © 2017 Percona

17.Public ? Private ? Hybrid Public Cloud Private Cloud Hybrid Cloud • Agility • Control • Infrastructure • Scalability • Costs using Both • Costs • Legacy • Can get benefits • Small and Integration of both Medium • Some Enterprise • At the cost of Businesses Companies extra complexity 17 © 2017 Percona

18.Single vendor vs Multi Vendor Single Vendor Multi Vendor •Use all features •Have to use “lowest vendor has to offer common •Danger of Vendor denominator” Lock In •Avoid Vendor Lock In 18 © 2017 Percona

19.DBaaS DBaaS (ie Amazon RDS) IaaS (ie EC2+EBS+S3) • Easier • Harder to roll your own • Takes off some operational • Operations on your own (or pains your partner) • Less Flexible • More Flexible • More Expensive • Less Expensive • More Lock-In • Less Lock-In 19 © 2017 Percona

20.Open Source in the Cloud Open Source Compatible is not same as Open Source 20 © 2017 Percona

21.Migration 21 © 2017 Percona

22.Keep it Simple Do not try doing upgrade at the same time as migration Exactly same minor version is optimal Same major version - must 22 © 2017 Percona

23.Moving to IaaS Cloud General Practices as in Datacenter Migrations apply Easy to use Binary Backups Slave_compressed_protocol or compression in VPN Support utilities may need to be modified for EBS/S3 23 © 2017 Percona

24.Moving to DBaaS • Mysqldump Need to use database • Mysqlpump dump to copy • Mydumper Can set external slave • CALL mysql.rds_set_external_master (Amazon RDS) Monitoring Backup • Do not have direct access to physical box may need revision • Do not have root user 24 © 2017 Percona

25.New With Amazon RDS Aurora Can use Percona Xtrabackup’s Backup to seed the cluster 25 © 2017 Percona

26.Moving from DBaaS Logical Database dump as well Replication supported for Migration only Configure Binary Log Retention mysql.rds_set_configuration 26 © 2017 Percona

27.Best Practices 27 © 2017 Percona

28.Being Cost Efficient Know your cloud vendor pricing policies Look beyond “compute” pricing Best Price/Performance configuration in the cloud is likely to be different AWS: Reserve Instances AWS: Spot Instances 28 © 2017 Percona

29.Guarantee versus Burst Guaranteed Burst • Performance resource is • Performance resource “guaranteed” to have in can provide worst case scenario • Typically not guaranteed • This is what you can • Typically limited in plan for length to prevent abuse 29 © 2017 Percona