SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
May 23, 2018
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why MySQL?
Ease of use
Triggers, stored procedures,
updatable views, JSON
Many available tools and utilities
Security
Authentication and granular
access control
Full encryption of database traffic
with TLS
Broad language support
Python, Java, .NET, Node.js,
C/C++, Perl, PHP, Tcl, Ruby,
ODBC, Erlang, Objective-C, more
Reliability
Transactional storage engine
adheres to ACID model
Performance
B-tree disk tables with index
compression, thread-based
memory allocation, and optimized
nested-loop joins
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Running MySQL on AWS
AWS managed DB services
RDS for MySQL, MariaDB
Aurora with MySQL-compatibility
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Choosing your AWS MySQL deployment strategy
Self-managed
on application
server
Self-managed
on database
server
AWS-managed
open source
engines
AWS-managed
cloud native
engine
Control Automation
EC2 RDS for
MySQL,
MariaDB
Aurora with
MySQL
compatibility
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Managed MySQL engines in AWS
Standard
The open source
standard MySQL
Community
The popular
community choice
Amazon Aurora
Performance
The fastest MySQL
compatible engine
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Support for MySQL Community Edition versions 5.5, 5.6, and 5.7
InnoDB and MyISAM storage engines
Version 5.7—new features
• JSON support
• Query optimizer improvements
• GIS extensions
• Improved parallel replication
• Dynamic buffer pool resizing
Version 8.0 coming soon
Amazon RDS for MySQL
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Support for versions 10.0,10.1, and 10.2
Same instance, regions, pricing as RDS for MySQL (including free tier)
Differences from RDS MySQL
• Thread Pooling
• GTID for Replication
Version 10.2 – new features
• Window Functions
• Spatial Indexes
• JSON Functions
• Common Table Expressions
Amazon RDS for MariaDB
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Built from the ground up to leverage AWS
• MySQL 5.6 and 5.7 compatible with up to 5x better
performance on the same hardware: 100,000
writes/sec & 500,000 reads/sec
• Scalable with up to 64 TB in single database, up to
15 read replicas
• Highly available, durable, and fault-tolerant custom
SSD storage layer: 6-way replicated across 3
Availability Zones
• Transparent encryption for data at rest using AWS
KMS
• Stored procedures in Amazon Aurora can invoke
AWS Lambda functions
Amazon Aurora
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Optimizing MySQL in Amazon RDS
Here come the hacks!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hack #1: Scale your compute and storage
Choose the right configuration for your workload
Scale compute up to handle
increased load or down to save
costs
• As little as 1vCPU / 1 GiB of RAM
• Up to 64 vCPU and 488 GiB of RAM
• Minimal disruption for
compute scaling
Scale storage for larger data sets
• Scalable Amazon EBS storage up to 16
TiB
• General Purpose SSD or Provisioned
IOPS SSD storage
• No downtime for storage scaling
• Amazon Aurora automatically scales to 64
TiB
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Scheduled daily volume
backup of entire instance
• Archive database change logs
• 35–day maximum retention
• Negligible impact on database
performance
• Taken from standby when
running Multi-AZ
Hack #2: Turn on automated backups
Point-in-time recovery for your DB instance
Every day during your backup
window, RDS creates a storage
volume snapshot of your instance
Every five minutes, RDS backs up the
transaction logs of your database
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Create full or incremental backup
with Percona XtraBackup
• Upload backup to S3 bucket
• Provide AWS IAM role to access
S3 bucket
• Restore backup to RDS MySQL
or Amazon Aurora
• Use replication to catch up to
changes in the source database
(if necessary)
Hack #3: Import Backups from Amazon S3
Easiest way to get your database into RDS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fault tolerance across
multiple data centers
• Automatic failover
• Synchronous replication
• Enabled with a few clicks
Redirection to the new
primary instance is provided
through DNS
Hack #4: Enable Multi-AZ configuration
Enterprise-grade high availability
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Relieve pressure on your master node with
additional read capacity
• Bring data close to your applications
in different regions
• Promote a read replica to a master for
faster recovery in the event of disaster
• Low latency replicas for Amazon Aurora
can be used for both read scaling and
failover targets
Hack #5: Create read replicas
Read scaling and disaster recovery
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hack #6: Secure network access with Amazon VPC
Security groups provide a network firewall for your database server
Protocol Port range Source
TCP 3306 172.31.0.0/16
TCP 3306
“Application
security group”
Corporate address admins
Application tier
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hack #7: Turn on encryption
Encrypt data at rest with AWS Key Management Service
Two-tiered key hierarchy using
envelope encryption
• Unique data key encrypts customer data
• AWS KMS master keys encrypt data keys
• No impact on performance
Benefits
• Limits risk of compromised data key
• Better performance for encrypting large data
• Easier to manage small number of master keys
than millions of data keys
• Centralized access and audit of key activity
Data keys
Amazon RDS
instance 3
Amazon RDS
instance 2
Amazon RDS
instance 1
Customer master key(s)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudWatch Metrics
• Displayed in the RDS Console or
personalized CloudWatch dashboards
• As low as 1 minute intervals
Amazon CloudWatch Alarms
• Trigger actions based on a metric value
relative to a threshold you set
Enhanced Monitoring for Amazon RDS
• Access to over 50 CPU, memory, file
system, and disk I/O metrics
• As low as 1 second intervals
Integration with third-party monitoring tools
Hack #8: Monitor your MySQL DB instance
Detect problems before a failure occurs
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Measures database load
to help you identify
database bottlenecks
• Top SQL/most intensive
queries
• Enables problem
discovery
• Adjustable timeframe
• Hour, day, week, and
longer
Hack #9: Enable RDS Performance Insights
Built-in database performance monitoring
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Real time publishing for
RDS for MySQL, MariaDB
and Amazon Aurora
• Supported logs
• General log
• Slow query log
• Audit log
• Error log
• Set up CloudWatch Alarms
• Specify a retention period
Hack #10: Publish Logs to CloudWatch Logs
Consolidate and archive database events
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Provides customer configurable event logging for database activity
• Auditable events include logins, queries, and tables accessed
• Individual users can be included or excluded from the audit
• The audit plug-in is supported on the following RDS engines
• MySQL 5.6, 5.7
• MariaDB 10.0, 10.1, 10.2
• Amazon Aurora
• Available via RDS option group
• Test for impact on server performance
Bonus Hack: Enable the Audit plug-in
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hundreds of thousands of customers use Amazon RDS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
aws.amazon.com/rds
Learn
more
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory Data
Amazon Web Services
 
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF LoftData Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
Amazon Web Services
 
