SlideShare a Scribd company logo
1 of 54
Download to read offline
Deep Dive: Amazon RDS
Julien Simon"
Principal Technical Evangelist
julsimon@amazon.fr
@julsimon
What to expect
•  Amazon RDS overview (super quick)
•  Security
•  Metrics and monitoring
•  High availability
•  Scaling on RDS
•  Backups and snapshots
•  Migrating to RDS
No infrastructure
management
Scale up/down
Cost-effective
Instant provisioning
Application
compatibility
Amazon Relational Database Service (Amazon RDS)
https://aws.amazon.com/rds/whats-new/
Amazon RDS engines
Commercial
 Open source
 Amazon Aurora
Selected Amazon RDS customers
Selected Amazon Aurora customers
Trade-offs with a managed service
Fully managed host and OS
•  No access to the database host operating system
•  Limited ability to modify configuration that is managed on the
host operating system
•  No functions that rely on configuration from the host OS
Fully managed storage
•  Max storage limits
•  Microsoft SQL Server—4 TB
•  MySQL, MariaDB, PostgreSQL, Oracle—6 TB
•  Aurora—64 TB
•  Growing your database is a process
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html 
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.CommonDBATasks.html 
Amazon RDS: the fine print J
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Parameters.html
Security
Amazon Virtual Private Cloud (VPC)
Securely control network configuration
Availability Zone
AWS Region
10.1.0.0/16
10.1.1.0/24
Manage connectivity
AWS Direct
Connect
VPN
connection
VPC
peering
Internet
gateway
Routing
rules
Security groups
Database IP firewall protection
Protocol Port Range Source
TCP 3306 172.31.0.0/16
TCP 3306 “Application
security group”
Corporate address admins
Application tier
Compliance
Singapore MTCS
27001/9001
27017/27018
https://aws.amazon.com/compliance/
MySQL, Oracle, Postgres
•  SOC 1, 2, and 3
•  ISO 27001/9001
•  ISO 27017/27018
•  PCI DSS
•  FedRAMP
•  HIPAA BAA
•  UK government programs
•  MTCS (Singapore)
•  C5 (Germany)
Compliance
SQL Server
•  SOC 1, 2, and 3
•  ISO 27001/9001
•  ISO 27017/27018
•  PCI DSS
•  UK government programs
•  MTCS (Singapore)
•  C5 (Germany)
https://aws.amazon.com/compliance/services-in-scope/
In-flight data encryption"

SSL available for all six engines
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html
At-rest data encryption
•  DB instance storage
•  Automated backups
•  Read Replicas
•  Snapshots
•  Available for all six engines
•  No additional cost
•  Support compliance requirements
•  TDE also available for Oracle / SQL Server

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html
Amazon RDS encryption hints 

•  You can only encrypt on new database creation
•  Encryption cannot be removed
•  Master and Read Replica must be encrypted
•  (Jan’17) you can now replicate encrypted DB across regions
•  Unencrypted snapshots can’t be restored to encrypted DB
•  Aurora will allow this
•  You can create encrypted copies of your unencrypted
snapshots
AWS KMS—RDS standard encryption
Two-tiered key hierarchy using envelope encryption:
•  Unique data key encrypts customer data
•  AWS KMS master keys encrypt data keys
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 key 1
Amazon
S3 object
Amazon
EBS volume
Data key 2
 Data key 3
 Data key 4
