SlideShare a Scribd company logo
Databases in the
Hosted Cloud
Colin Charles, MariaDB Corporation Ab
colin@mariadb.org | byte@bytebot.net
http://mariadb.com/ | http://mariadb.org/
http://bytebot.net/blog/ | @bytebot on Twitter
Percona Live Europe,Amsterdam, Netherlands
22 September 2015
1
whoami
• Work on MariaDB at MariaDB Corporation
(SkySQL Ab)
• Merged with Monty Program Ab, makers of
MariaDB
• Formerly MySQL AB (exit: Sun Microsystems)
• Past lives include Fedora Project (FESCO),
OpenOffice.org
• Recipient of the MySQL Community Contributor of
theYear Award 2014
2
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
3
MySQL as a service
• Database as a Service (DBaaS)
• MySQL available on-demand, without any
installation/configuration of hardware/
software
• Pay-per-usage based
• Provider maintains MySQL, you don’t
maintain, upgrade, or administer the database
4
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
5
credit: http://www.flickr.com/photos/68751915@N05/6280507539/
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
6
Your choices today
• Amazon Web Services Relational Database
Service (RDS)
• Rackspace Cloud Databases
• Google Cloud SQL
7
8
There are more
• Jelastic - PaaS offering MySQL, MariaDB
• ClearDB - MySQL partnered with heroku,
Azure clouds
• Joyent - Image offers Percona MySQL and a
Percona SmartMachine
9
The 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.1/5.5,
MariaDB 5.5
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...
11
12
What else do you get?
• AWS RDS has PostgreSQL — notice the
price
• Most MongoDB users run within the cloud —
but not hosted, it tends to be “roll your own”
• Compose.io (now IBM) & the like
(MongoLab) — hosted MongoDB, Redis,
Enhanced PostgreSQL, ElasticSearch,
RethinkDB
13
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
14
Location, location,
location
• AWS RDS: US East (N.Virginia), US West
(Oregon), US West (California), EU (Ireland,
Frankfurt),APAC (Singapore,Tokyo, Sydney), South
America (São Paulo), GovCloud
• Rackspace: USA (Dallas DFW, Chicago ORD, N.
Virginia IAD),APAC (Sydney, Hong Kong), EU
(London)*
• Google Cloud SQL: US, EU,Asia
• HP Cloud: US-East (Virginia), US-West
15
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
• HP Cloud - no specific DB SLA, 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%
16
Support
• AWS - forums; $49/mo gets email; $100+
phone #
• Rackspace - live chat, phone #, forums
• Google - forums; $150/mo gets support
portal; $400+ for phone #
• HP Cloud - phone #, chat, customer forum
17
Who manages this?
• AWS: self-management, Enterprise ($15k+)
• Rackspace: $100 + 0.04 cents/hr over
regular pricing
• Google: self-management
• HP Cloud: self-management
18
MySQL versions
• AWS: MySQL Community 5.1, 5.5, 5.6
• Rackspace: MariaDB 10, MySQL 5.6/5.1,
Percona Server 5.6
• Google: MySQL Community 5.5, 5.6
(preview)
• HP Cloud: Percona Server 5.5.28
19
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
• HP Cloud - within HP Cloud, externally via client
(trove-cli, reddwarf),API access, mysql client
20
Can you configure
MySQL?
• You don’t access
my.cnf naturally
• In AWS you
have parameter
groups which
allow
configuration of
MySQL
21
source: http://www.mysqlperformanceblog.com/2013/08/21/amazon-rds-with-mysql-5-6-configuration-variables/
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)
22
Costs:AWS
• AWS prices vary between regions
• http://aws.amazon.com/rds/pricing/
23
Costs:AWS II
• 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])
• m3.2XL (30GB, 8vCPUs) ($12,964/yr)
• XL instance (15GB, 8ECUs) ($9,555/yr)
24
Costs: Rackspace
• Option to have regular Cloud Database or
Managed Instances
• 4GB instance (testing) is $2,102/yr (vs.
$3,504/yr in 2013)
• 8GB instance (production) is $4,205/yr (vs
$6,658/yr in 2013)
• Consider looking at I/O priority, and the
actual TPS you get
25
Costs: Google
• You must enable billing before you create Cloud
SQL instances
• https://developers.google.com/cloud-sql/docs/billing
• Testing (D8 - 4GB RAM) - ($4,274.15)
• XL equivalent for production (D16 - 8GB RAM) -
($8,548.30)
• Packages billing plans are cheaper than per-use
billing plans
26
Costs: HP Cloud
• 50% off pricing while in public beta
• 4GB RAM, 60GB storage - $1,752/yr (usual:
$3,504/yr)
• 8GB RAM, 120GB storage - $3,504/yr
(usual: $7,008/yr)
27
Where do you host
your application?
• Typically within the compute clusters of the
service you’re running the DBaaS in
• This also means your language choices are
limited based on what the platform offers
(eg.AppEngine only offers Java, Python, PHP,
Go)
28
RDS: Multi-AZ
• Provides enhanced durability (synchronous
data replication)
• Increased availability (automatic failover)
• Warning: can be slow (1-10 mins+)
• Easy GUI administration
• Doesn’t give you another usable “read-
replica” though
29
External replication
• MySQL 5.6 you can do RDS -> Non-RDS
• enable backup retention, you now have
binlog access
• target: exporting data out of RDS
• Replicate into RDS with 5.5.33 or later
• AWS provides stored procedures like
mysql.rds_set_external_master nowadays
30
MySQL 5.6, MariaDB
10
• MySQL 5.6 in RDS provides crash-safe slaves, the
InnoDB memcached interface, online schema
changes, full-text InnoDB indexes, optimizer
improvements, INFORMATION_SCHEMA
enhancements, scalability/replication
improvements, PERFORMANCE_SCHEMA
enhancements
• MariaDB 10 has much of that that, plus multi-
source replication, GTIDs that don’t require full
restarts, threadpool, audit plugin and more
31
Getting started
• Importing data into the cloud?
• mysqldump is a good choice today
• Upgrading from RDS 5.5 to RDS 5.6?
• mysqldump before, but nowadays you can
do this via Read Replicas
32
Handling backups
• You don’t get to use xtrabackup!
• Google Cloud SQL automates backups (has
a backup window - 4h)
• Amazon has automated backups (with point-
in-time recovery), with full daily snapshots
(has a backup window).
• Rackspace + HPCloud allow instance
backups too
33
Monitoring
• Options are limited,AWS has the best
options currently available
• Today you have CloudWatch
• Google has basic read/write graphs
• Rackspace has started with basic graphs,
visuals for MySQL coming soon, have a beta
Cloud Intelligence product
34
Storage Engines
• MySQL (/MariaDB) have many
• cool ones include TokuDB, SPIDER,
CONNECT
• You basically use InnoDB and MyISAM with
cloud solutions
• MyISAM on RDS won’t guarantee point-
in-time recovery, snapshot restore
35
High Availability
• Plan for node failures
• Don’t assume node provisioning is quick
• Backup, backup, backup!
• “Bad” nodes exist
• HA is not equal across options - RDS wins
so far
36
Unsupported features
• AWS: GTIDs, InnoDB Cache Warming,
InnoDB transportable tablespaces,
authentication plugins, semi-sync replication
• Google: UDFs, replication, LOAD DATA
INFILE, INSTALL PLUGIN, SELECT ... INTO
OUTFILE
37
Provisioned IOPS
• Only available on Amazon
• Faster, predictable, consistent I/O
performance with low latencies
• Good throughput, RAID on backed
• EBS is more reliable
38
More on RDS
• log access via API
• no SUPER access to skip replication errors
easily
• sync_binlog=0 not available
• no OS access (sar, ps, tcpdump)
• https://github.com/boto/boto
39
Warning: automatic
upgrades
• Regressions happen even with a minor
version upgrade in the MySQL world
• InnoDB update that modifies rows PK
triggers recursive behaviour until all disk
space is exceeded? 5.5.24->5.5.25 (fixed:
5.5.25a)
• Using query cache for partitioned tables?
Disabled since 5.5.22->5.5.23!
40
Benchmarking for use
• sysbench
• OLTP test, use tables
with 20M rows and 20M
transactions, check
1-128 threads/run (run
this on RDS, Rackspace)
• June 2013, tps,
performance per dollar,
Rackspace delivers more
performance across all
flavours except 512MB
instance
• Yahoo! Cloud Serving
Benchmark
• https://github.com/
brianfrankcooper/YCSB
• Google’s PerfKit
Benchmarker
• https://github.com/
GoogleCloudPlatform/
PerfKitBenchmarker
41
Roadmaps?
• There don’t seem to be public roadmaps.
You find out when there’s a change!
• Presumably HPCloud will get 5.6… and
maybe Google will get some MariaDB?
42
Usability
43
PostgreSQL in RDS
• loading data?
backup_retntion=0
• disable multi-AZ when
loading
• disable autovacuum
• dump compressed, restore
in parallel
• don’t disable fsync (really!)
• sync replication using
multi-AZ
• you can control the
upgrade time though —
this is a bonus
• Use PIOPS
• SSL should be on
44
Running MySQL in EC2
• Can do multiple geographic
regions via replication
• Run just one Percona Server/
MariaDB server/instance
• Use additional EBS volumes for
InnoDB tablespaces
• RAID EBS volumes (RAID1)
• Warm up data partitions, mount
partitions with noatime, nodirtime
• Vertical scaling with SSD-backed
storage
• Monitoring with nagios
• Snapshot backups and save to S3
• Can use Elastic Load Balancer
• Can use spot instances
• Can use tools like MHA to
provide automatic failover
• Can use MariaDB Galera Cluster/
Percona XtraDB Cluster
45
AWS Aurora
• Bigger instances work better
• Zero-downtime migration from RDS
• Metrics via CloudWatch
• Connectors via MariaDB
• 99.99% uptime
46
Some closing thoughts
• Hardware varies per region
• Sometimes, software manageability varies
per region
• Beware cost on your credit card!
47
Q&A.ThankYou.
colin@mariadb.org | byte@bytebot.net
http://bytebot.net/blog/ | @bytebot on Twitter
Download MariaDB and give it a try: http://mariadb.org/
48