Data Warehousing with Amazon Redshift
Data Warehousing with Amazon RedshiftData Warehousing with Amazon Redshift
Data Warehousing with Amazon Redshift
Amazon Web Services
 
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Amazon Web Services
 
Data Warehouses and Data Lakes
Data Warehouses and Data LakesData Warehouses and Data Lakes
Data Warehouses and Data Lakes
Amazon Web Services
 
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
Amazon Web Services
 
Analyzing Streams
Analyzing StreamsAnalyzing Streams
Analyzing Streams
Amazon Web Services
 
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Amazon Web Services
 
Loading Data into Redshift with Lab
Loading Data into Redshift with LabLoading Data into Redshift with Lab
Loading Data into Redshift with Lab
Amazon Web Services
 
Data Warehouses and Data Lakes
Data Warehouses and Data LakesData Warehouses and Data Lakes
Data Warehouses and Data Lakes
Amazon Web Services
 
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
Amazon Web Services
 
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Amazon Web Services
 
Using Data Lakes
Using Data LakesUsing Data Lakes
Using Data Lakes
Amazon Web Services
 
How Amazon.com Uses AWS Analytics
How Amazon.com Uses AWS AnalyticsHow Amazon.com Uses AWS Analytics
How Amazon.com Uses AWS Analytics
Amazon Web Services
 
Nonrelational Revolution
Nonrelational RevolutionNonrelational Revolution
Nonrelational Revolution
Amazon Web Services
 
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon Web Services
 
Loading Data into Amazon Redshift
Loading Data into Amazon RedshiftLoading Data into Amazon Redshift
Loading Data into Amazon Redshift
Amazon Web Services
 