Custom"
application
Customer master"
key(s)
Amazon
RDS
instance
https://aws.amazon.com/kms/
Your RDS instance
+
Data key Encrypted data key
Encrypted"
data
Master key(s) in "
customer’s account
AWS KMS
1.  RDS instance requests encryption key to use to encrypt data, passes reference to master key in account
2.  Client request authenticated based on permissions set on both the user and the key
3.  A unique data encryption key is created and encrypted under the KMS master key
4.  Plaintext and encrypted data key returned to the client
5.  Plaintext data key used to encrypt data and then deleted when practical
6.  Encrypted data key is stored; it’s sent back to KMS when needed for data decryption
How keys are used to protect your data
https://aws.amazon.com/kms/
Enabling encryption with the AWS CLI
aws rds create-db-instance --region us-west-2 --db-instance-identifier sg-cli-test 
--allocated-storage 20 --storage-encrypted 
--db-instance-class db.m4.large --engine mysql 
--master-username myawsuser --master-user-password myawsuser
aws rds create-db-instance --region us-west-2 --db-instance-identifier sg-cli-test1 
--allocated-storage 20 --storage-encrypted --kms-key-id xxxxxxxxxxxxxxxxxx 
--db-instance-class db.m4.large --engine mysql 
--master-username myawsuser --master-user-password myawsuser
http://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html
IAM governed access
You can use AWS Identity and Access Management (IAM) to
control who can perform actions on RDS
Users and DBA
Applications
 DBA and Ops
Your database
 RDS
Controlled with IAM
Controlled with database GRANTs
Metrics and monitoring
Standard monitoring
Amazon CloudWatch metrics
for Amazon RDS
l  CPU utilization
l  Storage
l  Memory
l  Swap usage
l  DB connections
l  I/O (read and write)
l  Latency (read and write)
l  Throughput (read and write)
l  Replica lag
l  Many more
Amazon CloudWatch Alarms
l  Similar to on-premises custom
monitoring tools
(Nov’16) price drop, longer retention & percentile monitoring
https://aws.amazon.com/about-aws/whats-new/2016/11/announcing-cloudwatch-metrics-price-
reduction-and-new-volume-based-pricing-tiers/
https://aws.amazon.com/blogs/aws/amazon-cloudwatch-update-percentile-statistics-and-new-
dashboard-widgets/
https://aws.amazon.com/about-aws/whats-new/2016/11/cloudwatch-extends-metrics-retention-and-
new-user-interface/
Enhanced Monitoring
Access to over 50 new CPU, memory, file system, and disk I/O metrics "
as low as 1 second intervals (sent to CloudWatch Logs)
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html
Event notifications
•  Uses Amazon Simple Notification
Service (Amazon SNS) to notify
users when an event occurs
•  17 different event categories
(availability, backup, configuration
change, and so on)
High availability
Minimal deployment—single AZ
Availability Zone
AWS Region
10.1.0.0/16
10.1.1.0/24
Amazon Elastic Block Store
volume
High availability—Multi-AZ
Availability Zone A
AWS Region
10.1.0.0/16
10.1.1.0/24
Availability Zone B
10.1.2.0/24
Synchronous replication
Same instance
type as master
High availability—Multi-AZ to DNS
dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
High availability—Amazon Aurora storage
•  Storage volume automatically grows up to
64 TB
•  6 copies across 3 AZs
•  Quorum system for read/write; "
latency tolerant
•  Peer-to-peer gossip replication to fill in holes
•  Continuous backup to Amazon S3 "
(built for 11 9s durability)
•  Continuous monitoring of nodes "
and disks for repair 
•  10 GB segments as unit of repair "
or hotspot rebalance
•  Quorum membership changes do not "
stall writes
AZ 1
 AZ 2
 AZ 3
Amazon S3
High availability—Aurora
•  Aurora cluster contains primary
node and up to 15 secondary
nodes (read-only)
•  Failing nodes are automatically
detected and replaced
•  Failing database processes are
automatically detected and
recycled
•  Secondary nodes automatically
promoted on persistent outage,
no single point of failure
•  Customer application can scale
out read traffic across secondary
nodes
AZ 1
 AZ 3
AZ 2
Primary
Node
Primary
Node
Primary
Node
Primary
Node
Primary
Node
Secondary
Node
Primary
Node
Primary
Node
Secondary
Node
Failover – MySQL vs Aurora
App
Running
Failure Detection
 DNS Propagation
Recovery
 Recovery
DB
Failure
MySQL
App
Running
Failure Detection
 DNS Propagation
