+ All Categories
Home > Technology > Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017...

Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017...

Date post: 22-Feb-2017
Category:
Upload: amazon-web-services
View: 66 times
Download: 0 times
Share this document with a friend
36
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. February 21, 2017 Consolidating MySQL Shards in Aurora AWS Database Migration Service
Transcript
Page 1: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

February 21, 2017

Consolidating MySQL Shards in AuroraAWS Database Migration Service

Page 2: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Agenda

• How does the cloud help?• Problem statement• Amazon Aurora overview• Introduction to AWS DMS• Proposed problem solution• Show me!

Page 3: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Cloud benefits

Page 4: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

• Multi-engine support: Aurora, MySQL, MariaDB, PostgreSQL, Oracle, SQL Server

• Automated provisioning, patching, scaling, backup/restore, failover

• High availability with RDS Multi-AZ– 99.95% SLA for Multi-AZ deployments

Amazon RDS

Page 5: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

• Lower TCO because we manage the muck

• Get more leverage from your teams

• Focus on the things that differentiate you

• Built-in high availability and cross region replication across multiple data centers

• Available on all engines, including base/standard editions, not just for enterprise editions

• Now even a small startup can leverage multiple data centers to design highly available apps with over 99.95% availability.

The Cloud makes things cheaper, easier, better

Page 6: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

How did we end up here?

Page 7: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Things change

In the beginning…

- The system ran fine but then growth happened

To solve the problem you could:- Scale up- Scale out

Page 8: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Sharding

Page 9: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon Aurora

Page 10: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Relational databases were not designed for the cloud

Multiple layers of functionality all in a monolithic stack

SQL

Transactions

Caching

Logging

Page 11: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Not much has changed in last 20 years

Even when you scale it out, you’re still replicating the same stack

SQL

Transactions

Caching

Logging

SQL

Transactions

Caching

Logging

ShardingCoupled at the application layer

Application

SQL

Transactions

Caching

Logging

SQL

Transactions

Caching

Logging

Shared NothingCoupled at the SQL layer

Application

SQL

Transactions

Caching

Logging

SQL

Transactions

Caching

Logging

Shared DiskCoupled at the caching and

storage layer

Storage

Application

Page 12: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Scale-out, distributed, log structured storage

Master Replica Replica Replica

Availability Zone 1

Shared Storage Volume – Transaction Aware

PrimaryDatabase

Node

Read Replica /

Secondary Node

Read Replica /

Secondary Node

Read Replica /

Secondary Node

Availability Zone 2 Availability Zone 3

AWS Region

Storage Monitoring

Database and Instance

Monitoring

Page 13: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Meet Amazon Aurora ……Database reimagined for the cloud

Speed and availability of high-end commercial databases

Simplicity and cost-effectiveness of open source databases

Drop-in compatibility with MySQL

Simple pay as you go pricing

Delivered as a managed service

Page 14: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Enterprise-class performance

• Provides 5X the throughput of standard MySQL running on the same hardware.

• Achieve up to 585,000 reads and 100,000 writes per second

• Read replicas with <10ms latency

Page 15: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Aurora ScalingWith user connection With number of tables

With database size - SYSBENCH With database size - TPCC

ConnectionsAmazon Aurora

RDS MySQLw/ 30K IOPS

50 40,000 10,000500 71,000 21,000

5,000 110,000 13,000

TablesAmazon Aurora

MySQLI2.8XL

local SSD

RDS MySQLw/ 30K IOPS (single AZ)

10 60,000 18,000 25,000

100 66,000 19,000 23,000

1,000 64,000 7,000 8,000

10,000 54,000 4,000 5,000

8xU P T O

F A S T E R

11xU P T O

F A S T E R

DB SizeAmazon Aurora

RDS MySQLw/ 30K IOPS

1GB 107,000 8,40010GB 107,000 2,400

100GB 101,000 1,5001TB 26,000 1,200

DB Size Amazon AuroraRDS MySQLw/ 30K IOPS

80GB 12,582 585

