© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Baris Furtinalar
Microsoft Specialist Solutions Architect
AWS
Best Practices for Running Microsoft
SQL Server on AWS
Gianluca Hotz
Microsoft SQL Server MVP
UGISS
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Agenda
• Where can I run SQL Server on AWS?
• Amazon RDS for SQL Server
• Optimizing Performance for SQL Server on EC2
• High Availability Best Practices for SQL Servers on AWS
• Migrating SQL Server to EC2
• Q&A
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Where can I run my SQL Server workloads on AWS?
Amazon Relational Database Service
(Amazon RDS)
Managed service with up to 128 vCPU, 4TBRAM, and 16 TB storage
Amazon Elastic Compute Cloud
(Amazon EC2)
Self-managed virtual machine with up to 448 vCPU, 24TB RAM, and 400-TB storage
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon RDS for SQL Server SQL Server on Amazon EC2
Customer managed
AWS managed
Power, HVAC, net
OS Install/Maintenance
OS Patching
DBMS Install/Maintenance
DBMS Patching
Database Backups
High Availability
Scaling
Power, HVAC, net
OS Install/Maintenance
OS Patching
DBMS Install/Maintenance
DBMS Patching
Database Backups
High Availability
Scaling
• Consider RDS first
• Focus on business
value tasks
• High-level tuning asks
• Schema optimization
• No in-house database
expertise
• Need full control over
DB instance
• Backups
• Replication
• Clustering
• Options that are not
available in RDS
Options for Deploying SQL Server on AWS
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL Server Features at a Glance
2012 – 2019
Versions Supported:
Editions Supported:
High Availability:
Encryption:
Authentication:
Backups:
Maintenance:
Express, Web, Standard, Enterprise
All
All
AWS-managed
TDE, Column-level, Always Encrypted, TLS, EBS encryption
Self-managed; AlwaysOn, Mirroring…
Windows & SQL Authentication
AWS- managed Self-managed
AWS- managed Self-managed
Amazon RDS Amazon EC2
BI Stack: SSIS, SSRS, SSAS (tabular) All
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon RDS with SQL Server
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon RDS: Hassle-free flexibility
• Instance type selection:
• t3 instances for lower cost
• m5/m5d instances
• r5/z1d/x1e instances for more RAM
• EBS volume type selection:
• GP2 volumes for lower cost
• IO1 volumes for I/O intensive, critical workloads
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Compute and Storage Scaling
Scale Compute to
Handle Increased Load
Up to 128 vCPUs
4TiB of RAM
Scale Storage for
Larger Data Sets
Scalable EBS storage up to 16TiB
Scale Down to
Control Costs
As little as 4 vCPU and
16 GiB of RAM
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Automated backups, Snapshots and Native Backups
• Backup and restore directly to and from S3 bucket
• Supports Compression
• Only full & diff backups (no t-log)
• Full, diff & t-log restores
• Multi-file backup/restore
Amazon
RDS SQL Server
Amazon
S3
IAM
SQL Server
*.bak
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon RDS Multi-AZ SQL Server
Region A
VPC
Availability Zone 1 Availability Zone 2
Private subnet Private subnet
Synchronous commit
Automatic failover
Amazon
RDS
primary
Amazon
RDS
secondary
• Always On AG (Basic AG for Standard) for 2016,
2017 & 2019
• DB Mirroring for 2012 and 2014
• Synchronous Secondary hot stand-by
• Automatic & Manual Failover
• No read traffic
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Read scale-out with Amazon RDS
• 2016+ Enterprise Edition feature
• Up to 5 asynchronous read replicas
• In-region
• Promotion
• Separate end-point
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon RDS Enhanced Monitoring
Overview:
• OS Level Monitoring Metrics – 26 system and per process
metrics
• Metrics delivered to CloudWatch Logs
• Up to 1 second granularity
Compared to CloudWatch Metrics:
• Agent based metrics collections
• There can be differences with CloudWatch metrics due to
collection source (hypervisor vs. agent) – eg. CPU
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Performance Insights for RDS SQL Server
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL Server on Amazon EC2
SQL Server
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL Server on Amazon EC2
• How to start
Spin up an EC2 instance and install from customer media (BYOL)
Spin up an EC2 instance that includes SQL in the Amazon Machine Instance (AMI)
• Self-Managed SQL Server
• Security, patching & updates
• Backups
• High Availability
• Full SQL Server sysadmin privileges
SQL Server
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Optimizing Performance for SQL
Server on EC2
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon EC2: Purpose-built computing
Current instance families and generation Family/usage
M5, M5a, M5zn General purpose compute
T2, T3 Burstable performance
C5, C5n, C5a,C4 Compute optimized
X1, X1E, R5, R5d, R5a, Z1d Memory optimized
P2, G3, F1 Accelerated computing
I3, I3en
Storage optimized
(I/O)
H1, D2
Storage optimized
(Density)
(4.5GHz)
(4.0GHz)
© 2021, Amazon Web Services, Inc. or its Affiliates.
16,000
Get the maximum EBS performance on Amazon EC2
GP3
General Purpose SSD
99.8% - 99.9%
1 GiB - 16 TiB
16,000
1,000 MiB/s
Max IOPS
per volume
(16 KiB I/O)
Max throughput
per volume
Amazon EC2
Max EBS Bandwidth 10,000Mbps
Maximum IOPS 43,333
R5b.4xlarge
16,000
GP3
Durability
Size (Min-Max)
Total IOPS=32,000
© 2021, Amazon Web Services, Inc. or its Affiliates.
64,000
Get the maximum EBS performance on Amazon EC2
IO2
Provisioned IOPS SSD
99.999 %
4 GiB - 16 TiB
64,000
1,000 MiB/s
Max IOPS
per volume
(16 KiB I/O)
Max throughput
per volume
64,000
IO2
Durability
Size (Min-Max)
Total IOPS=128,000
Amazon EC2
Max EBS Bandwidth 30,000Mbps
Maximum IOPS 130,000
R5b.12xlarge
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Amazon EBS io2 Block Express Volumes
IO2 Block Express IO2 Block Express
• 256.000 IOPS per volume
• 4000 MB/s throughput per vikume
• 64 TiB per volume
• 99.999% durability
• Available with Amazon EC2 R5b instances
• Supports standard io2 features
© 2021, Amazon Web Services, Inc. or its Affiliates.
Place tempdb in EC2 Instance Store
Amazon EC2
What is instance storage?
• Some instance types come with direct attached disk-based storage
• SSD
• NVMe SSD
• Included in the hourly cost
• Data on instance storage does not persist a user- initiated instance
stop/start or hardware failure
• Fast disk I/O without going over the network
• Traffic does not count towards EBS IOPS
z1d.12xlarge
2 x 900 NVMe SSD
© 2021, Amazon Web Services, Inc. or its Affiliates.
Place tempdb in EC2 Instance Store
Amazon EC2
What is instance storage?
• Some instance types come with direct attached disk-based storage
• SSD
• NVMe SSD
• Included in the hourly cost
• Data on instance storage does not persist a user- initiated instance
stop/start or hardware failure
• Fast disk I/O without going over the network
• Traffic does not count towards EBS IOPS
z1d.12xlarge
2 x 900 NVMe SSD
Disk Mirroring
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Region
Amazon FSx
for Windows File Server
fs-0123456789.example.com
Amazon FSx for Windows File Server Amazon FSx for Windows File
Server
SQL DB
instance
CREATE DATABASE [DBonFSx] ON PRIMARY ( name = N’DBonFSx_data’,
filename = N’fs-0123456789.example.comDBDBonFSx_data.mdf’,
size = 8192kb, maxsize = unlimited,filegrowth = 1024kb )
log ON ( name = N'DBonFSx_log’,
filename =N‘fs-0123456789.example.comDBDBonFSx_log.ldf’,
size = 1024kb, maxsize = 2048gb, filegrowth = 10%)
GO
© 2021, Amazon Web Services, Inc. or its Affiliates.
Optimize your disk layout or file distribution
Data Files
Log Files
Tempdb Data Files
Tempdb Log Files
Backup Files
Random Access
Sequential Access
Random Access
Sequential Access
Sequential Access
.mdf .ndf .ndf
.ldf .ldf .ldf
.mdf .ndf .ndf
.ldf .ldf .ldf
.bak
© 2021, Amazon Web Services, Inc. or its Affiliates.
Optimize your disk layout or file distribution
GP3/IO2
GP3/IO2
GP3/IO2
Amazon EC2 Instance
SQL Server
Amazon EBS File distribution
ST1/SC1
Database
File Group
bak/trn
Instance Store Volumes
SQL Data Files
Tran. Log Files
Backup Files
TempDB
Data/Log Files
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
High Availability Best Practices for
SQL Server on EC2
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL Server HA/DR on EC2
• Windows clusters can span Availability Zones or regions
• Mirroring
• AlwaysOn Availability Groups
• Transaction Log Shipping
• SQL Failover Cluster Instance
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Always On AG
Multi-AZ Always On Availability Group
• SQL Server:
• Database-level HA solution
• Manual adding logins, SQL Agent jobs,
certificates and other SQL Server instance
level objects to all secondary
• Data/Transactions replicated through SQL
Server
• Infrastructure:
• Shared-nothing configuration
• Storage configured and managed outside
of WSFC
• Flexibility and granularity of storage
configuration and maintenance
• Limited SQL resources managed by WSFC
AWS Cloud
VPC
Private subnet Private subnet Private subnet
Availability Zone A Availability Zone B Availability Zone C
Private subnet
Active
Directory
DC1
Private subnet
Active
Directory
DC2
File Share
Witness
1st SQL
Replica
2nd SQL
Replica
Sync Mode Auto
Failover
10.0.10.0/24 10.0.20.0/24 10.0.30.0/24
10.0.40.0/24 10.0.50.0/24
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Always On AG
Multi-AZ Always On Availability Group
• Best Practices:
• Multi AZ setup
• Use File Share Witness
• MultiSubnetFailover = Yes
• Connect to Listener
• RegisterAllProvidersIP = Yes
• Change default HostRecordTTL
• SQL Native Client Providers
AWS Cloud
VPC
Private subnet Private subnet Private subnet
Availability Zone A Availability Zone B Availability Zone C
Private subnet
Active
Directory
DC1
Private subnet
Active
Directory
DC2
File Share
Witness
1st SQL
Replica
2nd SQL
Replica
Sync Mode
Auto Failover
10.0.10.0/24 10.0.20.0/24 10.0.30.0/24
10.0.40.0/24 10.0.50.0/24
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Always On AG
Multi-Region Always On Availability Group
AWS Cloud
VPC
Private subnet Private subnet Private subnet
Availability Zone A Availability Zone B Availability Zone C
Private subnet
Active
Directory
DC1
Private subnet
Active
Directory
DC2
File Share
Witness
1st SQL
Replica
2nd SQL
Replica
Sync Mode
Auto Failover
10.0.10.0/24 10.0.20.0/24 10.0.30.0/24
10.0.40.0/24 10.0.50.0/24
AWS Cloud
VPC
Private subnet
Availability Zone A
Private subnet
Active
Directory
DC3
3rd SQL
Replica
10.1.10.0/24
10.1.20.0/24
Async Mode
Manual Failover
Peering
connection
AWS Transit Gateway
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL FCI with Amazon FSx for Windows File Server
AWS Cloud
VPC
Availability Zone A Availability Zone B
Private subnet
Active
Directory
DC1
Private subnet
Active
Directory
DC2
10.0.30.0/24 10.0.40.0/24
Shared Storage
Private subnet Private subnet
1st SQL
Node
2nd SQL
Node
10.0.10.0/24 10.0.20.0/24
Amazon
FSx
Amazon
FSx
• SQL Server:
• Instance-level HA solution
• Logins, SQL Agent jobs, certificates and other SQL
Server instance level objects are in-tact after
failover
• Infrastructure:
• Clustered disk resource via SMB and continuously
available shares (CAFS)
• AWS managed SMB file system
• Storage and Network traffic using the same network
pipe
• Managed storage configuration and maintenance
• Very limited control over file system configuration
(e.g. 4k vs. 64k allocation unit)
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
SQL FCI with Amazon FSx for NetApp ONTAP
AWS Cloud
VPC
Availability Zone A Availability Zone B
Private subnet Private subnet
1st SQL
Node
2nd SQL
Node
10.0.10.0/24 10.0.20.0/24
iSCSI/SMB
Primary Standby
• Amazon FSx for NetApp ONTAP includes all of
ONTAP’s storage efficiency and cost-savings features
• High-performance SSD storage
• NetApp ONTAP offers multiple throughput capacity
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Migrating SQL Server to AWS
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
Backup & Restore
SQL Server’s native backup functionality
AWS Database Migration Service
Minimize downtime during migrations, migrate between
different DB platforms
1
3
2
SQL Always On Availability Group
Asynchronous-commit mode, distributed AGs (SQL
Server 2016+)
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
SQL SERVER ON AWS
migrations@amazon.com
Thank you