More Related Content

What's hot (20)

PDF
MariaDB Server & MySQL Security Essentials 2016
Colin Charles
 
PDF
The MySQL Server ecosystem in 2016
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
PDF
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
Ivan Zoratti
 
PDF
The Complete MariaDB Server Tutorial - Percona Live 2015
Colin Charles
 
PDF
Securing your MySQL / MariaDB Server data
Colin Charles
 
PDF
My first moments with MongoDB
Colin Charles
 
PDF
Distributions from the view a package
Colin Charles
 
PDF
MySQL in the Hosted Cloud - Percona Live 2015
Colin Charles
 
PDF
MariaDB 10: The Complete Tutorial
Colin Charles
 
PDF
Why MariaDB?
Colin Charles
 
PDF
A beginners guide to MariaDB
Colin Charles
 
PDF
MySQL highav Availability
Baruch Osoveskiy
 
PDF
The Complete MariaDB Server tutorial
Colin Charles
 
PDF
Best practices for MySQL High Availability Tutorial
Colin Charles
 
PDF
MariaDB: The 2012 Edition
Colin Charles
 
PDF
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
PDF
MariaDB: in-depth (hands on training in Seoul)
Colin Charles
 
PDF
MariaDB 10 and what's new with the project
Colin Charles
 
PDF
MariaDB 10: A MySQL Replacement - HKOSC
Colin Charles
 