Introducing AWS DeepLens - AWS Online Tech Talks
Introducing AWS DeepLens - AWS Online Tech TalksIntroducing AWS DeepLens - AWS Online Tech Talks
Introducing AWS DeepLens - AWS Online Tech Talks
Amazon Web Services
 
How Amazon uses AWS Analytics
How Amazon uses AWS AnalyticsHow Amazon uses AWS Analytics
How Amazon uses AWS Analytics
Amazon Web Services
 
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Amazon Web Services
 

What's hot (20)

Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory Data
 
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF LoftData Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
Data Warehousing with Amazon Redshift: Data Analytics Week at the SF Loft
 
Data Warehousing with Amazon Redshift
Data Warehousing with Amazon RedshiftData Warehousing with Amazon Redshift
Data Warehousing with Amazon Redshift
 
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
 
Data Warehouses and Data Lakes
Data Warehouses and Data LakesData Warehouses and Data Lakes
Data Warehouses and Data Lakes
 
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
Building Serverless Analytics Pipelines with AWS Glue (ANT308) - AWS re:Inven...
 
Analyzing Streams
Analyzing StreamsAnalyzing Streams
Analyzing Streams
 
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
 
Loading Data into Redshift with Lab
Loading Data into Redshift with LabLoading Data into Redshift with Lab
Loading Data into Redshift with Lab
 
Data Warehouses and Data Lakes
Data Warehouses and Data LakesData Warehouses and Data Lakes
Data Warehouses and Data Lakes
 
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
What's New with Amazon Redshift ft. Dow Jones (ANT350-R) - AWS re:Invent 2018
 
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
Aurora Serverless: Scalable, Cost-Effective Application Deployment (DAT336) -...
 
Using Data Lakes
Using Data LakesUsing Data Lakes
Using Data Lakes
 
How Amazon.com Uses AWS Analytics
How Amazon.com Uses AWS AnalyticsHow Amazon.com Uses AWS Analytics
How Amazon.com Uses AWS Analytics
 
Nonrelational Revolution
Nonrelational RevolutionNonrelational Revolution
Nonrelational Revolution
 
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
 
Loading Data into Amazon Redshift
Loading Data into Amazon RedshiftLoading Data into Amazon Redshift
Loading Data into Amazon Redshift
 
Introducing AWS DeepLens - AWS Online Tech Talks
Introducing AWS DeepLens - AWS Online Tech TalksIntroducing AWS DeepLens - AWS Online Tech Talks
Introducing AWS DeepLens - AWS Online Tech Talks
 
How Amazon uses AWS Analytics
How Amazon uses AWS AnalyticsHow Amazon uses AWS Analytics
How Amazon uses AWS Analytics
 
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
 

Similar to 10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks

Intro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksIntro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech Talks
Amazon Web Services
 
Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310 Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310
Amazon Web Services
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon Web Services
 
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
Amazon Web Services
 
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon Web Services
 
Open Source Databases on the Cloud
Open Source Databases on the CloudOpen Source Databases on the Cloud
Open Source Databases on the Cloud
Amazon Web Services
 
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
Amazon Web Services
 
Databases - EBC on the road Brazil Edition [Portuguese]
Databases - EBC on the road Brazil Edition [Portuguese]Databases - EBC on the road Brazil Edition [Portuguese]
Databases - EBC on the road Brazil Edition [Portuguese]
Amazon Web Services
 
Relational Database Services on AWS
Relational Database Services on AWSRelational Database Services on AWS
Relational Database Services on AWS
Amazon Web Services
 
MySQL and MariaDB
MySQL and MariaDBMySQL and MariaDB
MySQL and MariaDB
Amazon Web Services
 
Managed NoSQL databases
Managed NoSQL databasesManaged NoSQL databases
Managed NoSQL databases
Amazon Web Services
 
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Amazon Web Services
 
Relational Database Services on AWS - Bill Baldwin
Relational Database Services on AWS - Bill BaldwinRelational Database Services on AWS - Bill Baldwin
Relational Database Services on AWS - Bill Baldwin
Amazon Web Services
 
Managed Relational Databases
Managed Relational DatabasesManaged Relational Databases
Managed Relational Databases
Amazon Web Services
 
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
Amazon Web Services
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
Amazon Web Services
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
Amazon Web Services
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
Amazon Web Services
 
