Databases in the Hosted Cloud

现在,您可以在多个“云提供商”中使用托管的mysql/mariadb/percona server for mysql/postgresql作为数据库服务(dbaas)。了解各种公共云产品的差异、访问方法和控制级别:
-Rackspace OpenStack数据库


1.Databases in the Hosted Cloud Colin Charles, Chief Evangelist, Percona Inc. / | @bytebot on Twitter

2.whoami • Chief Evangelist, Percona Inc • Focusing on the MySQL ecosystem (MySQL, Percona Server, MariaDB Server), as well as the MongoDB ecosystem (Percona Server for MongoDB) + 100% open source tools from Percona like Percona Monitoring & Management, Percona xtrabackup, Percona Toolkit, etc. • Founding team of MariaDB Server (2009-2016), previously at Monty Program Ab, merged with SkySQL Ab, now MariaDB Corporation • Formerly MySQL AB (exit: Sun Microsystems) • Past lives include Fedora Project (FESCO), • MySQL Community Contributor of the Year Award winner 2014

3.Agenda • MySQL as a service offering (DBaaS) • Choices • Considerations • MySQL versions & access • Costs • Deeper into RDS • Should you run this on EC2 or an equivalent? • Conclusion

4.Database as a service • Database as a Service (DBaaS) • MySQL/PostgreSQL available on-demand, without any installation/ configuration of hardware/software • Pay-per-usage based • Provider maintains database, you don’t maintain, upgrade, or administer the database

5.New way of deployment • Enter a credit card number • call API (or use the GUI) ec2-run-instances ami-xxx -k ${EC2_KEYPAIR} -t m1.large nova boot --image centos6-x86_64 --flavor m1.large db1 credit:

6.Why DBaaS? • “Couldn’t we just have a few more servers to handle the traffic spike during the elections?” • Don’t have a lot of DBAs, optimise for operational ease • Rapid deployment & scale-out

7.Your choices today • Amazon Web Services Relational Database Service (RDS) • Rackspace Cloud Databases • Google Cloud SQL • Oracle Cloud MySQL Service • Microsoft Azure Database

8.There are more • Jelastic - PaaS offering MySQL, MariaDB Server • ClearDB - MySQL partnered with Heroku, Azure clouds • Joyent - Image offers Percona MySQL and a Percona SmartMachine

9.Some new entrants • Google Compute Engine offers Percona XtraDB Cluster as a “click- to-deploy” app • comes with Galera 3, Percona Toolkit, XtraBackup as well • Pivotal CloudFoundry - “MySQL” PaaS which is MariaDB Galera Cluster 10 • Red Hat OpenShift • MySQL 5.5/5.6/5.7, MariaDB 10.0/10.1 • PostgreSQL 9.2/9.4/9.5 • MongoDB 2.4/2.6/3.2

10.Beware • GenieDB - globally distributed MySQL as a service, master-master replication, works on EC2, Rackspace, Google Compute Engine, HP Cloud • Xeround - 2 weeks notice...


12.Thank you HPCloud • hpcloud-whom-contributed-to-making-mysql-better • Utility user • enforce_storage_engine • prevent LOAD DATA INFILE/SELECT INTO OUTFILE • restrict # of binlog files


14.What else do you get? • AWS RDS has PostgreSQL • Most MongoDB users run within the cloud — but not hosted, it tends to be “roll your own” (and lately MongoDB Atlas based - reasonable free tier!) • (now IBM) & the like (MongoLab) — hosted MongoDB, Redis, Enhanced PostgreSQL, ElasticSearch, RethinkDB, MySQL with group replication, ScyllaDB, etc.

15.MariaDB Server on AWS

16.Regions & Availability Zones • Region: a data centre location, containing multiple Availability Zones • Availability Zone (AZ): isolated from failures from other AZs + low- latency network connectivity to other zones in same region

