SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
DAT303 - A Closer Look at Amazon RDS for Microsoft SQL Server
Deep Dive into Performance, Security, and Data Migration Best Practices
Sergei Sokolenko - Sr Product Manager, AWS
Allan Parsons - VP Operations, Viddy

November 13, 2013

Š 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
Next Hour …
• Best Practices
–
–
–
–

Security
Performance
Data Migration
Data Durability

• Viddy’s Case
Security Best Practices
Control Access

Internet

VPC

IAM
Encrypt Your Data
• “In transit” with SSL
– Import public Amazon RDS certificate into Windows
https://rds.amazonaws.com/doc/rds-ssl-ca-cert.pem
– Add "encrypt=true" to your connection string

• “At rest” with Transparent Data Encryption
– Encrypts data before writing to storage
– Decrypts when reading
Performance Best Practices
High Performance Relational Databases
Amazon RDS
Configuration

Increase
Throughput

Reduce
Latency

Push-Button Scaling
DB Shards
Provisioned IOPS

Push-Button Scaling

Database Shards

Provisioned IOPS
Push Button Scaling & Sharding
• Scale nodes vertically up or down
– M1.small (1 virtual core, 1.7GB)
– M2.4XLarge (8 virtual cores, 64GB)

• Scale out nodes horizontally
– Shard based on data or workload
characteristics
Production = Provisioned IOPS
Consistently fast performance

•
•
•
•

1 TB max instance size
10,000 Provisioned IOPS
I/O-Optimized instances
Check I/O blockers
–
–

Database contention
Locking
Data Migration Best Practices
Migrating Data to Amazon RDS
Bulk Migration

Replication +
Switchover

Import/Export
Wizard

Linked Servers

BCP Bulk Load

SSIS
One-time Bulk Migration

On Premise

AWS
Migration Code Snippets
-- Run SSMS’s “Generate and Publish Scripts” Wizard

Tables Only
Script USE DATABASE = False
Script Check Constraints = False
Script Foreign Keys = False
Script Primary Keys = False
Script Unique Keys = False

-- .BAT script for export BCP commands
SELECT 'bcp ' + db_name() + '..' + name + ' out “C:Data' + name + '.txt"
-E -n -S localhost –U usr –P pwd' FROM sysobjects WHERE type = 'U'
bcp dbname..table out “C:Datatable.txt” –E -n -S localhost -U usr -P pwd
-- .BAT script for import BCP commands
SELECT 'bcp ' + db_name() + '..' + name + ' in “C:Data' + name + '.txt"
-E -n –S RDSEndpoint –U usr –P pwd‘ from sysobjects where type = 'U‘
bcp dbname..table in “C:Datatable.txt” –E -n -S endpoint,port -U usr -P
pwd
More Info: Data Import Guide for SQL Server
Ongoing Replication with Switchover

Linked Server

SourceINST

TargetINST

On Premise

AWS
On Target Instance (Amazon RDS)
USE master;
CREATE LOGIN [repl_login] WITH PASSWORD=N'password01',
DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;
USE UserDB1;
CREATE USER [repl_user] FOR LOGIN [repl_login];
EXEC sp_addrolemember 'db_datareader', [repl_user];
EXEC sp_addrolemember 'db_datawriter', [repl_user];
-- Assume Source DB has a table “Customers”
CREATE TABLE StageCustomers ( CustomerID int, UpdatedDate
datetime );
On Source Instance (On-Premise)
USE master;
EXEC sp_addlinkedserver N'[TargetINST.amazonaws.com,port]', N'SQL Server';
CREATE LOGIN [repl_login] WITH PASSWORD=N'password02',
DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;
EXEC sp_addlinkedsrvlogin
@rmtsrvname = N'[TargetINST.amazonaws.com,port]', N'SQL Server',
@useself = 'FALSE', @locallogin = N'repl_login',
@rmtuser = N'repl_login', @rmtpassword = N'password01';

USE UserDB1;
INSERT INTO [TargetINST.amazonaws.com,port].UserDB1.dbo.StageCustomers
(CustomerID, UpdatedDate)
SELECT CustomerID,UpdatedDate FROM Customers WHERE UpdatedDate >=
DATEADD(DD,-2,GETDATE());
Data Durability Best Practices
Backups and Disaster Recovery
•

•

Automated Backups
 Nightly system snapshots + transaction backup
 Enables point-in-time restore to any point in