Open Source Managed Databases: Database Week SF
Open Source Managed Databases: Database Week SFOpen Source Managed Databases: Database Week SF
Open Source Managed Databases: Database Week SF
Amazon Web Services
 
Amazon Aurora: Database Week SF
Amazon Aurora: Database Week SFAmazon Aurora: Database Week SF
Amazon Aurora: Database Week SF
Amazon Web Services
 

Similar to 10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks (20)

Intro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksIntro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech Talks
 
Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310 Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
 
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
Cost and Performance Optimisation in Amazon RDS - AWS Summit Sydney 2018
 
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
 
Open Source Databases on the Cloud
Open Source Databases on the CloudOpen Source Databases on the Cloud
Open Source Databases on the Cloud
 
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 
Databases - EBC on the road Brazil Edition [Portuguese]
Databases - EBC on the road Brazil Edition [Portuguese]Databases - EBC on the road Brazil Edition [Portuguese]
Databases - EBC on the road Brazil Edition [Portuguese]
 
Relational Database Services on AWS
Relational Database Services on AWSRelational Database Services on AWS
Relational Database Services on AWS
 
MySQL and MariaDB
MySQL and MariaDBMySQL and MariaDB
MySQL and MariaDB
 
Managed NoSQL databases
Managed NoSQL databasesManaged NoSQL databases
Managed NoSQL databases
 
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
 
Relational Database Services on AWS - Bill Baldwin
Relational Database Services on AWS - Bill BaldwinRelational Database Services on AWS - Bill Baldwin
Relational Database Services on AWS - Bill Baldwin
 
Managed Relational Databases
Managed Relational DatabasesManaged Relational Databases
Managed Relational Databases
 
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
What's New in Amazon Relational Database Service (DAT203) - AWS re:Invent 2018
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Open Source Managed Databases: Database Week SF
Open Source Managed Databases: Database Week SFOpen Source Managed Databases: Database Week SF
Open Source Managed Databases: Database Week SF
 