17.Location, location, location • AWS RDS: US East (N. Virginia, Ohio), US West (Oregon, Northern California), US West (California), EU (Ireland, Frankfurt, London), APAC (Singapore, Tokyo, Sydney, Seoul, Mumbai), South America (São Paulo), GovCloud, Canada (Central), China (Beijing) • Rackspace: USA (Dallas DFW, Chicago ORD, N. Virginia IAD), APAC (Sydney, Hong Kong), EU (London)* • Google Cloud SQL: US (Berkeley County, SC, Council Bluffs, IA), EU (Belgium), Asia (Taiwan, Japan)

18.Service Level Agreements (SLA) •AWS - 99.95% in a calendar month •Rackspace - 99.9% in a calendar month •Google - 99.95% in a calendar month •SLAs exclude “scheduled maintenance” which may storage I/O + elevate latency • AWS is 30 minutes/week, so really 99.65%

19.Support • AWS - forums; $49/mo gets email; $100+ phone # • Rackspace - live chat, phone #, forums • Google - forums; $150/mo gets support portal; $400+ for phone # • Microsoft - forums; $29/mo to start

20.Who manages this? • AWS: self-management, Enterprise ($15k+) • Rackspace: $100 + 0.04 cents/hr over regular pricing • Google: self-management • Microsoft: generally self, premier can give you advisory services

21.MySQL versions • AWS: MySQL Community 5.1, 5.5, 5.6, 5.7 / MariaDB Server 10.0, 10.1 • Rackspace: MariaDB Server 10, 10.1, 10.1-enc, MySQL 5.7/5.6/5.1, Percona Server 5.6 • Google: MySQL Community 5.5, 5.6, 5.7 • Microsoft: MySQL Community 5.6, 5.7

22.Access methods • AWS - within Amazon, externally via mysql client, API access. • Rackspace - private hostname within Rackspace network, API access. • Google - within AppEngine, a command line Java tool (gcutil), standard mysql client • Microsoft - within Azure, externally via mysql client

23.Can you configure MySQL? • You don’t access my.cnf naturally • In AWS you have parameter groups which allow configuration of MySQL source:

24.Cost • Subscribe to relevant newsletters of your services • Cost changes rapidly, plus you get new instance types and new features (IOPS) • Don’t forget network access costs • Monitor your costs daily, hourly if possible (EC2 instances can have spot pricing)

25.Costs: AWS • AWS prices vary between regions •

26.Costs: AWS II • Standard latest generation: db.m4.large (8 GB) at $1,533/yr [2017] • Previous generation: Medium instances (3.75GB) useful for testing ($1,577/yr [2014] vs $2,411/yr [2013]) • Large instance (7.5GB) production ready ($3,241/yr vs $4,777/yr [2013]) • Multi-AZ production ready: db.m4.2xlarge (32GB, 8vCPUs) at $12,264/yr [2017] • Previous generation: m3.2XL (30GB, 8vCPUs) ($12,964/yr)

27.Costs: Rackspace • Option to have regular Cloud Database or Managed Instances • 4GB instance is $2,111.4 (vs. $2,102/yr in 2015 and $3,504/yr in 2013) • 8GB instance is $4,213.8 (vs. $4,205/yr in 2015 and $6,658/yr in 2013) • Consider looking at I/O priority, and the actual TPS you get • High Available instances with automatic failover available too

28.Costs: Google • You must enable billing before you create Cloud SQL instances • • Previously (first generation): • Testing (D8 - 4GB RAM) - $3,204.7 vs $4,274.15 (in 2015) • XL equivalent (D16 - 8GB RAM) - $6413.05 vs $8,548.30 (in 2015) • Today: • db-n1-standard-8 (8 vCPUs, 30GB RAM) - $6,762.72 • Packages billing plans are cheaper than per-use billing plans

29.Where do you host your application? • Typically within the compute clusters of the service you’re running the DBaaS in • Even Google now offers Compute Engine so there is no such language limitation, ala the early AppEngine days