retention period
 Max retention period = 35 days
DB Snapshots
 User-driven snapshots of database
 Kept until explicitly deleted
Cross Region Snapshot Copy
AZ 1

AZ 1

Region 1

Region 2
Viddy’s Case
Scaling viddy.com on Amazon RDS for SQL Server
Allan Parsons, Viddy
Vision
To entertain and connect
people around the world by
empowering mobile users to
easily capture, beautify and
share amazing videos to
those who matter most.
Viddy By The Numbers
• Reach :: 41+ Million Registered Users
• Connections :: 250+ Million Users Connections
• Media :: 6.0+ Million Unique Videos
• CDN Assets (encoded videos + images)
• Videos :: 30+ Million Video Files
• Images :: 2+ Billion Image Files
• Human Power
• Executives & Support Staff :: 4
• Software Engineers :: 6
• DevOps Engineers :: 1
• Database Administrators :: 0
What Powers Viddy
We’re a Technology Agnostic Stack & Team

• Web / Front-End :: Windows / IIS (C# / .NET / MVC)
• Cache :: Linux / memcached (via Couchbase)
• Persistent Cache :: Linux / Redis (2x Master-Slave Environments)
• Source Control :: Team Foundation Server
• Continuous Integration & Build Automation :: Jenkins, Powershell, msbuild
• AWS & EC2 Tools
• VPCs :: 1 VPC/Environment (Production, QA, Dev)
• RDS :: 11 SQL Server Instances Housing 144 Databases (Production)
• SNS / SQS :: Used for Eventual Consistency
• Route53 & ELBs :: DNS and Load Balancing
• CloudWatch :: Monitoring & Trending
• CloudSearch :: Media, Tag, and User Searching
• S3 & CloudFront :: Asset Storage and Delivery
Early Technical Challenges
Wrong Cloud Ideology
• Inherited a PaaS Cloud Infrastructure
Difficulty in Caching Data
• Twitter-based Service Model
Underestimated Power of Facebook
• Open Graph drove 1MM+ User Registrations / 24H Period
Very Very Busy SQL Instance
• 1 Instance, 6 Databases
• Disabled Key Constraints to Improve Performance
• Too busy to get transactionally consistent backups

Inflexible Platform
• Adding machines would make inefficiencies worse
• On PaaS, more money != more scalability
Moving to AWS
Goal: PaaS to IaaS with Zero Downtime
VPC

SQL

• Guaranteed affinity between Web, Cache, SQL
• Low Latency
• Better security
• Tremendous cleanup effort
• 144 RDS shells & filled via ETL
• Engineered Eventual Consistency to Move Deltas

Build Automation
• Build Scripts dual-deployed to PaaS and IaaS
• Developers could build & test multiple times per hour on 2 providers
DNS
• Moved all zones to Route53 & Lowered TTLs
• Updated DNS entries Christmas Eve 2012 (low traffic)
RDS Eventual Consistency
Shards Based On UserID (GUID)
[1] :: API Servers Push Messages to Amazon SNS Topic
[2] :: Amazon SNS Distributes Message to SQS Queue
[3] :: Windows Service Monitors Queues
[4] :: Windows Service Pushes Message to Shard
Advantages
:: Can lose Windows Service, keep messages
:: Can lose DB Shard, keep messages
:: Easy to Scale!
+ more queues
+ more messages
= More Windows Services / EC2 Machines
Provisioning On RDS
Goal: As Hands Off As Possible (we don’t have a DBA)
SQL Edition
• SQL Server 2012 Standard (BizSpark)
Storage Allocation
• We took the max (1TB)
• Changing Storage = downtime
IOPS
• Busiest Instance (ViddyDB) has 7,000 provisioned IOPS
• Shards have no provisioned IOPS
• Occasional hotspots when celebrities post content
• Changing IOPS = downtime
Instance Size
• Busiest Instance (ViddyDB) has largest size (m2.4xlarge)
• Shards running (m2.2xlarge)
• Changing Instance Size = downtime
VPC Placement
• VPC guarantees node affinity (ours sit in private segment)
• Change VPC Placement = downtime
Designing for High Availability
Goal:
Easily & Quickly
Recover from Outage

Amazon RDS In VPCs
• At the time we provisioned (Nov-2012), no data replication across AZs
• Single point of failure is Availability Zone
• Running our own replication meant no RDS (and need a DBA)
• RDS didn’t force SQL Server’s AlwaysOn Technology
Sharded Model
• User exists in 1/64 Consumer Shards & 1/64 Producer Shards
• Database goes down: 1/64 users affected (1.5%)
• Instance goes down: 1/8 users affected (12.5%)
Eventual Consistency
• Amazon SNS/SQS Guarantees Eventual Consistency
• Visibility Timeout gives us time to get DB or Instance back online
• Sharded Amazon SQS = won’t affect other shards during downtime
Snapshots
• Set it and forget it
• Reliably works
• Allows us to regularly refresh non-prod DBs via scripts.
Security Considerations
The Basics
• Application config files use separate restricted accounts (not SA)
• DBs sit in private VPC segment
• Port restrictions done at Security Group Level
• Viddy HQ is whitelisted
• Developers can connect remotely over OpenVPN
• Support staff gets read-only DB access if they know SQL
The Facebook Security Model
• Every developer has access to everything (we’re a team of 7)
• Less friction, empowers developers
• With great privilege comes great responsibility
Questions?
Try Amazon RDS for SQL Server!
• Start using Transparent Data Encryption (TDE)
– See Amazon RDS for SQL Server documentation
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/

• Try Cross Region Snapshot Copy
Please give us your feedback on this
presentation

DAT303
As a thank you, we will select prize
winners daily for completed surveys!

Mais conteĂşdo relacionado

Mais procurados

Introducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle DatabaseIntroducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle Database
Jamie Kinney
 
Oracle on aws overview sep 2011
Oracle on aws overview   sep 2011Oracle on aws overview   sep 2011
Oracle on aws overview sep 2011
Jamie Kinney
 

Mais procurados (20)

WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
 
AWS Webcast - Amazon RDS for Oracle: Best Practices and Migration
AWS Webcast - Amazon RDS for Oracle: Best Practices and Migration  AWS Webcast - Amazon RDS for Oracle: Best Practices and Migration
AWS Webcast - Amazon RDS for Oracle: Best Practices and Migration
 
Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon RedshiftUses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift
 
Deep Dive: Amazon RDS
Deep Dive: Amazon RDSDeep Dive: Amazon RDS
Deep Dive: Amazon RDS
 
Getting Started with Amazon EC2 and Compute Services
Getting Started with Amazon EC2 and Compute ServicesGetting Started with Amazon EC2 and Compute Services
Getting Started with Amazon EC2 and Compute Services
 
What's New in Amazon RDS for Open Source and Commercial Databases
What's New in Amazon RDS for Open Source and Commercial DatabasesWhat's New in Amazon RDS for Open Source and Commercial Databases
What's New in Amazon RDS for Open Source and Commercial Databases
 
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...
 
How to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWSHow to Scale to Millions of Users with AWS
How to Scale to Millions of Users with AWS
 
Amazon rds
Amazon rdsAmazon rds
Amazon rds
 
Startup Showcase - Mojang
Startup Showcase - MojangStartup Showcase - Mojang
Startup Showcase - Mojang
 
AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)
 