800GB 9,406 69

21U P T O

F A S T E R

136xU P T O

F A S T E R

Page 16: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Real-life data – gaming workloadAurora vs. RDS MySQL – r3.4XL, MAZ

Before : 15ms

After : 5.5ms

Aurora Migration

Aurora 3X faster on r3.4xlarge

Page 17: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Cost of ownership: Aurora vs. MySQLMySQL configuration hourly cost

Primaryr3.8XL

Standbyr3.8XL

Replicar3.8XL

ReplicaR3.8XL

Storage6 TB / 10 K PIOP

Storage6 TB / 10 K PIOP

Storage6 TB / 5 K PIOP

Storage6 TB / 5 K PIOP

$1.33/hr

$1.33/hr

$1.33/hr $1.33/hr

$2.42/hr

$2.42/hr $2.42/hr

Instance cost: $5.32 / hrStorage cost: $8.30 / hr

Total cost: $13.62 / hr

$2,42/hr

Page 18: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Cost of ownership: Aurora vs. MySQLAurora configuration hourly cost

Instance cost: $4.86 / hrStorage cost: $4.43 / hr

Total cost: $9.29 / hr

Primaryr3.8XL

Replicar3.8XL

ReplicaR3.8XL

Storage / 6 TB

$1.62 / hr $1.62 / hr $1.62 / hr

$4.43 / hr

*At a macro level Aurora saves over 50% in storage cost compared to RDS MySQL.

31.8%Savings

No idle standby instance

Single shared storage volume

No PIOPs – pay for use I/O

Reduction in overall IOP

Page 19: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Cost of ownership: Aurora vs. MySQLFurther opportunity for saving

Instance cost: $2.43 / hrStorage cost: $4.43 / hr

Total cost: $6.86 / hrStorage IOPs assumptions:1. Average IOPs is 50% of Max IOPs2. 50% savings from shipping logs vs. full pages

49.6%Savings

Primaryr3.8XL

Replicar3.8XL

Replicar3.8XL

Storage / 6TB

$0.81 / hr $0.81 / hr $0.81 / hr

$4.43 / hr

r3.4XL r3.4XL r3.4XL

Use smaller instance size

Pay-as-you-go storage

Page 20: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Use case: MySQL shard consolidation

Master ReadReplica

Shared distributed storage volume

M S

M M

M

S S

S

MySQL shards Aurora cluster

Customer, a global SAAS provider, was using hundreds of MySQL shards in order to avoid MySQL performance and connection scalability bottlenecks

Consolidated multiple 29 MySQL shards to single r3.4xlarge Aurora cluster

Even after consolidation cluster utilization is still 30% with plenty of headroom to grow.

Page 21: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Amazon Aurora Customers

Page 22: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Database Migration Service

Page 23: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

AWS Database Migration Service (AWS DMS)DMS migrates databases to AWS easily and securely with minimal downtime. It can migrate your data to and from most widely used commercial and open-source databases – and for as little a $3 for TB DB.

Amazon Aurora

Page 24: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Customerpremises

Application users

AWS

Internet

VPN

Start a replication instanceConnect to source and target databasesSelect tables, schemas, or databases

Let AWS DMS 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

AWSDMS

Page 25: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Load is table by table

Replication instance

Source Target

Page 26: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Change data capture (CDC) and apply

Replication instance

Source Target

Update

t1 t2

t1

t2

Transactions Change apply

after bulk load

Page 27: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Replication instance

Source Target

What else can I do?

Source

Source

Page 28: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Take it all—or not

Source Target

Replication instance instance

Page 29: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

AWS Database Migration Service Customers

Page 30: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

How can we make it better?

Page 31: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Establish a beach head

Before After

Page 32: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Validate

Page 33: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Partial Migration

Page 34: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

The Result

Page 35: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Demo

Page 36: Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Service - February 2017 Online Tech Talks

Thank you!

aws.amazon.com/dmsaws.amazon.com/rds/aurora

Learn more..


Recommended