Amazon Aurora: Database Week SF
Amazon Aurora: Database Week SFAmazon Aurora: Database Week SF
Amazon Aurora: Database Week SF
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
Amazon Web Services
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
Amazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Amazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
Amazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Amazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. May 23, 2018
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why MySQL? Ease of use Triggers, stored procedures, updatable views, JSON Many available tools and utilities Security Authentication and granular access control Full encryption of database traffic with TLS Broad language support Python, Java, .NET, Node.js, C/C++, Perl, PHP, Tcl, Ruby, ODBC, Erlang, Objective-C, more Reliability Transactional storage engine adheres to ACID model Performance B-tree disk tables with index compression, thread-based memory allocation, and optimized nested-loop joins
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Running MySQL on AWS AWS managed DB services RDS for MySQL, MariaDB Aurora with MySQL-compatibility
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Choosing your AWS MySQL deployment strategy Self-managed on application server Self-managed on database server AWS-managed open source engines AWS-managed cloud native engine Control Automation EC2 RDS for MySQL, MariaDB Aurora with MySQL compatibility
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Managed MySQL engines in AWS Standard The open source standard MySQL Community The popular community choice Amazon Aurora Performance The fastest MySQL compatible engine
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Support for MySQL Community Edition versions 5.5, 5.6, and 5.7 InnoDB and MyISAM storage engines Version 5.7—new features • JSON support • Query optimizer improvements • GIS extensions • Improved parallel replication • Dynamic buffer pool resizing Version 8.0 coming soon Amazon RDS for MySQL
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Support for versions 10.0,10.1, and 10.2 Same instance, regions, pricing as RDS for MySQL (including free tier) Differences from RDS MySQL • Thread Pooling • GTID for Replication Version 10.2 – new features • Window Functions • Spatial Indexes • JSON Functions • Common Table Expressions Amazon RDS for MariaDB
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Built from the ground up to leverage AWS • MySQL 5.6 and 5.7 compatible with up to 5x better performance on the same hardware: 100,000 writes/sec & 500,000 reads/sec • Scalable with up to 64 TB in single database, up to 15 read replicas • Highly available, durable, and fault-tolerant custom SSD storage layer: 6-way replicated across 3 Availability Zones • Transparent encryption for data at rest using AWS KMS • Stored procedures in Amazon Aurora can invoke AWS Lambda functions Amazon Aurora
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Optimizing MySQL in Amazon RDS Here come the hacks!
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hack #1: Scale your compute and storage Choose the right configuration for your workload Scale compute up to handle increased load or down to save costs • As little as 1vCPU / 1 GiB of RAM • Up to 64 vCPU and 488 GiB of RAM • Minimal disruption for compute scaling Scale storage for larger data sets • Scalable Amazon EBS storage up to 16 TiB • General Purpose SSD or Provisioned IOPS SSD storage • No downtime for storage scaling • Amazon Aurora automatically scales to 64 TiB
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Scheduled daily volume backup of entire instance • Archive database change logs • 35–day maximum retention • Negligible impact on database performance • Taken from standby when running Multi-AZ Hack #2: Turn on automated backups Point-in-time recovery for your DB instance Every day during your backup window, RDS creates a storage volume snapshot of your instance Every five minutes, RDS backs up the transaction logs of your database
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Create full or incremental backup with Percona XtraBackup • Upload backup to S3 bucket • Provide AWS IAM role to access S3 bucket • Restore backup to RDS MySQL or Amazon Aurora • Use replication to catch up to changes in the source database (if necessary) Hack #3: Import Backups from Amazon S3 Easiest way to get your database into RDS
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Fault tolerance across multiple data centers • Automatic failover • Synchronous replication • Enabled with a few clicks Redirection to the new primary instance is provided through DNS Hack #4: Enable Multi-AZ configuration Enterprise-grade high availability
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Relieve pressure on your master node with additional read capacity • Bring data close to your applications in different regions • Promote a read replica to a master for faster recovery in the event of disaster • Low latency replicas for Amazon Aurora can be used for both read scaling and failover targets Hack #5: Create read replicas Read scaling and disaster recovery
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hack #6: Secure network access with Amazon VPC Security groups provide a network firewall for your database server Protocol Port range Source TCP 3306 172.31.0.0/16 TCP 3306 “Application security group” Corporate address admins Application tier
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hack #7: Turn on encryption Encrypt data at rest with AWS Key Management Service Two-tiered key hierarchy using envelope encryption • Unique data key encrypts customer data • AWS KMS master keys encrypt data keys • No impact on performance Benefits • Limits risk of compromised data key • Better performance for encrypting large data • Easier to manage small number of master keys than millions of data keys • Centralized access and audit of key activity Data keys Amazon RDS instance 3 Amazon RDS instance 2 Amazon RDS instance 1 Customer master key(s)
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon CloudWatch Metrics • Displayed in the RDS Console or personalized CloudWatch dashboards • As low as 1 minute intervals Amazon CloudWatch Alarms • Trigger actions based on a metric value relative to a threshold you set Enhanced Monitoring for Amazon RDS • Access to over 50 CPU, memory, file system, and disk I/O metrics • As low as 1 second intervals Integration with third-party monitoring tools Hack #8: Monitor your MySQL DB instance Detect problems before a failure occurs
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Measures database load to help you identify database bottlenecks • Top SQL/most intensive queries • Enables problem discovery • Adjustable timeframe • Hour, day, week, and longer Hack #9: Enable RDS Performance Insights Built-in database performance monitoring
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Real time publishing for RDS for MySQL, MariaDB and Amazon Aurora • Supported logs • General log • Slow query log • Audit log • Error log • Set up CloudWatch Alarms • Specify a retention period Hack #10: Publish Logs to CloudWatch Logs Consolidate and archive database events
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • Provides customer configurable event logging for database activity • Auditable events include logins, queries, and tables accessed • Individual users can be included or excluded from the audit • The audit plug-in is supported on the following RDS engines • MySQL 5.6, 5.7 • MariaDB 10.0, 10.1, 10.2 • Amazon Aurora • Available via RDS option group • Test for impact on server performance Bonus Hack: Enable the Audit plug-in
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hundreds of thousands of customers use Amazon RDS
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. aws.amazon.com/rds Learn more
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!