Day 3 - AWS MySQL Relational Database Service Best Practices for Performance ...
Day 3 - AWS MySQL Relational Database Service Best Practices for Performance ...Day 3 - AWS MySQL Relational Database Service Best Practices for Performance ...
Day 3 - AWS MySQL Relational Database Service Best Practices for Performance ...
 
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
 
Day 2 - Amazon RDS - Letting AWS run your Low Admin, High Performance Database
Day 2 - Amazon RDS - Letting AWS run your Low Admin, High Performance DatabaseDay 2 - Amazon RDS - Letting AWS run your Low Admin, High Performance Database
Day 2 - Amazon RDS - Letting AWS run your Low Admin, High Performance Database
 
Introduction to Database Services
Introduction to Database ServicesIntroduction to Database Services
Introduction to Database Services
 
Migrating Your SQL Server Databases to Amazon RDS - DAT312 - re:Invent 2017
Migrating Your SQL Server Databases to Amazon RDS - DAT312 - re:Invent 2017Migrating Your SQL Server Databases to Amazon RDS - DAT312 - re:Invent 2017
Migrating Your SQL Server Databases to Amazon RDS - DAT312 - re:Invent 2017
 
AWS Webcast - Migrating to RDS Oracle
AWS Webcast - Migrating to RDS OracleAWS Webcast - Migrating to RDS Oracle
AWS Webcast - Migrating to RDS Oracle
 
Introducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle DatabaseIntroducing Amazon RDS Using Oracle Database
Introducing Amazon RDS Using Oracle Database
 
Oracle on aws overview sep 2011
Oracle on aws overview   sep 2011Oracle on aws overview   sep 2011
Oracle on aws overview sep 2011
 
Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum Efficiency
Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum EfficiencyDeploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum Efficiency
Deploying a Disaster Recovery Site on AWS: Minimal Cost with Maximum Efficiency
 

Destaque

AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
Amazon Web Services
 

Destaque (20)

How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages How to call REST API without knowing any programming languages
How to call REST API without knowing any programming languages
 
Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift
 
AWS Empowering Digital Marketing - September 2013
AWS Empowering Digital Marketing - September 2013AWS Empowering Digital Marketing - September 2013
AWS Empowering Digital Marketing - September 2013
 
Deploy, Manage & Scale Your Apps with Elastic Beanstalk
Deploy, Manage & Scale Your Apps with Elastic BeanstalkDeploy, Manage & Scale Your Apps with Elastic Beanstalk
Deploy, Manage & Scale Your Apps with Elastic Beanstalk
 
AWS Webcast - Launch & Learn: Amazon EC2 for Microsoft Windows Server
AWS Webcast - Launch & Learn: Amazon EC2 for Microsoft Windows ServerAWS Webcast - Launch & Learn: Amazon EC2 for Microsoft Windows Server
AWS Webcast - Launch & Learn: Amazon EC2 for Microsoft Windows Server
 
Next Generation of Storage Sydney Customer Appreciation Day
Next Generation of Storage Sydney Customer Appreciation DayNext Generation of Storage Sydney Customer Appreciation Day
Next Generation of Storage Sydney Customer Appreciation Day
 
AWS Summit 2013 | India - Running High Churn Development & Test Environments,...
AWS Summit 2013 | India - Running High Churn Development & Test Environments,...AWS Summit 2013 | India - Running High Churn Development & Test Environments,...
AWS Summit 2013 | India - Running High Churn Development & Test Environments,...
 
Best Practices in Architecting for the Cloud Webinar - Jinesh Varia
Best Practices in Architecting for the Cloud Webinar - Jinesh VariaBest Practices in Architecting for the Cloud Webinar - Jinesh Varia
Best Practices in Architecting for the Cloud Webinar - Jinesh Varia
 
Architecting Enterprise Applications In The Cloud
Architecting Enterprise Applications In The CloudArchitecting Enterprise Applications In The Cloud
Architecting Enterprise Applications In The Cloud
 
AWS for Start-ups - Case Study - Go Squared
AWS for Start-ups - Case Study - Go SquaredAWS for Start-ups - Case Study - Go Squared
AWS for Start-ups - Case Study - Go Squared
 
The Value of Certified AWS Experts to Your Business
The Value of Certified AWS Experts to Your BusinessThe Value of Certified AWS Experts to Your Business
The Value of Certified AWS Experts to Your Business
 
AWSome Day Jakarta - Opening Keynote
AWSome Day Jakarta - Opening KeynoteAWSome Day Jakarta - Opening Keynote
AWSome Day Jakarta - Opening Keynote
 
Health Solutions at the Edge: Mobile and IoT for Life Sciences | AWS Public S...
Health Solutions at the Edge: Mobile and IoT for Life Sciences | AWS Public S...Health Solutions at the Edge: Mobile and IoT for Life Sciences | AWS Public S...
Health Solutions at the Edge: Mobile and IoT for Life Sciences | AWS Public S...
 
Accelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWSAccelerating DevOps Pipelines with AWS
Accelerating DevOps Pipelines with AWS
 
AWS July Webinar Series - Getting Started with Amazon DynamoDB
AWS July Webinar Series - Getting Started with Amazon DynamoDBAWS July Webinar Series - Getting Started with Amazon DynamoDB
AWS July Webinar Series - Getting Started with Amazon DynamoDB
 
Delivering High Performance Content
Delivering High Performance ContentDelivering High Performance Content
Delivering High Performance Content
 
AWS Partner Presentation - Sonian
AWS Partner Presentation - SonianAWS Partner Presentation - Sonian
AWS Partner Presentation - Sonian
 
