[awsマイスターシリーズ]amazon relational database service (rds)
DESCRIPTION
TRANSCRIPT
© 2012 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.
AWSマイスターシリーズ
Amazon Relational Database Service (Amazon RDS)
2013.04.10
アマゾンデータサービスジャパン株式会社
ソリューションアーキテクト 松尾 康博
© 2012 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
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
© 2012 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.
3
お客様のアプリケーション
認証 AWS IAM
モニタリング Amazon
CloudWatch
Web管理画面 Management
Console
デプロイと自動化 AWS Elastic Beanstalk
AWS CloudFromation
IDEプラグイン Eclipse
Visual Studio
ライブラリ & SDKs Java, PHP, .NET,
Python, Ruby
Development &
Administration
AWS グローバルインフラ Geographical Regions, Availability Zones, Points of Presence AZ Region
ネットワーク & ルーティング Amazon VPC / Amazon Elastic Load Balancer / Amazon Route 53 /AWS Direct Connect
Infrastructure
Service
コンピュータ処理 Amazon EC2
Auto Scale
ストレージ Amazon S3
Amazon EBS Amazon Glacier
AWS StorageGateway
データベース Amazon RDS
Amazon DynamoDB Amazon Redshift
コンテンツ配信 Amazon CloudFront
メッセージ Amazon SNS Amazon SQS Amazon SES
分散処理 Elastic MapReduce
検索エンジン Amazon Cloud Search
キャッシング Amazon Elasticache
ワークフロー管理 Amazon SWF
Application
Service
© 2012 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.
4
AWS が提供するデータベースサービス
完全マネージド型で、セットアップ、運用、拡張が容易なリレーショナル・データベースサービス
Amazon RDS
Amazon DynamoDB
完全マネージド型で、高速なパフォーマンス、シームレスな拡張性と信頼性をNoSQLサービス
Amazon Redshift
高速で管理も万全なペタバイト規模のデータウェアハウスサービス
© 2012 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.
5
AWS が提供するデータベースサービス
完全マネージド型で、セットアップ、運用、拡張が容易なリレーショナル・データベースサービス
Amazon RDS
Amazon DynamoDB
完全マネージド型で、高速なパフォーマンス、シームレスな拡張性と信頼性をNoSQLサービス
Amazon Redshift
高速で管理も万全なペタバイト規模のデータウェアハウスサービス
© 2012 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.
6
典型的Webアーキテクチャ(他のサービスとの組み合わせ)
東京リージョン
AZ-1a AZ-1c
RDSマスタ RDSスレーブ
自動同期
ELB (ロードバランサ)
Amazon Route 53 (ドメイン名割り当て)
静的コンテンツ
S3
CloudFront
(コンテンツ 配信)
EC2 EC2
© 2012 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.
7
Amazon RDSとは?
3種類のエンジンをサポート
煩わしいDB構築・パッチ管理が容易
自動バックアップとDR機能
手動スナップショットとクローン機能
数クリックで起動・スケール可能
モニタリング機能と自動ホスト修復機能
© 2012 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.
8
Amazon RDSとは?(続き)
EC2同様、数分でDBインスタンスを起動可能
EC2同様、時間単位の従量課金
自動・手動バックアップ、自動パッチ更新、レプリケーション構成、DR構成が数クリックで可能
既存のアプリケーションやツールがそのまま利用可能
VPC対応
© 2012 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.
9
オンプレミス vs RDS
HWの購入 ラックへ設置
電源とNWを設定
OS インストール
基本設定 RDBMS インストール
RDBMS レプリケーション設定
RDBMS 稼働確認
© 2012 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.
10
オンプレミス vs RDS
RDSの各種オプションを選んで起動
アプリケーションから接続
© 2012 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.
11
自社構築 vs. RDS(MySQL)
数分で起動可能か?
単一APIコールまたは数クリックでスケールが可能か?
起動時に既に適切な設定がされているか?
同期レプリケーションと自動フェイルオーバー(option)
ポイントインタイムリカバリ バックアップやクローンの為のDBスナップショット管理
ハードウェアや完全な環境の制御
自動パッチ更新(option)
既存DB製品との互換性
コスト0でダッシュボードでCPU/メモリ等メトリクス
© 2012 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.
12
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
© 2012 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.
13
起動時の主な指定項目
DBエンジン • MySQL, Oracle, SQLServer
インスタンス • t1.micro (1CPU, 630MB) ~ m2.4xlarge (8CPU, 68GB)
• P-IOPS最適化
• 確保するストレージ容量 ( 5GB ~1TB)
オプション • 自動パッチ
• 高可用性( Multi-AZ)
• 自動バックアップ
DB設定 • DB名、パラメータ、ユーザ、ポート、セキュリティ
© 2012 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.
14
可用性 スループット増
レイテンシ
スケールアップ
Multi AZ
リードレプリカ
プロビジョンドIOPS
リードレプリカ スケールアップ プロビジョンド IOPS
Region
Multi-AZ
Availability
zone
Availability
zone
簡単に高性能・可用性の構成を実現
© 2012 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.
15
RDS(MySQL) アーキテクチャ
アベイラビリティゾーンA アベイラビリティゾーンB
自動バックアップ スナップショット(自動/手動)
データ同期
非同期レプリケーション
自動フェイルオーバー
Binlog
(トランザクションログ)
(5分間隔)
Binlog
(トランザクションログ)
(5分間隔)
Binlog
S3 Availability Zone A Availability Zone B
© 2012 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.
16
RDS(MySQL) アーキテクチャ
16
アベイラビリティゾーンA アベイラビリティゾーンB
自動バックアップ
スナップショット
自動バックアップ
スナップショット
データ同期
非同期レプリケーション
自動フェイルオーバー
マルチAZデプロイメント
(Multi-AZ)
© 2012 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.
17
マルチAZデプロイメントとは(Multi-AZ)
ワンクリックで耐障害性を向上可能なソリューション
• 高い技術力を持つDBAが行っていた設計をそのままサービス化
同期レプリケーション+自動フェイルオーバ
• アプリ側での対処は必要なし(エンドポイントは変わらない)
フェイルオーバのタイミング
• パッチ適用などのメンテナンス計画停止
• インスタンスやハードウェア障害
• 手動reboot時に強制フェイルオーバー指定
© 2012 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.
18
RDS(MySQL) アーキテクチャ
アベイラビリティゾーンA アベイラビリティゾーンB
自動バックアップ 自動バックアップ
データ同期
非同期レプリケーション
自動フェイルオーバー
リードレプリカ Binlog
(トランザクションログ)
(5分間隔)
Binlog
(トランザクションログ)
(5分間隔)
© 2012 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.
19
リードレプリカ(RR)とは?
特定DBインスタンスの読み込み用のコピー
• MySQL固有のレプリケーション機能で実現
• 非同期ログシッピング
• 各RRは個別のエンドポイントを持つ
想定ユースケース
• Read(select)のスケーリングや、BI等の解析処理
• Multi-AZの耐障害性の代替の機能ではない
デフォルトで最大5台まで設定可能
マルチAZとリードレプリカの併用はもちろん可能
© 2012 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.
20
RDS(MySQL) アーキテクチャ アベイラビリティゾーンA アベイラビリティゾーンB
自動バックアップ
スナップショット
自動バックアップ
スナップショット
データ同期
非同期レプリケーション
自動フェイルオーバー
自動バックアップ機能
© 2012 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.
21
自動バックアップとリストア
RDS標準機能
• 自動スナップショット+トランザクションログをS3に保存
自動スナップショット
• 1日1回自動取得 (バックアップウインドウで指定した時間帯)
• 保存期間は最大35日分 (0~35の間で設定可能)
• (任意のタイミングで、手動取得も可能)
2種類のリストア方法
• リストア:任意のスナップショット
• Point-In-Time-Recovery: 指定した時刻(直近5分~最古のスナップショットの時点)の状態にリカバリ
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.BackupRestore.html
© 2012 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.
22
スナップショット利用シーン
Production.xxx.amazonaws.com
本番インスタンス障害後に、スナップショットから新たにインスタンス起動。
アプリケーションは新しいエンドポイントに接続
するように修正
自動Snapshot 本番インスタンス
Prodduction2.xxx.amazonaws.com
リストア or Point-in-time-recovery
© 2012 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.
23
スナップショット利用シーン
Production.xxx.amazonaws.com
テーブル変更などを伴う大きなアプリケーションアップデートを実施する前に手動でスナップショットを取得しておく。
スナップショットから旧バージョンのインスタンス起動・接続することで切り戻しを実現
手動Snapshot
本番インスタンス
Prodduction2.xxx.amazonaws.com
リストア or Point-in-time-recovery
Update Ver. Old Ver.
Issue?
© 2012 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.
24
ソフトウェアメンテナンス
RDS標準機能
• メンテナンスウインドウで指定した曜日・時間帯に自動実施
メンテナンス内容
• 安全性・堅牢性に関わるソフトウェアパッチを自動適用
• Rebootを伴う場合も
TIPS
• メンテナンスは数ヶ月に一度の頻度で発生
• 指定した時間帯の数分間で実施(メンテナンス内容に依存)
• アプリケーション側で、DBアクセス出来ない場合にSorryページを返す仕組みを入れておく
• トラフィックが少ない曜日・時間帯を指定しておく
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_TerminologyandKeyConcepts.h
tml#Concepts.DBMaintenance
© 2012 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.
25
スケールアップ機能
マネージメントコンソールからスケールアップ可能
• インスタンス停止が発生
コマンドラインからも勿論可能
• 例:rds-modify-db-instance hogedb -c db.m1.large --apply-immediately
CPUは1ECUから26ECUまで
メモリは1.7GBから68GBまで
© 2012 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.
26
DBインスタンスクラス
128
64
32
16
8
4
2
1
1 2 4 8 16 32 64 128
EC2 Compute Units (ECU)
Mem
ory
(G
B)
Small 1.7 GB 1 EC2 Compute Unit 1 virtual core
Micro 630 MB Up to 2 ECUs (for short bursts)
Large 7.5 GB 4 EC2 Compute Units 2 virtual cores
Extra Large 15 GB 8 EC2 Compute Units 4 virtual cores
Medium 3.75 GB 2 EC2 Compute Unit 1 virtual core
Hi-Mem 4XL 68.4 GB 26 EC2 Compute Units 8 virtual cores
Hi-Mem 2XL 34.2 GB 13 EC2 Compute Units 4 virtual cores
Hi-Mem XL 17.1 GB 6.5 EC2 Compute Units 2 virtual cores
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html
© 2012 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.
27
VPCサポート
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSVPC.html
全てのエンジン・インスタンスタイプがVPC内で利用可能
© 2012 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.
28
RDSのアクセス制御
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html
アクセス元インスタンスのSecurity Groupを指定
それ以外のインスタンスからのアクセスは拒否
© 2012 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.
29
RDS起動場所 ログ種別
EC2-Classic DB Security Group
EC2-VPC VPC Security Group
VPC by Default VPC Security Group
RDSのアクセス制御
アクセス制御の方法は起動場所によって異なる
• DB Security Group
• VPC Security Group
注意
• VPCではDB Security GroupからVPC Security Groupに移行
• VPC by Default環境では DB Security Groupが無効
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html
© 2012 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.
30
DBエンジン
現在3種類をサポート
MySQL
• 5.1.x、5.5.xを選択可能
Oracle
• 11g R2 (11.2.x )
• BYOL:SE1, SE, EEをサポート
• ライセンス込み:SE1
SQL Server
• 2008 R2, 2012を選択可能
• BYOL: Standard Edition, Enterprise Edition
• ライセンス込み:Express, Web Edition, Standard Edition
© 2012 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.
31
DBエンジン – Oracle -
標準機能 • Character Set ( JA16SJISTILDE, AL32UTF8, etc. )選択 • Timezone設定
RDSオプション • Oracle Enterprise Manager Database Control • Oracle XML DB • Oracle Application Express (APEX, APEX-DEV)
Enterprise Option ( BYOLでサポート) • Partitioning • Management Packs (Diagnostic, Tuning) • Advanced Compression • Total Recall
詳細情報 • 機能情報
• http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Concepts.html
• FAQ • http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/RDSFAQ.Oracle.html
© 2012 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.
32
DBエンジン – SQL Server -
標準機能 • SQL Server Migration Assistant
• Database Engine Tuning Advisor (SE, EE, Web)
• SQL Server Agent
• SSL接続
バージョンアップ • 2008 R2から 2012へのメジャーバージョンアップ機能
詳細情報 • 機能情報
• http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Concepts.General.html
• FAQ • http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/RD
SFAQ.SQLServer.html
© 2012 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.
33
DBエンジンごとの主要機能まとめ
MySQL Oracle SQL Server
Multi-AZ
リードレプリカ
Point-In-Time-Recovery
VPC
© 2012 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.
34
標準ストレージ
EBSボリュームベースのDBストレージ
• データベースとログの格納に利用
• ストライピングした複数のEBSボリュームで構成
• サイズを増量するとボリューム数が増え、IOPS性能が向上
• オンラインでストレージサイズ拡張可能(MySQL, Oracle)
DBエンジン サイズ 動的増量
MySQL 5GB-3TB
Oracle 10GB-3TB
SQL Server( Web , Ex) 20GB-1TB
SQL Server (SE, EE) 200GB-1TB
© 2012 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.
35
プロビジョンドIOPS ストレージ
高性能なストレージオプション
• ストレージパフォーマンスの性能(IOPS)を指定
• 低レイテンシと高スループットを安定して実現可能
• 標準ストレージからオンラインで変更可能(MySQL, Oracle)
• フェイルオーバー、クラッシュリカバリの時間短縮にも有効
DBエンジン IOPS サイズ 動的変更
MySQL 1000-30,000 100GB-3TB
Oracle 1000-30,000 100GB-3TB
SQL Server( Web , Ex) 1000-7,000 100GB-1TB
SQL Server (SE, EE) 2000-7,000 200GB-1TB
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/RDSFAQ.PIOPS.html
© 2012 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.
36
プロビジョンドIOPS ストレージ(続き)
IOPSについての注意点
• 各DBエンジンの仕様、Page SizeやOS、仮想化技術の違いで実際のIOPSは以下の表のような目安になる
• より大きいPIOPSでより低レイテンシ・高スループットに
• 小さなインスタンスタイプではストレージとのN/W帯域不足で設定したIOPSに達しない場合がある(m1.large以上を推奨)
DBエンジン
(最大サイズ、IOPS) Page Size Max IOPS for
m2.4xlarge
MySQL(3TB, 30,000) 16KB 12,500
Oracle(3TB, 30,000) 8KB 25,000
SQL Server(1TB, 10,000) 8KB 7,000
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.ProvisionedIOPS.html#US
ER_PIOPS.Realized
※ Read 50%, Write 50%の場合
© 2012 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.
37
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
© 2012 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.
38
RDSアップデート
2012.05.02 Multi-AZ 強制フェイルオーバー機能 ( MySQL, Oracle) 2012.05.08 SQL Server がDBエンジンに追加 2012.05.17 MySQL RR がVPCで利用可能に 2012.05.29 option group機能、 Oracle Enterprise Manager機能 (Oracle) 2012.06.11 MySQL t1.microで利用可能に 2012.07.11 SQL Server でTuning Advisorが利用可能に 2012.08.16 Oracle でAPEX, XML DB repository, timezoneが利用可能に。VPC対応。 2012.08.21 tagging対応 2012.08.22 SQL Server Agent機能が利用可能に 2013.09.13 SQL Serverが VPC対応 2013.09.13 Oracle Data Pumpが利用可能に 2012.09.25 PIOPS ( 10000) が利用可能に 2012.09.26 SQL Server 2012が追加 2012.09.27 Oracleで t1.microが利用可能に 2012.10.10 MySQLでSSL接続が可能に 2012.10.11 MySQLでRRを昇格させる機能 2012.11.06 インスタンスタイプ追加 m1.medium (MySQL, Oracle, SQL Server), m1.xlarge( Oracle, SQL Server) 2012.11.06 料金値下げ ( MySQL, Oracle) 2012.12.04 t1.micro がVPCで利用可能に 2012.12.17 新デザインのマネジメントコンソールが選択可能に 2012.12.20 Data Pipeline がRDSをサポート 2013.01.14 インスタンスのリネームが可能に。VPCでDB Security Groupから VPC Security Groupに変更 2013.02.04 イベント通知機能が利用可能に 2013.02.13 Multi-AZの料金値下げ 2013.03.04 ログアクセス機能が利用可能に 2013.03.11 VPC by default 対応。VPC内のインスタンスを外部から接続可能に。 2013.03.13 PIOPS が最大30,000に増強( MySQL, Oracle) ストレージ容量が最大3TBに 2013.03.13 SQL Serverのメジャーアップグレード機能が利用可能に(2008から2012へ)
© 2012 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.
39
DBエンジン ログ種別 保持期間
MySQL Error, Slow Query※1, General※1 24時間
Oracle Alert, Trace 7日間※2
SQL Server Error, Agent, Trace 7日間※2
ログアクセス機能
各種ログを直接参照する機能
• API経由 でダウンロード or マネジメントコンソールで表示
※1 Parameter Groupで有効化するとアクセス可能
※2 Parameter Groupで調整可能
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html
© 2012 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.
40
イベント通知 (DB Event Subscriptions)
RDSで発生した40以上のイベントをSNS経由でPush通知 • シャットダウン、再起動、バックアップ開始終了、フェイルオーバー、設定変更、メンテナンス開始終了、etc
アプリケーションと組み合わせた自動化やログ保存が容易に
DB event
Alarm
Queue
Notification
Message
HTTP
Notification
Amazon SNS
© 2012 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.
41
RR Promotion
アベイラビリティゾーンA アベイラビリティゾーンB
自動バックアップ スナップショット(自動/手動)
既存Masterから独立
(切り離し)
Binlog
(トランザクションログ)
(5分間隔)
Binlog
(トランザクションログ)
(5分間隔)
Binlog
© 2012 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.
42
Rename
Production.xxx.amazonaws.com
Old.xxx.amazonaws.com
EC2からRDSに接続する際に使用するエンドポイント(FQDN)を切り替える
・切り替え時に、インスタンスの再起動などは発生しない(DNS切り替えのみ) ・切り替え(DNSの変更)は、Apply Immediately で数分必要
・切り替え後、古いエンドポイントでのアクセスは出来ない
© 2012 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.
43
Renameの使い所
復旧時の利用
• リストアしたインスタンス、PITRしたインスタンスを本番運用に切り替える場合
• (かつ、アプリ側の変更が困難な場合)
大幅なDB変更を伴うアプリケーションアップデートがある場合 • (かつ、アプリ側の変更が困難な場合)
© 2012 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.
44
Rename ケース1
Production.xxx.amazonaws.com
Old.xxx.amazonaws.com
障害後の復旧として
・
Snapshot
本番インスタンス
prod2.xxx.amazonaws.com
Prodduction.xxx.amazonaws.com
© 2012 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.
45
Rename ケース2
Production.xxx.amazonaws.com
Old.xxx.amazonaws.com
大型リリース時の切り戻し対策として
・
本番インスタンス
rr1.xxx.amazonaws.com
Prodduction.xxx.amazonaws.com
Update Ver. Old Ver.
Issue
© 2012 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.
46
Renameの注意点
DNS 切り替え • すぐに切り替わるわけではない。目安は数分(3分程度)
• 当然だが、ある時点で、同一リージョン内にて名前の重複はできない
Renameすると引き継がないもの(APIで取得している場合は注意) • CloudWatchの MetricName(古いMetricは別レコードとして残る) • DB Eventsの Identifier
Renameしてもそのまま引き継ぐもの • MasterとRRの関係 • Tag、Snapshot
その他 • http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Rena
meInstance.html
© 2012 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.
47
データ保護・複製の選択肢
Multi-AZ • 最もデータロストが少ない • 切り替えによる、アプリ側の変更は不要 • 障害時に自動復旧(内部的に切り替え)
Point in Time Recovery • 直近5分前状態の複製を作成 • 手動 • 要エンドポイント変更対応(アクセス先変更 or rename)
RR Promotion • RRのデータ状態のまま独立( Replica Lag) • 手動 • 要エンドポイント変更対応(アクセス先変更 or rename)
© 2012 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.
48
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
© 2012 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.
49
RDSの料金体系
DBインスタンス起動時間 ($/時間) • DBインスタンスクラス( t1.micro ~ m2.4xlarge)
• 標準配備 or Multi-AZ
• BYOL or ライセンス込 ( Oracle, SQL Server )
ストレージ • ストレージ容量($/GB/月) とI/O料金
• 標準ストレージ or PIOPS
• 標準配備 or Multi-AZ
• バックアップストレージ容量($/GB/月)
• I/Oリクエスト数(標準ストレージ) or IOPS (PIOPS)
ネットワーク • RDSからインターネット経由で送信したバイト数 ($/GB)
http://aws.amazon.com/jp/rds/pricing/
© 2012 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.
50
2つの価格モデル
オンデマンド DB インスタンス
• 通常の時間単位の課金
Amazon RDS リザーブドインスタンス
• 予約金を支払うことで時間当たり価格を割引(最大70%節減)
• MySQL, Oracle, SQL Server全て対応
• 購入時に以下を指定
• リージョン、DBエンジン、インスタンスクラス、マルチAZ or シングルAZ、期間
• Oracle, SQL Serverは、ライセンス込みかBYOLを指定
http://aws.amazon.com/jp/rds/reserved-instances/
© 2012 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.
51
Multi-AZ 値下げ!
Single-AZの2倍 -> 約1.7倍に
http://aws.typepad.com/aws_japan/2013/0
2/aws-price-reduction-rds-multi-az.html
© 2012 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.
52
Simple Monthly Calculator
Webフォームで概算費用を試算できます http://calculator.s3.amazonaws.com/calc5.html?lng=ja_JP
© 2012 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.
53
AWS無料試用枠
AWSでは、無料試用枠を用意しています
• http://aws.amazon.com/jp/free/
RDSでは
• t1.micro 750時間/月、ストレージ20GB、バックアップ20GB
© 2012 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.
54
参考文献
Amazon RDS
• http://aws.amazon.com/jp/rds/
Amazon RDS ドキュメント
• http://aws.amazon.com/jp/documentation/rds/
Amazon RDS チュートリアル
• http://aws.amazon.com/articles/Amazon-RDS
Amazon RDS Technical FAQ
• http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/RDSFAQ.html
Amazon Web Services Japan blog
• http://aws.typepad.com/aws_japan/
© 2012 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.
55
ご参加ありがとう ございました。