Best Practices for Running Microsoft SQL Server on AWS

  • 1.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Baris Furtinalar Microsoft Specialist Solutions Architect AWS Best Practices for Running Microsoft SQL Server on AWS Gianluca Hotz Microsoft SQL Server MVP UGISS
  • 2.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Agenda • Where can I run SQL Server on AWS? • Amazon RDS for SQL Server • Optimizing Performance for SQL Server on EC2 • High Availability Best Practices for SQL Servers on AWS • Migrating SQL Server to EC2 • Q&A
  • 3.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Where can I run my SQL Server workloads on AWS? Amazon Relational Database Service (Amazon RDS) Managed service with up to 128 vCPU, 4TBRAM, and 16 TB storage Amazon Elastic Compute Cloud (Amazon EC2) Self-managed virtual machine with up to 448 vCPU, 24TB RAM, and 400-TB storage
  • 4.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon RDS for SQL Server SQL Server on Amazon EC2 Customer managed AWS managed Power, HVAC, net OS Install/Maintenance OS Patching DBMS Install/Maintenance DBMS Patching Database Backups High Availability Scaling Power, HVAC, net OS Install/Maintenance OS Patching DBMS Install/Maintenance DBMS Patching Database Backups High Availability Scaling • Consider RDS first • Focus on business value tasks • High-level tuning asks • Schema optimization • No in-house database expertise • Need full control over DB instance • Backups • Replication • Clustering • Options that are not available in RDS Options for Deploying SQL Server on AWS
  • 5.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL Server Features at a Glance 2012 – 2019 Versions Supported: Editions Supported: High Availability: Encryption: Authentication: Backups: Maintenance: Express, Web, Standard, Enterprise All All AWS-managed TDE, Column-level, Always Encrypted, TLS, EBS encryption Self-managed; AlwaysOn, Mirroring… Windows & SQL Authentication AWS- managed Self-managed AWS- managed Self-managed Amazon RDS Amazon EC2 BI Stack: SSIS, SSRS, SSAS (tabular) All
  • 6.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon RDS with SQL Server
  • 7.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon RDS: Hassle-free flexibility • Instance type selection: • t3 instances for lower cost • m5/m5d instances • r5/z1d/x1e instances for more RAM • EBS volume type selection: • GP2 volumes for lower cost • IO1 volumes for I/O intensive, critical workloads
  • 8.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Compute and Storage Scaling Scale Compute to Handle Increased Load Up to 128 vCPUs 4TiB of RAM Scale Storage for Larger Data Sets Scalable EBS storage up to 16TiB Scale Down to Control Costs As little as 4 vCPU and 16 GiB of RAM
  • 9.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Automated backups, Snapshots and Native Backups • Backup and restore directly to and from S3 bucket • Supports Compression • Only full & diff backups (no t-log) • Full, diff & t-log restores • Multi-file backup/restore Amazon RDS SQL Server Amazon S3 IAM SQL Server *.bak
  • 10.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon RDS Multi-AZ SQL Server Region A VPC Availability Zone 1 Availability Zone 2 Private subnet Private subnet Synchronous commit Automatic failover Amazon RDS primary Amazon RDS secondary • Always On AG (Basic AG for Standard) for 2016, 2017 & 2019 • DB Mirroring for 2012 and 2014 • Synchronous Secondary hot stand-by • Automatic & Manual Failover • No read traffic
  • 11.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Read scale-out with Amazon RDS • 2016+ Enterprise Edition feature • Up to 5 asynchronous read replicas • In-region • Promotion • Separate end-point
  • 12.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon RDS Enhanced Monitoring Overview: • OS Level Monitoring Metrics – 26 system and per process metrics • Metrics delivered to CloudWatch Logs • Up to 1 second granularity Compared to CloudWatch Metrics: • Agent based metrics collections • There can be differences with CloudWatch metrics due to collection source (hypervisor vs. agent) – eg. CPU
  • 13.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Performance Insights for RDS SQL Server
  • 14.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL Server on Amazon EC2 SQL Server
  • 15.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL Server on Amazon EC2 • How to start Spin up an EC2 instance and install from customer media (BYOL) Spin up an EC2 instance that includes SQL in the Amazon Machine Instance (AMI) • Self-Managed SQL Server • Security, patching & updates • Backups • High Availability • Full SQL Server sysadmin privileges SQL Server
  • 16.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Optimizing Performance for SQL Server on EC2
  • 17.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon EC2: Purpose-built computing Current instance families and generation Family/usage M5, M5a, M5zn General purpose compute T2, T3 Burstable performance C5, C5n, C5a,C4 Compute optimized X1, X1E, R5, R5d, R5a, Z1d Memory optimized P2, G3, F1 Accelerated computing I3, I3en Storage optimized (I/O) H1, D2 Storage optimized (Density) (4.5GHz) (4.0GHz)
  • 18.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. 16,000 Get the maximum EBS performance on Amazon EC2 GP3 General Purpose SSD 99.8% - 99.9% 1 GiB - 16 TiB 16,000 1,000 MiB/s Max IOPS per volume (16 KiB I/O) Max throughput per volume Amazon EC2 Max EBS Bandwidth 10,000Mbps Maximum IOPS 43,333 R5b.4xlarge 16,000 GP3 Durability Size (Min-Max) Total IOPS=32,000
  • 19.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. 64,000 Get the maximum EBS performance on Amazon EC2 IO2 Provisioned IOPS SSD 99.999 % 4 GiB - 16 TiB 64,000 1,000 MiB/s Max IOPS per volume (16 KiB I/O) Max throughput per volume 64,000 IO2 Durability Size (Min-Max) Total IOPS=128,000 Amazon EC2 Max EBS Bandwidth 30,000Mbps Maximum IOPS 130,000 R5b.12xlarge
  • 20.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Amazon EBS io2 Block Express Volumes IO2 Block Express IO2 Block Express • 256.000 IOPS per volume • 4000 MB/s throughput per vikume • 64 TiB per volume • 99.999% durability • Available with Amazon EC2 R5b instances • Supports standard io2 features
  • 21.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. Place tempdb in EC2 Instance Store Amazon EC2 What is instance storage? • Some instance types come with direct attached disk-based storage • SSD • NVMe SSD • Included in the hourly cost • Data on instance storage does not persist a user- initiated instance stop/start or hardware failure • Fast disk I/O without going over the network • Traffic does not count towards EBS IOPS z1d.12xlarge 2 x 900 NVMe SSD
  • 22.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. Place tempdb in EC2 Instance Store Amazon EC2 What is instance storage? • Some instance types come with direct attached disk-based storage • SSD • NVMe SSD • Included in the hourly cost • Data on instance storage does not persist a user- initiated instance stop/start or hardware failure • Fast disk I/O without going over the network • Traffic does not count towards EBS IOPS z1d.12xlarge 2 x 900 NVMe SSD Disk Mirroring
  • 23.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Region Amazon FSx for Windows File Server fs-0123456789.example.com Amazon FSx for Windows File Server Amazon FSx for Windows File Server SQL DB instance CREATE DATABASE [DBonFSx] ON PRIMARY ( name = N’DBonFSx_data’, filename = N’fs-0123456789.example.comDBDBonFSx_data.mdf’, size = 8192kb, maxsize = unlimited,filegrowth = 1024kb ) log ON ( name = N'DBonFSx_log’, filename =N‘fs-0123456789.example.comDBDBonFSx_log.ldf’, size = 1024kb, maxsize = 2048gb, filegrowth = 10%) GO
  • 24.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. Optimize your disk layout or file distribution Data Files Log Files Tempdb Data Files Tempdb Log Files Backup Files Random Access Sequential Access Random Access Sequential Access Sequential Access .mdf .ndf .ndf .ldf .ldf .ldf .mdf .ndf .ndf .ldf .ldf .ldf .bak
  • 25.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. Optimize your disk layout or file distribution GP3/IO2 GP3/IO2 GP3/IO2 Amazon EC2 Instance SQL Server Amazon EBS File distribution ST1/SC1 Database File Group bak/trn Instance Store Volumes SQL Data Files Tran. Log Files Backup Files TempDB Data/Log Files
  • 26.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS High Availability Best Practices for SQL Server on EC2
  • 27.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL Server HA/DR on EC2 • Windows clusters can span Availability Zones or regions • Mirroring • AlwaysOn Availability Groups • Transaction Log Shipping • SQL Failover Cluster Instance
  • 28.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Always On AG Multi-AZ Always On Availability Group • SQL Server: • Database-level HA solution • Manual adding logins, SQL Agent jobs, certificates and other SQL Server instance level objects to all secondary • Data/Transactions replicated through SQL Server • Infrastructure: • Shared-nothing configuration • Storage configured and managed outside of WSFC • Flexibility and granularity of storage configuration and maintenance • Limited SQL resources managed by WSFC AWS Cloud VPC Private subnet Private subnet Private subnet Availability Zone A Availability Zone B Availability Zone C Private subnet Active Directory DC1 Private subnet Active Directory DC2 File Share Witness 1st SQL Replica 2nd SQL Replica Sync Mode Auto Failover 10.0.10.0/24 10.0.20.0/24 10.0.30.0/24 10.0.40.0/24 10.0.50.0/24
  • 29.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Always On AG Multi-AZ Always On Availability Group • Best Practices: • Multi AZ setup • Use File Share Witness • MultiSubnetFailover = Yes • Connect to Listener • RegisterAllProvidersIP = Yes • Change default HostRecordTTL • SQL Native Client Providers AWS Cloud VPC Private subnet Private subnet Private subnet Availability Zone A Availability Zone B Availability Zone C Private subnet Active Directory DC1 Private subnet Active Directory DC2 File Share Witness 1st SQL Replica 2nd SQL Replica Sync Mode Auto Failover 10.0.10.0/24 10.0.20.0/24 10.0.30.0/24 10.0.40.0/24 10.0.50.0/24
  • 30.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Always On AG Multi-Region Always On Availability Group AWS Cloud VPC Private subnet Private subnet Private subnet Availability Zone A Availability Zone B Availability Zone C Private subnet Active Directory DC1 Private subnet Active Directory DC2 File Share Witness 1st SQL Replica 2nd SQL Replica Sync Mode Auto Failover 10.0.10.0/24 10.0.20.0/24 10.0.30.0/24 10.0.40.0/24 10.0.50.0/24 AWS Cloud VPC Private subnet Availability Zone A Private subnet Active Directory DC3 3rd SQL Replica 10.1.10.0/24 10.1.20.0/24 Async Mode Manual Failover Peering connection AWS Transit Gateway
  • 31.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL FCI with Amazon FSx for Windows File Server AWS Cloud VPC Availability Zone A Availability Zone B Private subnet Active Directory DC1 Private subnet Active Directory DC2 10.0.30.0/24 10.0.40.0/24 Shared Storage Private subnet Private subnet 1st SQL Node 2nd SQL Node 10.0.10.0/24 10.0.20.0/24 Amazon FSx Amazon FSx • SQL Server: • Instance-level HA solution • Logins, SQL Agent jobs, certificates and other SQL Server instance level objects are in-tact after failover • Infrastructure: • Clustered disk resource via SMB and continuously available shares (CAFS) • AWS managed SMB file system • Storage and Network traffic using the same network pipe • Managed storage configuration and maintenance • Very limited control over file system configuration (e.g. 4k vs. 64k allocation unit)
  • 32.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS SQL FCI with Amazon FSx for NetApp ONTAP AWS Cloud VPC Availability Zone A Availability Zone B Private subnet Private subnet 1st SQL Node 2nd SQL Node 10.0.10.0/24 10.0.20.0/24 iSCSI/SMB Primary Standby • Amazon FSx for NetApp ONTAP includes all of ONTAP’s storage efficiency and cost-savings features • High-performance SSD storage • NetApp ONTAP offers multiple throughput capacity
  • 33.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Migrating SQL Server to AWS
  • 34.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS Backup & Restore SQL Server’s native backup functionality AWS Database Migration Service Minimize downtime during migrations, migrate between different DB platforms 1 3 2 SQL Always On Availability Group Asynchronous-commit mode, distributed AGs (SQL Server 2016+)
  • 35.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. SQL SERVER ON AWS migrations@amazon.com Thank you