Recovery
DB
Failure
Aurora with MariaDB driver
1 5 - 3 0 s e c 
5 - 2 0 s e c 
1 5 - 3 0 s e c 
Driver benefits
https://mariadb.com/kb/en/mariadb/failover-and-high-availability-with-mariadb-connector-j/
https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/
Tips to improve recovery time with MySQL
•  DO NOT use the IP address to connect to RDS!
•  Set a low TTL on your own CNAME (beware if you use Java)
•  Avoid large number of tables : 
•  No more than 1000 tables using Standard Storage
•  No more than 10,000 tables using Provisioned IOPS
•  Avoid very large tables in your database
•  Avoid large transactions
•  Make sure you have enough IOPS for recovery
•  Use RDS Events to be notified
Simulating Amazon Aurora failures
ALTER SYSTEM CRASH [ INSTANCE | DISPATCHER | NODE ];

ALTER SYSTEM SIMULATE percentage_of_failure PERCENT
•  READ REPLICA FAILURE [ TO ALL | TO "replica name" ]
•  DISK FAILURE [ IN DISK index | NODE index ]
•  DISK CONGESTION BETWEEN minimum AND maximum
MILLISECONDS [ IN DISK index | NODE index ] 
FOR INTERVAL quantity [ YEAR | QUARTER | MONTH | WEEK| DAY |
HOUR | MINUTE | SECOND ]; 


http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html
Scaling on RDS
Read Replicas
Bring data close to your customer’s
applications in different regions

Relieve pressure on your master
node for supporting reads and
writes

Promote a Read Replica to a master
for faster recovery in the event of
disaster"
Read Replicas
Within a region
•  MySQL
•  MariaDB
•  PostgreSQL
•  Aurora

Cross-region
•  MySQL
•  MariaDB
•  PostgreSQL
•  Aurora
Read Replicas for Amazon Aurora
AZ 1
AZ 3
AZ 2
Primary
Node
Primary
Node
Primary
node
AZ 1
AZ 1
Primary
Node
Primary
Node
Read Replica
node
AZ 1
Primary
Node
Primary
Node
Read Replica
node
Read Replicas—Oracle and SQL Server
Options
•  Oracle GoldenGate
•  Third-party replication products
•  Snapshots
Scaling up—or down
•  Handle higher load or lower usage

•  Control costs
Scaling up—or down
AWS Management Console
Scaling—single AZ
With single AZ deployment, the master takes an outage
dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
Scaling—Multi-AZ
With Multi-AZ, the standby gets upgraded first
dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
Scaling on a schedule – CLI or AWS Lambda
import boto3
 
client=boto3.client('rds')
 
def lambda_handler(event, context):
response=client.modify_db_instance(DBInstanceIdentifier='sg-cli-test',
DBInstanceClass='db.m4.xlarge',
ApplyImmediately=True)
 
print response
#Scale down at 8:00 PM on Friday
0 20 * * 5 /home/ec2-user/scripts/
scale_down_rds.sh
#Scale up at 4:00 AM on Monday
0 4 * * 1 /home/ec2-user/scripts/
scale_up_rds.sh
aws rds modify-db-instance
--db-instance-identifier sg-cli-test
--db-instance-class db.m4.large
--apply-immediately
Scaling on demand – Cloudwatch & AWS Lambda
import boto3
import json
 
client=boto3.client('rds')
 
def lambda_handler(event, context):
message = event['Records'][0]['Sns']['Message']
parsed_message=json.loads(message)
db_instance=parsed_message['Trigger']['Dimensions'][0]['value']
print 'DB Instance: ' + db_instance
response=client.modify_db_instance(DBInstanceIdentifier=db_instance,
DBInstanceClass='db.m4.large',
ApplyImmediately=True)
print response
SNS LambdaCloudwatchRDS
Backups and snapshots
Backups
MySQL, PostgreSQL, MariaDB, Oracle, SQL Server
•  Scheduled daily backup of entire instance
•  Archive database change logs
•  35 day retention for backups
•  Multiple copies in each AZ where you have instances