MariaDB Server & MySQL Security Essentials 2016
Colin Charles
 
The MySQL Server ecosystem in 2016
Colin Charles
 
Lessons from database failures
Colin Charles
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
Ivan Zoratti
 
The Complete MariaDB Server Tutorial - Percona Live 2015
Colin Charles
 
Securing your MySQL / MariaDB Server data
Colin Charles
 
My first moments with MongoDB
Colin Charles
 
Distributions from the view a package
Colin Charles
 
MySQL in the Hosted Cloud - Percona Live 2015
Colin Charles
 
MariaDB 10: The Complete Tutorial
Colin Charles
 
Why MariaDB?
Colin Charles
 
A beginners guide to MariaDB
Colin Charles
 
MySQL highav Availability
Baruch Osoveskiy
 
The Complete MariaDB Server tutorial
Colin Charles
 
Best practices for MySQL High Availability Tutorial
Colin Charles
 
MariaDB: The 2012 Edition
Colin Charles
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
MariaDB: in-depth (hands on training in Seoul)
Colin Charles
 
MariaDB 10 and what's new with the project
Colin Charles
 
MariaDB 10: A MySQL Replacement - HKOSC
Colin Charles
 

Similar to Databases in the hosted cloud (20)

PDF
MySQL in the Hosted Cloud
Colin Charles
 
