Lessons from migrating SQL server

20

Transcript of Lessons from migrating SQL server

Page 1: Lessons from migrating SQL server
Page 2: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Lessons from migrating SQL server databases to Amazon Aurora

D A T 3 4 3 - R

Mahesh Kansara

Database Engineer (AWS DMS)

Amazon Web Services

Abhishek Chaturvedi

Database Engineer (AWS DMS)

Amazon Web Services

Page 3: Lessons from migrating SQL server

Agenda

Introduction to AWS Database Migration Service (AWS DMS) and AWS Schema Conversion Tool (AWS SCT)

Amazon Aurora

SQL Server top features comparison

Migration resources

Q&A

Page 4: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 5: Lessons from migrating SQL server

Flexible, powerful migration toolingBreadth of Data sources

Choice of Data targets

Schema Conversion Tool (SCT)

Database Migration Service (DMS)

Relational

Non-relational

Amazon Aurora

Amazon DynamoDB

Relational

Supported in SCT for planning/conversion and DMS for migration

Supported by SCT and DMS

Non-relational

Relational

Non-relational

Amazon Aurora

Supported as a source in DMS to replicate data from

Analytics

AWS SnowballAmazon S3

Relational

Non-relational

Amazon DocumentDB (with

MongoDB compatibility)

Amazon Elasticsearch

Service

Amazon Kinesis

Data StreamsAmazon S3

Analytics

Supported as a target in DMS to replicate data to

On-premisesdata warehouses

Supported in SCT for planning/conversion and migration

Oracle

Teradata

Vertica

Netezza

Greenplum

SQL Server Amazon Redshift

• Supported as a target in DMS to

replicate data to

• Supported as a target in SCT to

migrate data from on-premises

data warehouses

Cloud data warehouse

Schema Conversion

Data replication

Data warehouse

migration

Schema Conversion Tool (SCT)

Page 6: Lessons from migrating SQL server

>200K databases migrated with AWS DMS (change)

Page 7: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 8: Lessons from migrating SQL server

Amazon Aurora

Performance and scalability

Availability and durability

Highly secure Fully managed

5x throughput of standard

MySQL and 3x of standard

PostgreSQL; scale-out up

to 15 read replicas

Fault-tolerant, self-healing

storage; six copies of data

across three AZs;

continuous backup to

Amazon S3

Network isolation,

encryption at

rest/transit

Managed by Amazon

RDS: no hardware

provisioning, software

patching, setup,

configuration, or

backups

MySQL and PostgreSQL compatible relational database built for the cloud

Performance and availability of commercial-grade databases at one-tenth the

cost

Page 9: Lessons from migrating SQL server

What is Amazon Aurora?

Leverages a scale-out, distributed architecture

• Purpose-built log-structured distributed storage system designed for databases

• Storage volume is striped across hundreds of storage nodes distributed over three different Availability Zones

• Six copies of data, two copies in each availability zone to protect against AZ+1 failures

• Plan to apply same principles to other layers of the stack

Master Replica

Replica Replica

Availability

Zone 1

Shared storage volume

Availability

Zone 2

Availability

Zone 3

Storage nodes with SSDs

SQL

Transactions

Caching

SQL

Transactions

Caching

SQL

Transactions

Caching

Page 10: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 11: Lessons from migrating SQL server

Top features in SQL Server—How to migrate to Aurora MySQL

1. Emulate SQL Server Database Mail

• Database Mail is an email client solution for sending messages directly from SQL Server

• For alerting purposes, use the Event Notification Subscription feature

• Use Lambda integration

2. Migrate from SQL Server maintenance plans

• Set of automated tasks used to optimize a database, performs regular backups

• Backups in Aurora via Snapshots

3. Database options

• Compare the replication in SQL and MySQL

Page 12: Lessons from migrating SQL server

SQL Server vs. MySQL feature comparison

Migrate from Task SQL Server Aurora MySQL

SQL Server maintenance plans Rebuild or reorganize indexes ALTER INDEX/ALTER TABLE OPTIMIZE TABLE/ALTER TABLE

Decrease data file size by

removing empty pages

DBCC SHRINKDATABASE/

DBCC SHRINKFILE

Files are per table; not per database.

Rebuilding a table optimizes file size.

Update statistics to help the

query optimizer get updated

data distribution

UPDATE STATISTICS/

sp_updatestats

Set innodb_stats_auto_recalc to

ON in the instance global parameter

group

Backup the database and

transaction log files

BACKUPDATABASE/

BACKUP LOG

Automated backups + snapshots

SQL Server Database Mail Email client solution for

sending messages directly

from the database

Database Mail No native support. Use Lambda

integration.

Page 13: Lessons from migrating SQL server

SQL Server vs. MySQL feature comparison

Migrate from Task SQL Server Aurora MySQL

Replication and

disaster recovery

Log replication Log shipping Not applicable. Aurora

MySQL handles data

replication at the

storage level.

Database-level failure

protection

Always-on availability

groups

Aurora replicas

Maximum read-only

replicas

8+ primary 15+ primary

High availability Always-on failover

cluster instances (FCI),

always-on availability

groups, database

mirroring, and log

shipping

Multi-replica, multi-

master scale-out

solution using

Aurora clusters and

Availability

Zones

Page 14: Lessons from migrating SQL server

SQL Server vs. MySQL feature comparison

Migrate from Task SQL Server Aurora MySQL

Backup and restore Backups Self-managed backup

policy BACKUP DATABASE

Automatic and continuous

Recovery model SIMPLE, BULK

LOGGED, FULL

Functionality of Aurora

MySQL backups is

equivalent to the FULL

recovery model

Log backup BACKUP LOG Backup is at the storage

level

Migrate from SQL Server

database options

Database-level options to

set database features

ALTER DATABASE ...

SET command

A database is

synonymous with a

schema. So the notion of

database options is not

applicable to Aurora

MySQL.

Page 15: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 16: Lessons from migrating SQL server

Old world to Aurora migration playbooks

• Topic-by-topic overview of SQL Server to Aurora MySQL migrations and “hands-on” best practices

• How to migrate from proprietary features and the different database objects

• Migration best practices

AWS SCT AWS DMS Playbook

Schema Data Best practices

Page 17: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 18: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

25+ free digital training courses cover topics and services related to databases, including:

Validate expertise with the new AWS Certified Database - Specialty beta exam

Learn databases with AWS Training and Certification

• Amazon Aurora

• Amazon Neptune

• Amazon DocumentDB

• Amazon DynamoDB

• Amazon ElastiCache

• Amazon Redshift

• Amazon RDS

Visit aws.training

Resources created by the experts at AWS to help you build and validate database skills

Page 19: Lessons from migrating SQL server

Thank you!

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 20: Lessons from migrating SQL server

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.