Aurora
•  Automatic, continuous, incremental backups
•  Point-in-time restore
•  No impact on database performance
•  35 day retention
Restoring
•  Restoring creates an entirely new database instance
•  You define the instance configuration just like a new
instance
Snapshots
•  Full copies of your Amazon RDS database that are
different from your scheduled backups
•  Backed by Amazon S3
•  Used to create a new RDS instance
•  Remain encrypted if using encryption
Snapshots
Use cases
•  Resolve production issues
•  Build non-production environments
•  Point-in-time restore
•  Final copy before terminating a database
•  Disaster recovery
•  Cross-region copy
•  Copy between accounts
Migrating onto RDS
ü  Move data to the same or different database engine 
ü  Keep your apps running during the migration
ü  Start your first migration in 10 minutes or less
ü  Replicate within, to, or from Amazon EC2 or RDS
AWS Database "
Migration Service
https://aws.amazon.com/dms/
http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.Sources.html 
http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.Targets.html 
https://aws.amazon.com/blogs/database/database-migration-what-do-you-need-to-know-before-you-start/
Customer
premises
Application Users
AWS
Internet
VPN
Start a replication instance
Connect to source and target
database
Select tables, schemas, or databases
Let the AWS Database Migration
Service create tables, load data,
and keep them in sync
Switch applications over to the
target at your convenience
Keep your apps running during the migration
•  Move your tables, views, stored procedures,
and data manipulation language (DML) to
RDS or Amazon Redshift
•  Highlight where manual edits are needed
AWS Schema "
Conversion Tool
https://aws.amazon.com/dms/
Julien Simon
julsimon@amazon.fr
@julsimon 
Your feedback 
is important to us!

More Related Content

What's hot

Getting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWSGetting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWS
Amazon Web Services
 

What's hot (20)

Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)
 
Deep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech TalksDeep Dive on MySQL Databases on AWS - AWS Online Tech Talks
Deep Dive on MySQL Databases on AWS - AWS Online Tech Talks
 
Amazon S3 - Masterclass - Pop-up Loft Tel Aviv
Amazon S3 - Masterclass - Pop-up Loft Tel AvivAmazon S3 - Masterclass - Pop-up Loft Tel Aviv
Amazon S3 - Masterclass - Pop-up Loft Tel Aviv
 
Getting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWSGetting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWS
 
Deep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database ServiceDeep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database Service
 
Storage & Content Delivery
Storage & Content DeliveryStorage & Content Delivery
Storage & Content Delivery
 
Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
Data Storage for the Long Haul: Compliance and Archive
Data Storage for the Long Haul: Compliance and ArchiveData Storage for the Long Haul: Compliance and Archive
Data Storage for the Long Haul: Compliance and Archive
 
Big Data adoption success using AWS Big Data Services - Pop-up Loft TLV 2017
Big Data adoption success using AWS Big Data Services - Pop-up Loft TLV 2017Big Data adoption success using AWS Big Data Services - Pop-up Loft TLV 2017
Big Data adoption success using AWS Big Data Services - Pop-up Loft TLV 2017
 
Migrate your Data Warehouse to Amazon Redshift - September Webinar Series
Migrate your Data Warehouse to Amazon Redshift - September Webinar SeriesMigrate your Data Warehouse to Amazon Redshift - September Webinar Series
Migrate your Data Warehouse to Amazon Redshift - September Webinar Series
 
Deep Dive on Amazon RDS (May 2016)
Deep Dive on Amazon RDS (May 2016)Deep Dive on Amazon RDS (May 2016)
Deep Dive on Amazon RDS (May 2016)
 
Amazon EC2:Masterclass
Amazon EC2:MasterclassAmazon EC2:Masterclass
Amazon EC2:Masterclass
 
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for RedisManaging Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
Managing Data with Voume Velocity, and Variety with Amazon ElastiCache for Redis
 
AWS Webcast - High Availability SQL Server with Amazon RDS
AWS Webcast - High Availability SQL Server with Amazon RDSAWS Webcast - High Availability SQL Server with Amazon RDS
AWS Webcast - High Availability SQL Server with Amazon RDS
 
Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 
數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣
 
AWS June 2016 Webinar Series - AWS Quarterly Update
AWS June 2016 Webinar Series - AWS Quarterly Update AWS June 2016 Webinar Series - AWS Quarterly Update
AWS June 2016 Webinar Series - AWS Quarterly Update
 
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
透過 Amazon Redshift 打造數據分析服務及 Amazon Redshift 新功能案例介紹
 