PDF
MySQL in the Cloud
Colin Charles
 
PDF
Databases in the Hosted Cloud
Colin Charles
 
PDF
Databases in the hosted cloud
Colin Charles
 
PDF
Scaling MySQL in Amazon Web Services
Laine Campbell
 
PPTX
Selecting a SQL Server Cloud Platform - IaaS, Amazon RDS or Azure SQL DB?
Christopher Foot
 
PDF
Running MySQL in AWS
Laine Campbell
 
PPTX
Rising Interest in Open Source Relational Databases
Christopher Foot
 
PPTX
Keynote - Hosted PostgreSQL: An Objective Look
EDB
 
PDF
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
PDF
The MySQL Server ecosystem in 2016
sys army
 
PDF
MySQL Ecosystem in 2020
Alkin Tezuysal
 
PDF
Idi2017 - Cloud DB: strengths and weaknesses
Linuxaria.com
 
PDF
My sql en la nube conoce las mejores prácticas en administración y operación_...
GeneXus
 
PPTX
Choosing the right Cloud Database
Janakiram MSV
 
PPTX
AWS Database Services
zekeLabs Technologies
 
PDF
MySQL & Oracle Linux Keynote at Open Source India 2014
Sanjay Manwani
 
PDF
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
Ivan Zoratti
 
PDF
MySQL for Software-as-a-Service (SaaS)
Mario Beck
 
PPTX
Migrating On-Premises DBs to Cloud Systems
Christopher Foot
 
MySQL in the Hosted Cloud
Colin Charles
 
MySQL in the Cloud
Colin Charles
 
Databases in the Hosted Cloud
Colin Charles
 
Databases in the hosted cloud
Colin Charles
 
Scaling MySQL in Amazon Web Services
Laine Campbell
 
Selecting a SQL Server Cloud Platform - IaaS, Amazon RDS or Azure SQL DB?
Christopher Foot
 
Running MySQL in AWS
Laine Campbell
 
Rising Interest in Open Source Relational Databases
Christopher Foot
 
Keynote - Hosted PostgreSQL: An Objective Look
EDB
 
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
The MySQL Server ecosystem in 2016
sys army
 
MySQL Ecosystem in 2020
Alkin Tezuysal
 
Idi2017 - Cloud DB: strengths and weaknesses
Linuxaria.com
 
My sql en la nube conoce las mejores prácticas en administración y operación_...
GeneXus
 
Choosing the right Cloud Database
Janakiram MSV
 
AWS Database Services
zekeLabs Technologies
 
MySQL & Oracle Linux Keynote at Open Source India 2014
Sanjay Manwani
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
Ivan Zoratti
 
MySQL for Software-as-a-Service (SaaS)
Mario Beck
 
Migrating On-Premises DBs to Cloud Systems
Christopher Foot
 
Ad

More from Colin Charles (12)