Un backend: pour tous vos objets connectĂŠs
Un backend: pour tous vos objets connectĂŠsUn backend: pour tous vos objets connectĂŠs
Un backend: pour tous vos objets connectĂŠs
 
AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
AWS Enterprise Summit London | Relaxing on Sunday Mornings with the Sunday Ti...
 
(SOV208) Amazon WorkSpaces and Amazon Zocalo | AWS re:Invent 2014
(SOV208) Amazon WorkSpaces and Amazon Zocalo | AWS re:Invent 2014(SOV208) Amazon WorkSpaces and Amazon Zocalo | AWS re:Invent 2014
(SOV208) Amazon WorkSpaces and Amazon Zocalo | AWS re:Invent 2014
 

Semelhante a Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) | AWS re:Invent 2013

So you think you are an aws ninja dean samuels
So you think you are an aws ninja   dean samuelsSo you think you are an aws ninja   dean samuels
So you think you are an aws ninja dean samuels
Amazon Web Services
 

Semelhante a Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) | AWS re:Invent 2013 (20)

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
 
Microsoft SQL Server Dive Deep.pdf
Microsoft SQL Server Dive Deep.pdfMicrosoft SQL Server Dive Deep.pdf
Microsoft SQL Server Dive Deep.pdf
 
PASS 17: RDS SQL Server on Amazon Web Services Overview
PASS 17: RDS SQL Server on Amazon Web Services OverviewPASS 17: RDS SQL Server on Amazon Web Services Overview
PASS 17: RDS SQL Server on Amazon Web Services Overview
 
Deep Dive on Amazon RDS
Deep Dive on Amazon RDSDeep Dive on Amazon RDS
Deep Dive on Amazon RDS
 
AWS Black Belt Tips
AWS Black Belt TipsAWS Black Belt Tips
AWS Black Belt Tips
 
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
 
Migrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceMigrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration 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 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)
 
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)
 
Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud Accelerate SQL Server Migration to the AWS Cloud
Accelerate SQL Server Migration to the AWS Cloud
 
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...
 
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
 
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
 
Running SQL Server on AWS | John McCormack | DataGrillen 2019
Running SQL Server on AWS | John McCormack | DataGrillen 2019Running SQL Server on AWS | John McCormack | DataGrillen 2019
Running SQL Server on AWS | John McCormack | DataGrillen 2019
 
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 WorkSpaces - Fully Managed Desktops in the Cloud
Amazon WorkSpaces - Fully Managed Desktops in the CloudAmazon WorkSpaces - Fully Managed Desktops in the Cloud
Amazon WorkSpaces - Fully Managed Desktops in the Cloud
 
2017 AWS DB Day | Amazon Database Migration Service (DMS) 소개 및 실습
2017 AWS DB Day | Amazon Database Migration Service (DMS) 소개 및 실습2017 AWS DB Day | Amazon Database Migration Service (DMS) 소개 및 실습
2017 AWS DB Day | Amazon Database Migration Service (DMS) 소개 및 실습
 
So you think you are an aws ninja dean samuels
So you think you are an aws ninja   dean samuelsSo you think you are an aws ninja   dean samuels
So you think you are an aws ninja dean samuels
 
數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣數據庫遷移到雲端的成功秘訣
數據庫遷移到雲端的成功秘訣
 

Mais de 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
 