AWS March 2016 Webinar Series - Amazon EC2 Masterclass
AWS March 2016 Webinar Series - Amazon EC2 MasterclassAWS March 2016 Webinar Series - Amazon EC2 Masterclass
AWS March 2016 Webinar Series - Amazon EC2 Masterclass
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 

Similar to Deep Dive RDS & Aurora - Pop-up Loft TLV 2017

Similar to Deep Dive RDS & Aurora - Pop-up Loft TLV 2017 (20)

Deep Dive on Amazon Relational Database Service (November 2016)
Deep Dive on Amazon Relational Database Service (November 2016)Deep Dive on Amazon Relational Database Service (November 2016)
Deep Dive on Amazon Relational Database Service (November 2016)
 
Deep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database ServiceDeep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database Service
 
Amazon Relational Database Service Deep Dive
Amazon Relational Database Service Deep DiveAmazon Relational Database Service Deep Dive
Amazon Relational Database Service Deep Dive
 
Deep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database ServiceDeep Dive on Amazon Relational Database Service
Deep Dive on Amazon Relational Database Service
 
AWS re:Invent 2016: Deep Dive on Amazon Relational Database Service (DAT305)
AWS re:Invent 2016: Deep Dive on Amazon Relational Database Service (DAT305)AWS re:Invent 2016: Deep Dive on Amazon Relational Database Service (DAT305)
AWS re:Invent 2016: Deep Dive on Amazon Relational Database Service (DAT305)
 
Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)
 
Migrating Your Databases to AWS Deep Dive on Amazon RDS and AWS
Migrating Your Databases to AWS Deep Dive on Amazon RDS and AWSMigrating Your Databases to AWS Deep Dive on Amazon RDS and AWS
Migrating Your Databases to AWS Deep Dive on Amazon RDS and AWS
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
Deep Dive on Amazon RDS (Relational Database Service)
Deep Dive on Amazon RDS (Relational Database Service)Deep Dive on Amazon RDS (Relational Database Service)
Deep Dive on Amazon RDS (Relational Database Service)
 
Introduction to Amazon Relational Database Service (Amazon RDS)
Introduction to Amazon Relational Database Service (Amazon RDS)Introduction to Amazon Relational Database Service (Amazon RDS)
Introduction to Amazon Relational Database Service (Amazon RDS)
 
Deep Dive on Amazon RDS
Deep Dive on Amazon RDSDeep Dive on Amazon RDS
Deep Dive on Amazon RDS
 
AWS Database Services-Philadelphia AWS User Group-4-17-2018
AWS Database Services-Philadelphia AWS User Group-4-17-2018AWS Database Services-Philadelphia AWS User Group-4-17-2018
AWS Database Services-Philadelphia AWS User Group-4-17-2018
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
 
Amazon relational database service (rds)
Amazon relational database service (rds)Amazon relational database service (rds)
Amazon relational database service (rds)
 
Getting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWSGetting Started with Managed Database Services on AWS
Getting Started with Managed Database Services on AWS
 
Amazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service MeetupAmazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service Meetup
 
Amazon RDS Deep Dive
Amazon RDS Deep DiveAmazon RDS Deep Dive
Amazon RDS Deep Dive
 