PDF
Differences between MariaDB 10.3 & MySQL 8.0
Colin Charles
 
PDF
What is MariaDB Server 10.3?
Colin Charles
 
PDF
MySQL features missing in MariaDB Server
Colin Charles
 
PDF
The MySQL ecosystem - understanding it, not running away from it!
Colin Charles
 
PDF
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Colin Charles
 
PDF
Capacity planning for your data stores
Colin Charles
 
PDF
Lessons from {distributed,remote,virtual} communities and companies
Colin Charles
 
PDF
Forking Successfully - or is a branch better?
Colin Charles
 
PDF
MariaDB Server Compatibility with MySQL
Colin Charles
 
PDF
The MySQL Server Ecosystem in 2016
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
Differences between MariaDB 10.3 & MySQL 8.0
Colin Charles
 
What is MariaDB Server 10.3?
Colin Charles
 
MySQL features missing in MariaDB Server
Colin Charles
 
The MySQL ecosystem - understanding it, not running away from it!
Colin Charles
 
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Colin Charles
 
Capacity planning for your data stores
Colin Charles
 
Lessons from {distributed,remote,virtual} communities and companies
Colin Charles
 
Forking Successfully - or is a branch better?
Colin Charles
 
MariaDB Server Compatibility with MySQL
Colin Charles
 
The MySQL Server Ecosystem in 2016
Colin Charles
 
Lessons from database failures
Colin Charles
 
Lessons from database failures
Colin Charles
 
Ad

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 