Mais de 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
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) | AWS re:Invent 2013

  • 1. DAT303 - A Closer Look at Amazon RDS for Microsoft SQL Server Deep Dive into Performance, Security, and Data Migration Best Practices Sergei Sokolenko - Sr Product Manager, AWS Allan Parsons - VP Operations, Viddy November 13, 2013 Š 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. Next Hour … • Best Practices – – – – Security Performance Data Migration Data Durability • Viddy’s Case
  • 5. Encrypt Your Data • “In transit” with SSL – Import public Amazon RDS certificate into Windows https://rds.amazonaws.com/doc/rds-ssl-ca-cert.pem – Add "encrypt=true" to your connection string • “At rest” with Transparent Data Encryption – Encrypts data before writing to storage – Decrypts when reading
  • 6.
  • 8. High Performance Relational Databases Amazon RDS Configuration Increase Throughput Reduce Latency Push-Button Scaling DB Shards Provisioned IOPS Push-Button Scaling Database Shards Provisioned IOPS
  • 9. Push Button Scaling & Sharding • Scale nodes vertically up or down – M1.small (1 virtual core, 1.7GB) – M2.4XLarge (8 virtual cores, 64GB) • Scale out nodes horizontally – Shard based on data or workload characteristics
  • 10. Production = Provisioned IOPS Consistently fast performance • • • • 1 TB max instance size 10,000 Provisioned IOPS I/O-Optimized instances Check I/O blockers – – Database contention Locking
  • 11. Data Migration Best Practices
  • 12. Migrating Data to Amazon RDS Bulk Migration Replication + Switchover Import/Export Wizard Linked Servers BCP Bulk Load SSIS
  • 14. Migration Code Snippets -- Run SSMS’s “Generate and Publish Scripts” Wizard Tables Only Script USE DATABASE = False Script Check Constraints = False Script Foreign Keys = False Script Primary Keys = False Script Unique Keys = False -- .BAT script for export BCP commands SELECT 'bcp ' + db_name() + '..' + name + ' out “C:Data' + name + '.txt" -E -n -S localhost –U usr –P pwd' FROM sysobjects WHERE type = 'U' bcp dbname..table out “C:Datatable.txt” –E -n -S localhost -U usr -P pwd -- .BAT script for import BCP commands SELECT 'bcp ' + db_name() + '..' + name + ' in “C:Data' + name + '.txt" -E -n –S RDSEndpoint –U usr –P pwd‘ from sysobjects where type = 'U‘ bcp dbname..table in “C:Datatable.txt” –E -n -S endpoint,port -U usr -P pwd More Info: Data Import Guide for SQL Server
  • 15. Ongoing Replication with Switchover Linked Server SourceINST TargetINST On Premise AWS
  • 16. On Target Instance (Amazon RDS) USE master; CREATE LOGIN [repl_login] WITH PASSWORD=N'password01', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; USE UserDB1; CREATE USER [repl_user] FOR LOGIN [repl_login]; EXEC sp_addrolemember 'db_datareader', [repl_user]; EXEC sp_addrolemember 'db_datawriter', [repl_user]; -- Assume Source DB has a table “Customers” CREATE TABLE StageCustomers ( CustomerID int, UpdatedDate datetime );
  • 17. On Source Instance (On-Premise) USE master; EXEC sp_addlinkedserver N'[TargetINST.amazonaws.com,port]', N'SQL Server'; CREATE LOGIN [repl_login] WITH PASSWORD=N'password02', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; EXEC sp_addlinkedsrvlogin @rmtsrvname = N'[TargetINST.amazonaws.com,port]', N'SQL Server', @useself = 'FALSE', @locallogin = N'repl_login', @rmtuser = N'repl_login', @rmtpassword = N'password01'; USE UserDB1; INSERT INTO [TargetINST.amazonaws.com,port].UserDB1.dbo.StageCustomers (CustomerID, UpdatedDate) SELECT CustomerID,UpdatedDate FROM Customers WHERE UpdatedDate >= DATEADD(DD,-2,GETDATE());
  • 18. Data Durability Best Practices
  • 19. Backups and Disaster Recovery • • Automated Backups  Nightly system snapshots + transaction backup  Enables point-in-time restore to any point in retention period  Max retention period = 35 days DB Snapshots  User-driven snapshots of database  Kept until explicitly deleted
  • 20. Cross Region Snapshot Copy AZ 1 AZ 1 Region 1 Region 2
  • 21. Viddy’s Case Scaling viddy.com on Amazon RDS for SQL Server Allan Parsons, Viddy
  • 22. Vision To entertain and connect people around the world by empowering mobile users to easily capture, beautify and share amazing videos to those who matter most.
  • 23. Viddy By The Numbers • Reach :: 41+ Million Registered Users • Connections :: 250+ Million Users Connections • Media :: 6.0+ Million Unique Videos • CDN Assets (encoded videos + images) • Videos :: 30+ Million Video Files • Images :: 2+ Billion Image Files • Human Power • Executives & Support Staff :: 4 • Software Engineers :: 6 • DevOps Engineers :: 1 • Database Administrators :: 0
  • 24.
  • 25. What Powers Viddy We’re a Technology Agnostic Stack & Team • Web / Front-End :: Windows / IIS (C# / .NET / MVC) • Cache :: Linux / memcached (via Couchbase) • Persistent Cache :: Linux / Redis (2x Master-Slave Environments) • Source Control :: Team Foundation Server • Continuous Integration & Build Automation :: Jenkins, Powershell, msbuild • AWS & EC2 Tools • VPCs :: 1 VPC/Environment (Production, QA, Dev) • RDS :: 11 SQL Server Instances Housing 144 Databases (Production) • SNS / SQS :: Used for Eventual Consistency • Route53 & ELBs :: DNS and Load Balancing • CloudWatch :: Monitoring & Trending • CloudSearch :: Media, Tag, and User Searching • S3 & CloudFront :: Asset Storage and Delivery
  • 26. Early Technical Challenges Wrong Cloud Ideology • Inherited a PaaS Cloud Infrastructure Difficulty in Caching Data • Twitter-based Service Model Underestimated Power of Facebook • Open Graph drove 1MM+ User Registrations / 24H Period Very Very Busy SQL Instance • 1 Instance, 6 Databases • Disabled Key Constraints to Improve Performance • Too busy to get transactionally consistent backups Inflexible Platform • Adding machines would make inefficiencies worse • On PaaS, more money != more scalability
  • 27. Moving to AWS Goal: PaaS to IaaS with Zero Downtime VPC SQL • Guaranteed affinity between Web, Cache, SQL • Low Latency • Better security • Tremendous cleanup effort • 144 RDS shells & filled via ETL • Engineered Eventual Consistency to Move Deltas Build Automation • Build Scripts dual-deployed to PaaS and IaaS • Developers could build & test multiple times per hour on 2 providers DNS • Moved all zones to Route53 & Lowered TTLs • Updated DNS entries Christmas Eve 2012 (low traffic)
  • 28. RDS Eventual Consistency Shards Based On UserID (GUID) [1] :: API Servers Push Messages to Amazon SNS Topic [2] :: Amazon SNS Distributes Message to SQS Queue [3] :: Windows Service Monitors Queues [4] :: Windows Service Pushes Message to Shard Advantages :: Can lose Windows Service, keep messages :: Can lose DB Shard, keep messages :: Easy to Scale! + more queues + more messages = More Windows Services / EC2 Machines
  • 29. Provisioning On RDS Goal: As Hands Off As Possible (we don’t have a DBA) SQL Edition • SQL Server 2012 Standard (BizSpark) Storage Allocation • We took the max (1TB) • Changing Storage = downtime IOPS • Busiest Instance (ViddyDB) has 7,000 provisioned IOPS • Shards have no provisioned IOPS • Occasional hotspots when celebrities post content • Changing IOPS = downtime Instance Size • Busiest Instance (ViddyDB) has largest size (m2.4xlarge) • Shards running (m2.2xlarge) • Changing Instance Size = downtime VPC Placement • VPC guarantees node affinity (ours sit in private segment) • Change VPC Placement = downtime
  • 30. Designing for High Availability Goal: Easily & Quickly Recover from Outage Amazon RDS In VPCs • At the time we provisioned (Nov-2012), no data replication across AZs • Single point of failure is Availability Zone • Running our own replication meant no RDS (and need a DBA) • RDS didn’t force SQL Server’s AlwaysOn Technology Sharded Model • User exists in 1/64 Consumer Shards & 1/64 Producer Shards • Database goes down: 1/64 users affected (1.5%) • Instance goes down: 1/8 users affected (12.5%) Eventual Consistency • Amazon SNS/SQS Guarantees Eventual Consistency • Visibility Timeout gives us time to get DB or Instance back online • Sharded Amazon SQS = won’t affect other shards during downtime Snapshots • Set it and forget it • Reliably works • Allows us to regularly refresh non-prod DBs via scripts.
  • 31. Security Considerations The Basics • Application config files use separate restricted accounts (not SA) • DBs sit in private VPC segment • Port restrictions done at Security Group Level • Viddy HQ is whitelisted • Developers can connect remotely over OpenVPN • Support staff gets read-only DB access if they know SQL The Facebook Security Model • Every developer has access to everything (we’re a team of 7) • Less friction, empowers developers • With great privilege comes great responsibility
  • 33. Try Amazon RDS for SQL Server! • Start using Transparent Data Encryption (TDE) – See Amazon RDS for SQL Server documentation http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/ • Try Cross Region Snapshot Copy
  • 34. Please give us your feedback on this presentation DAT303 As a thank you, we will select prize winners daily for completed surveys!