More from 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
 
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
 

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
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Deep Dive RDS & Aurora - Pop-up Loft TLV 2017

  • 1. Deep Dive: Amazon RDS Julien Simon" Principal Technical Evangelist julsimon@amazon.fr @julsimon
  • 2. What to expect •  Amazon RDS overview (super quick) •  Security •  Metrics and monitoring •  High availability •  Scaling on RDS •  Backups and snapshots •  Migrating to RDS
  • 3. No infrastructure management Scale up/down Cost-effective Instant provisioning Application compatibility Amazon Relational Database Service (Amazon RDS) https://aws.amazon.com/rds/whats-new/
  • 4. Amazon RDS engines Commercial Open source Amazon Aurora
  • 7. Trade-offs with a managed service Fully managed host and OS •  No access to the database host operating system •  Limited ability to modify configuration that is managed on the host operating system •  No functions that rely on configuration from the host OS Fully managed storage •  Max storage limits •  Microsoft SQL Server—4 TB •  MySQL, MariaDB, PostgreSQL, Oracle—6 TB •  Aurora—64 TB •  Growing your database is a process
  • 10. Amazon Virtual Private Cloud (VPC) Securely control network configuration Availability Zone AWS Region 10.1.0.0/16 10.1.1.0/24 Manage connectivity AWS Direct Connect VPN connection VPC peering Internet gateway Routing rules
  • 11. Security groups Database IP firewall protection Protocol Port Range Source TCP 3306 172.31.0.0/16 TCP 3306 “Application security group” Corporate address admins Application tier
  • 13. MySQL, Oracle, Postgres •  SOC 1, 2, and 3 •  ISO 27001/9001 •  ISO 27017/27018 •  PCI DSS •  FedRAMP •  HIPAA BAA •  UK government programs •  MTCS (Singapore) •  C5 (Germany) Compliance SQL Server •  SOC 1, 2, and 3 •  ISO 27001/9001 •  ISO 27017/27018 •  PCI DSS •  UK government programs •  MTCS (Singapore) •  C5 (Germany) https://aws.amazon.com/compliance/services-in-scope/
  • 14. In-flight data encryption" SSL available for all six engines http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html
  • 15. At-rest data encryption •  DB instance storage •  Automated backups •  Read Replicas •  Snapshots •  Available for all six engines •  No additional cost •  Support compliance requirements •  TDE also available for Oracle / SQL Server http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html
  • 16. Amazon RDS encryption hints •  You can only encrypt on new database creation •  Encryption cannot be removed •  Master and Read Replica must be encrypted •  (Jan’17) you can now replicate encrypted DB across regions •  Unencrypted snapshots can’t be restored to encrypted DB •  Aurora will allow this •  You can create encrypted copies of your unencrypted snapshots
  • 17. AWS KMS—RDS standard encryption Two-tiered key hierarchy using envelope encryption: •  Unique data key encrypts customer data •  AWS KMS master keys encrypt data keys 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 key 1 Amazon S3 object Amazon EBS volume Data key 2 Data key 3 Data key 4 Custom" application Customer master" key(s) Amazon RDS instance https://aws.amazon.com/kms/
  • 18. Your RDS instance + Data key Encrypted data key Encrypted" data Master key(s) in " customer’s account AWS KMS 1.  RDS instance requests encryption key to use to encrypt data, passes reference to master key in account 2.  Client request authenticated based on permissions set on both the user and the key 3.  A unique data encryption key is created and encrypted under the KMS master key 4.  Plaintext and encrypted data key returned to the client 5.  Plaintext data key used to encrypt data and then deleted when practical 6.  Encrypted data key is stored; it’s sent back to KMS when needed for data decryption How keys are used to protect your data https://aws.amazon.com/kms/
  • 19. Enabling encryption with the AWS CLI aws rds create-db-instance --region us-west-2 --db-instance-identifier sg-cli-test --allocated-storage 20 --storage-encrypted --db-instance-class db.m4.large --engine mysql --master-username myawsuser --master-user-password myawsuser aws rds create-db-instance --region us-west-2 --db-instance-identifier sg-cli-test1 --allocated-storage 20 --storage-encrypted --kms-key-id xxxxxxxxxxxxxxxxxx --db-instance-class db.m4.large --engine mysql --master-username myawsuser --master-user-password myawsuser http://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html
  • 20. IAM governed access You can use AWS Identity and Access Management (IAM) to control who can perform actions on RDS Users and DBA Applications DBA and Ops Your database RDS Controlled with IAM Controlled with database GRANTs
  • 22. Standard monitoring Amazon CloudWatch metrics for Amazon RDS l  CPU utilization l  Storage l  Memory l  Swap usage l  DB connections l  I/O (read and write) l  Latency (read and write) l  Throughput (read and write) l  Replica lag l  Many more Amazon CloudWatch Alarms l  Similar to on-premises custom monitoring tools (Nov’16) price drop, longer retention & percentile monitoring https://aws.amazon.com/about-aws/whats-new/2016/11/announcing-cloudwatch-metrics-price- reduction-and-new-volume-based-pricing-tiers/ https://aws.amazon.com/blogs/aws/amazon-cloudwatch-update-percentile-statistics-and-new- dashboard-widgets/ https://aws.amazon.com/about-aws/whats-new/2016/11/cloudwatch-extends-metrics-retention-and- new-user-interface/
  • 23. Enhanced Monitoring Access to over 50 new CPU, memory, file system, and disk I/O metrics " as low as 1 second intervals (sent to CloudWatch Logs) http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html
  • 24. Event notifications •  Uses Amazon Simple Notification Service (Amazon SNS) to notify users when an event occurs •  17 different event categories (availability, backup, configuration change, and so on)
  • 26. Minimal deployment—single AZ Availability Zone AWS Region 10.1.0.0/16 10.1.1.0/24 Amazon Elastic Block Store volume
  • 27. High availability—Multi-AZ Availability Zone A AWS Region 10.1.0.0/16 10.1.1.0/24 Availability Zone B 10.1.2.0/24 Synchronous replication Same instance type as master
  • 28. High availability—Multi-AZ to DNS dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
  • 29. High availability—Amazon Aurora storage •  Storage volume automatically grows up to 64 TB •  6 copies across 3 AZs •  Quorum system for read/write; " latency tolerant •  Peer-to-peer gossip replication to fill in holes •  Continuous backup to Amazon S3 " (built for 11 9s durability) •  Continuous monitoring of nodes " and disks for repair •  10 GB segments as unit of repair " or hotspot rebalance •  Quorum membership changes do not " stall writes AZ 1 AZ 2 AZ 3 Amazon S3
  • 30. High availability—Aurora •  Aurora cluster contains primary node and up to 15 secondary nodes (read-only) •  Failing nodes are automatically detected and replaced •  Failing database processes are automatically detected and recycled •  Secondary nodes automatically promoted on persistent outage, no single point of failure •  Customer application can scale out read traffic across secondary nodes AZ 1 AZ 3 AZ 2 Primary Node Primary Node Primary Node Primary Node Primary Node Secondary Node Primary Node Primary Node Secondary Node
  • 31. Failover – MySQL vs Aurora App Running Failure Detection DNS Propagation Recovery Recovery DB Failure MySQL App Running Failure Detection DNS Propagation Recovery DB Failure Aurora with MariaDB driver 1 5 - 3 0 s e c 5 - 2 0 s e c 1 5 - 3 0 s e c Driver benefits https://mariadb.com/kb/en/mariadb/failover-and-high-availability-with-mariadb-connector-j/ https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/
  • 32. Tips to improve recovery time with MySQL •  DO NOT use the IP address to connect to RDS! •  Set a low TTL on your own CNAME (beware if you use Java) •  Avoid large number of tables :  •  No more than 1000 tables using Standard Storage •  No more than 10,000 tables using Provisioned IOPS •  Avoid very large tables in your database •  Avoid large transactions •  Make sure you have enough IOPS for recovery •  Use RDS Events to be notified
  • 33. Simulating Amazon Aurora failures ALTER SYSTEM CRASH [ INSTANCE | DISPATCHER | NODE ]; ALTER SYSTEM SIMULATE percentage_of_failure PERCENT •  READ REPLICA FAILURE [ TO ALL | TO "replica name" ] •  DISK FAILURE [ IN DISK index | NODE index ] •  DISK CONGESTION BETWEEN minimum AND maximum MILLISECONDS [ IN DISK index | NODE index ] FOR INTERVAL quantity [ YEAR | QUARTER | MONTH | WEEK| DAY | HOUR | MINUTE | SECOND ]; http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html
  • 35. Read Replicas Bring data close to your customer’s applications in different regions Relieve pressure on your master node for supporting reads and writes Promote a Read Replica to a master for faster recovery in the event of disaster"
  • 36. Read Replicas Within a region •  MySQL •  MariaDB •  PostgreSQL •  Aurora Cross-region •  MySQL •  MariaDB •  PostgreSQL •  Aurora
  • 37. Read Replicas for Amazon Aurora AZ 1 AZ 3 AZ 2 Primary Node Primary Node Primary node AZ 1 AZ 1 Primary Node Primary Node Read Replica node AZ 1 Primary Node Primary Node Read Replica node
  • 38. Read Replicas—Oracle and SQL Server Options •  Oracle GoldenGate •  Third-party replication products •  Snapshots
  • 39. Scaling up—or down •  Handle higher load or lower usage •  Control costs
  • 40. Scaling up—or down AWS Management Console
  • 41. Scaling—single AZ With single AZ deployment, the master takes an outage dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
  • 42. Scaling—Multi-AZ With Multi-AZ, the standby gets upgraded first dbinstancename.1234567890.us-west-2.rds.amazonaws.com:3006
  • 43. Scaling on a schedule – CLI or AWS Lambda import boto3   client=boto3.client('rds')   def lambda_handler(event, context): response=client.modify_db_instance(DBInstanceIdentifier='sg-cli-test', DBInstanceClass='db.m4.xlarge', ApplyImmediately=True)   print response #Scale down at 8:00 PM on Friday 0 20 * * 5 /home/ec2-user/scripts/ scale_down_rds.sh #Scale up at 4:00 AM on Monday 0 4 * * 1 /home/ec2-user/scripts/ scale_up_rds.sh aws rds modify-db-instance --db-instance-identifier sg-cli-test --db-instance-class db.m4.large --apply-immediately
  • 44. Scaling on demand – Cloudwatch & AWS Lambda import boto3 import json   client=boto3.client('rds')   def lambda_handler(event, context): message = event['Records'][0]['Sns']['Message'] parsed_message=json.loads(message) db_instance=parsed_message['Trigger']['Dimensions'][0]['value'] print 'DB Instance: ' + db_instance response=client.modify_db_instance(DBInstanceIdentifier=db_instance, DBInstanceClass='db.m4.large', ApplyImmediately=True) print response SNS LambdaCloudwatchRDS
  • 46. Backups MySQL, PostgreSQL, MariaDB, Oracle, SQL Server •  Scheduled daily backup of entire instance •  Archive database change logs •  35 day retention for backups •  Multiple copies in each AZ where you have instances Aurora •  Automatic, continuous, incremental backups •  Point-in-time restore •  No impact on database performance •  35 day retention
  • 47. Restoring •  Restoring creates an entirely new database instance •  You define the instance configuration just like a new instance
  • 48. Snapshots •  Full copies of your Amazon RDS database that are different from your scheduled backups •  Backed by Amazon S3 •  Used to create a new RDS instance •  Remain encrypted if using encryption
  • 49. Snapshots Use cases •  Resolve production issues •  Build non-production environments •  Point-in-time restore •  Final copy before terminating a database •  Disaster recovery •  Cross-region copy •  Copy between accounts
  • 51. ü  Move data to the same or different database engine ü  Keep your apps running during the migration ü  Start your first migration in 10 minutes or less ü  Replicate within, to, or from Amazon EC2 or RDS AWS Database " Migration Service https://aws.amazon.com/dms/ http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.Sources.html http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.Targets.html https://aws.amazon.com/blogs/database/database-migration-what-do-you-need-to-know-before-you-start/
  • 52. Customer premises Application Users AWS Internet VPN Start a replication instance Connect to source and target database Select tables, schemas, or databases Let the AWS Database Migration Service create tables, load data, and keep them in sync Switch applications over to the target at your convenience Keep your apps running during the migration
  • 53. •  Move your tables, views, stored procedures, and data manipulation language (DML) to RDS or Amazon Redshift •  Highlight where manual edits are needed AWS Schema " Conversion Tool https://aws.amazon.com/dms/
  • 54. Julien Simon julsimon@amazon.fr @julsimon Your feedback is important to us!