Databases in the hosted cloud

  • 1. Databases in the Hosted Cloud Colin Charles, MariaDB Corporation Ab [email protected] | [email protected] http://mariadb.com/ | http://mariadb.org/ http://bytebot.net/blog/ | @bytebot on Twitter Percona Live Europe,Amsterdam, Netherlands 22 September 2015 1
  • 2. whoami • Work on MariaDB at MariaDB Corporation (SkySQL Ab) • Merged with Monty Program Ab, makers of MariaDB • Formerly MySQL AB (exit: Sun Microsystems) • Past lives include Fedora Project (FESCO), OpenOffice.org • Recipient of the MySQL Community Contributor of theYear Award 2014 2
  • 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 3
  • 4. MySQL as a service • Database as a Service (DBaaS) • MySQL available on-demand, without any installation/configuration of hardware/ software • Pay-per-usage based • Provider maintains MySQL, you don’t maintain, upgrade, or administer the database 4
  • 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 5 credit: http://www.flickr.com/photos/68751915@N05/6280507539/
  • 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 6
  • 7. Your choices today • Amazon Web Services Relational Database Service (RDS) • Rackspace Cloud Databases • Google Cloud SQL 7
  • 8. 8
  • 9. There are more • Jelastic - PaaS offering MySQL, MariaDB • ClearDB - MySQL partnered with heroku, Azure clouds • Joyent - Image offers Percona MySQL and a Percona SmartMachine 9
  • 10. The 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.1/5.5, MariaDB 5.5 10
  • 11. Beware • GenieDB - globally distributed MySQL as a service, master-master replication, works on EC2, Rackspace, Google Compute Engine, HP Cloud • Xeround - 2 weeks notice... 11
  • 12. 12
  • 13. What else do you get? • AWS RDS has PostgreSQL — notice the price • Most MongoDB users run within the cloud — but not hosted, it tends to be “roll your own” • Compose.io (now IBM) & the like (MongoLab) — hosted MongoDB, Redis, Enhanced PostgreSQL, ElasticSearch, RethinkDB 13
  • 14. 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 14
  • 15. Location, location, location • AWS RDS: US East (N.Virginia), US West (Oregon), US West (California), EU (Ireland, Frankfurt),APAC (Singapore,Tokyo, Sydney), South America (São Paulo), GovCloud • Rackspace: USA (Dallas DFW, Chicago ORD, N. Virginia IAD),APAC (Sydney, Hong Kong), EU (London)* • Google Cloud SQL: US, EU,Asia • HP Cloud: US-East (Virginia), US-West 15
  • 16. 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 • HP Cloud - no specific DB SLA, 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% 16
  • 17. Support • AWS - forums; $49/mo gets email; $100+ phone # • Rackspace - live chat, phone #, forums • Google - forums; $150/mo gets support portal; $400+ for phone # • HP Cloud - phone #, chat, customer forum 17
  • 18. Who manages this? • AWS: self-management, Enterprise ($15k+) • Rackspace: $100 + 0.04 cents/hr over regular pricing • Google: self-management • HP Cloud: self-management 18
  • 19. MySQL versions • AWS: MySQL Community 5.1, 5.5, 5.6 • Rackspace: MariaDB 10, MySQL 5.6/5.1, Percona Server 5.6 • Google: MySQL Community 5.5, 5.6 (preview) • HP Cloud: Percona Server 5.5.28 19
  • 20. 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 • HP Cloud - within HP Cloud, externally via client (trove-cli, reddwarf),API access, mysql client 20
  • 21. Can you configure MySQL? • You don’t access my.cnf naturally • In AWS you have parameter groups which allow configuration of MySQL 21 source: http://www.mysqlperformanceblog.com/2013/08/21/amazon-rds-with-mysql-5-6-configuration-variables/
  • 22. 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) 22
  • 23. Costs:AWS • AWS prices vary between regions • http://aws.amazon.com/rds/pricing/ 23
  • 24. Costs:AWS II • 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]) • m3.2XL (30GB, 8vCPUs) ($12,964/yr) • XL instance (15GB, 8ECUs) ($9,555/yr) 24
  • 25. Costs: Rackspace • Option to have regular Cloud Database or Managed Instances • 4GB instance (testing) is $2,102/yr (vs. $3,504/yr in 2013) • 8GB instance (production) is $4,205/yr (vs $6,658/yr in 2013) • Consider looking at I/O priority, and the actual TPS you get 25
  • 26. Costs: Google • You must enable billing before you create Cloud SQL instances • https://developers.google.com/cloud-sql/docs/billing • Testing (D8 - 4GB RAM) - ($4,274.15) • XL equivalent for production (D16 - 8GB RAM) - ($8,548.30) • Packages billing plans are cheaper than per-use billing plans 26
  • 27. Costs: HP Cloud • 50% off pricing while in public beta • 4GB RAM, 60GB storage - $1,752/yr (usual: $3,504/yr) • 8GB RAM, 120GB storage - $3,504/yr (usual: $7,008/yr) 27
  • 28. Where do you host your application? • Typically within the compute clusters of the service you’re running the DBaaS in • This also means your language choices are limited based on what the platform offers (eg.AppEngine only offers Java, Python, PHP, Go) 28
  • 29. RDS: Multi-AZ • Provides enhanced durability (synchronous data replication) • Increased availability (automatic failover) • Warning: can be slow (1-10 mins+) • Easy GUI administration • Doesn’t give you another usable “read- replica” though 29
  • 30. External replication • MySQL 5.6 you can do RDS -> Non-RDS • enable backup retention, you now have binlog access • target: exporting data out of RDS • Replicate into RDS with 5.5.33 or later • AWS provides stored procedures like mysql.rds_set_external_master nowadays 30
  • 31. MySQL 5.6, MariaDB 10 • MySQL 5.6 in RDS provides crash-safe slaves, the InnoDB memcached interface, online schema changes, full-text InnoDB indexes, optimizer improvements, INFORMATION_SCHEMA enhancements, scalability/replication improvements, PERFORMANCE_SCHEMA enhancements • MariaDB 10 has much of that that, plus multi- source replication, GTIDs that don’t require full restarts, threadpool, audit plugin and more 31
  • 32. Getting started • Importing data into the cloud? • mysqldump is a good choice today • Upgrading from RDS 5.5 to RDS 5.6? • mysqldump before, but nowadays you can do this via Read Replicas 32
  • 33. Handling backups • You don’t get to use xtrabackup! • Google Cloud SQL automates backups (has a backup window - 4h) • Amazon has automated backups (with point- in-time recovery), with full daily snapshots (has a backup window). • Rackspace + HPCloud allow instance backups too 33
  • 34. Monitoring • Options are limited,AWS has the best options currently available • Today you have CloudWatch • Google has basic read/write graphs • Rackspace has started with basic graphs, visuals for MySQL coming soon, have a beta Cloud Intelligence product 34
  • 35. Storage Engines • MySQL (/MariaDB) have many • cool ones include TokuDB, SPIDER, CONNECT • You basically use InnoDB and MyISAM with cloud solutions • MyISAM on RDS won’t guarantee point- in-time recovery, snapshot restore 35
  • 36. High Availability • Plan for node failures • Don’t assume node provisioning is quick • Backup, backup, backup! • “Bad” nodes exist • HA is not equal across options - RDS wins so far 36
  • 37. Unsupported features • AWS: GTIDs, InnoDB Cache Warming, InnoDB transportable tablespaces, authentication plugins, semi-sync replication • Google: UDFs, replication, LOAD DATA INFILE, INSTALL PLUGIN, SELECT ... INTO OUTFILE 37
  • 38. Provisioned IOPS • Only available on Amazon • Faster, predictable, consistent I/O performance with low latencies • Good throughput, RAID on backed • EBS is more reliable 38
  • 39. More on RDS • log access via API • no SUPER access to skip replication errors easily • sync_binlog=0 not available • no OS access (sar, ps, tcpdump) • https://github.com/boto/boto 39
  • 40. Warning: automatic upgrades • Regressions happen even with a minor version upgrade in the MySQL world • InnoDB update that modifies rows PK triggers recursive behaviour until all disk space is exceeded? 5.5.24->5.5.25 (fixed: 5.5.25a) • Using query cache for partitioned tables? Disabled since 5.5.22->5.5.23! 40
  • 41. Benchmarking for use • sysbench • OLTP test, use tables with 20M rows and 20M transactions, check 1-128 threads/run (run this on RDS, Rackspace) • June 2013, tps, performance per dollar, Rackspace delivers more performance across all flavours except 512MB instance • Yahoo! Cloud Serving Benchmark • https://github.com/ brianfrankcooper/YCSB • Google’s PerfKit Benchmarker • https://github.com/ GoogleCloudPlatform/ PerfKitBenchmarker 41
  • 42. Roadmaps? • There don’t seem to be public roadmaps. You find out when there’s a change! • Presumably HPCloud will get 5.6… and maybe Google will get some MariaDB? 42
  • 44. PostgreSQL in RDS • loading data? backup_retntion=0 • disable multi-AZ when loading • disable autovacuum • dump compressed, restore in parallel • don’t disable fsync (really!) • sync replication using multi-AZ • you can control the upgrade time though — this is a bonus • Use PIOPS • SSL should be on 44
  • 45. Running MySQL in EC2 • Can do multiple geographic regions via replication • Run just one Percona Server/ MariaDB server/instance • Use additional EBS volumes for InnoDB tablespaces • RAID EBS volumes (RAID1) • Warm up data partitions, mount partitions with noatime, nodirtime • Vertical scaling with SSD-backed storage • Monitoring with nagios • Snapshot backups and save to S3 • Can use Elastic Load Balancer • Can use spot instances • Can use tools like MHA to provide automatic failover • Can use MariaDB Galera Cluster/ Percona XtraDB Cluster 45
  • 46. AWS Aurora • Bigger instances work better • Zero-downtime migration from RDS • Metrics via CloudWatch • Connectors via MariaDB • 99.99% uptime 46
  • 47. Some closing thoughts • Hardware varies per region • Sometimes, software manageability varies per region • Beware cost on your credit card! 47
  • 48. Q&A.ThankYou. [email protected] | [email protected] http://bytebot.net/blog/ | @bytebot on Twitter Download MariaDB and give it a try: http://mariadb.org/ 48