Weitere ähnliche Inhalte
Ähnlich wie AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS) (20)
Mehr von Amazon Web Services Japan (20)
Kürzlich hochgeladen (11)
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
- 1. AWS Black Belt Tech Webinar 2014
(旧マイスターシリーズ)
Amazon Relational Database Service
(Amazon RDS)
2014.04.16(2014.9.30更新)
アマゾンデータサービスジャパン株式会社
ソリューションアーキテクト 松尾康博
テクニカルトレーナー 江川大地
© 2014 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. © 2014 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の新機能紹介
料金モデル
Tips (参考情報)
まとめ
Agenda
- 3. 検索エンジン
Amazon Cloud Search
ネットワーク & ルーティング
メッセージ
Amazon SNS
Amazon SQS
Amazon SES
ワークフロー管理
Amazon SWF
Amazon VPC / Amazon Elastic Load Balancer / Amazon Route 53 /AWS Direct Connect
© 2014 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 グローバルインフラ
Region AZ Geographical Regions, Availability Zones, Points of Presence
Infrastructure
Service
コンピュータ処理
Amazon EC2
Auto Scale
ストレージ
Amazon S3
Amazon EBS
Amazon Glacier
AWS StorageGateway
データベース
Amazon RDS
Amazon DynamoDB
Amazon Redshift
コンテンツ配信
Amazon CloudFront
分散処理
Elastic MapReduce
キャッシング
Amazon Elasticache
Application
Service
- 4. 完全マネージド型で、高速なパフォーマンス、シー
ムレスな拡張性と信頼性をNoSQLサービス
完全マネージド型で、セットアップ、運用、拡張が
用意なキャッシュサービス
© 2014 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
Amazon Redshift
高速で管理も万全なペタバイト規模のデータウェア
ハウスサービス
Amazon ElastiCache
- 5. Amazon Route 53
(ドメイン名割り当て)
ELB
(ロードバランサ)
自動同期
S3
CloudFront
(コンテンツ
配信)
© 2014 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
典型的Webアーキテクチャ(他のサービスとの組み合わせ)
東京リージョン
AZ-1a AZ-1c
RDSマスタRDSスレーブ
静的コンテンツ
EC2 EC2
- 6. © 2014 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
Amazon RDSとは?
構築
• 数クリック or APIでDBサーバを操作
• EC2同様、初期費用無し、時間単位の従量課金
移行
• 4種類のエンジンをサポート
• 既存アプリケーションの変更不要
運用
• 可用性向上のための機能
• モニタリング、障害検出/復旧、パッチ、スケーリングが容易
セキュリテイ
• セキュリティグループ、VPC対応
https://aws.amazon.com/jp/rds/
- 7. App optimization
Scaling
High availability
Database backups
DB s/w patches
DB s/w installs
OS patches
OS installation
Server maintenance
Rack & stack
App optimization
Scaling
High availability
Database backups
DB s/w patches
DB s/w installs
OS patches
OS installation
Server maintenance
Rack & stack
App optimization
Scaling
High availability
Database backups
DB s/w patches
DB s/w installs
OS patches
OS installation
Server maintenance
Rack & stack
© 2014 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
自社構築 vs. RDS
Power, HVAC, net
Power, HVAC, net
Power, HVAC, net
オンプレミスOn EC2 RDS
お客様がご担当する作業AWSが提供するマネージド機能
- 8. インスタンスクラス
244GB
122GB
60GB
32GB
16GB
r3.8xl
© 2014 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
8GB
4core 8core 16core 32core
1core 2core
r3.4xl
r3.2xl
r3.xl
r3.large
m3.2xl
m3.xl
m3.large
4GB
t2.small
t2.micr
o
R3:メモリ/コア 多め
M3:メモリ/コア 普通
T2: 小さめ(バースト可能)
t2.medium
- 9. ※ PostgreSQL, MySQL5.6, SQL Serverのみサポート
© 2014 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
DBインスタンスクラスとスペック
DB Instance Class メモリ(GiB) vCPU PIOPS
最適化
ネットワーク
db.t2.micro※ 1 1 低 – 中
db.t2.small※ 1 2 低 – 中
db.t2.medium※ 2 4 低 – 中
db.m3.large 7.5 2 中
db.m3.xlarge 15 4 500Mbps 高
db.m3.2xlarge 30 8 1000Mbps 高
db.r3.xlarge※ 30.5 4 中
db.r3.2xlarge※ 61 8 500Mbps 中
db.r3.4xlarge※ 122 16 1000Mbps 高
db.r3.8xlarge※ 244 32 10Gbit
http://aws.amazon.com/jp/rds/details/
- 10. © 2014 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
DBエンジン
現在4種類をサポート
MySQL
• 5.1.x、5.5.x、5.6.xを選択可能
PostgreSQL
• 9.3.xを選択可能
Oracle
• 11g R2 (11.2.0.x )
• BYOL:SE1, SE, EEをサポート
• ライセンス込み:SE1
SQL Server
• 2008 R2, 2012を選択可能
• BYOL: Standard Edition, Enterprise Edition
• ライセンス込み:Express, Web Edition, Standard Edition
- 11. © 2014 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
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
Agenda
- 12. © 2014 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
主要な機能
信頼性向上
運用
性能
セキュリティ
- 13. © 2014 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
主要な機能
信頼性向上
運用
性能
セキュリティ
- 14. 簡単に高性能・可用性の構成を実現
Multi-AZ
Availability
zone
Region
Availability
zone
© 2014 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
- 15. 自動フェイルオーバー
Binlog
(トランザクション
ログ)
© 2014 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分間隔)
(5分間隔)
Binlog
S3 Availability Zone A Availability Zone B
- 16. アベイラビリティゾーンA アベイラビリティゾーンB
自動バックア
ップ
自動フェイルオーバー
© 2014 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
自動バックア
ップ
スナップショ
ット
スナップショ
ット
データ同期
非同期レプリケーション
マルチAZデプロイメント
(Multi-AZ)
- 17. Multi-AZ
© 2014 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時に強制フェイルオーバー指定
Region
Availability
zone
Availability
zone
http://aws.amazon.com/jp/rds/mysql/#Multi-AZ
- 18. 自動フェイルオーバー
Binlog
(トランザクション
ログ)
© 2014 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分間隔)
(5分間隔)
- 19. © 2014 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)とは?
読み込み専用コピー
• MySQL固有のレプリケーション機能で実現
• 各RRは個別のエンドポイントを持つ
• デフォルトで最大5台まで増設可能
• マルチAZとの組み合わせも可能
想定ユースケース
• Read(select)のスケーリングや、BI等の解析処理
※ Multi-AZの耐障害性の代替の機能ではない
新機能
• リージョンをまたいだリードレプリカ構成
• オンプレミス/EC2 と組み合わせたレプリケーション
• リードレプリカをマスターに昇格
• 多階層リードレプリカ構成
リードレプリカ
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html
- 20. 自動バックア
ップ
自動フェイルオーバー
© 2014 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
自動バックア
ップ
スナップショ
ット
スナップショ
ット
データ同期
非同期レプリケーション
自動バックアップ機能
- 21. © 2014 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種類のリストア方法
• リストア:任意のスナップショットを元にDBインスタンス作成
• Point-In-Time-Recovery:
• 指定した時刻(直近5分)の状態のDBインスタンス作成
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.BackupRestore.html
- 22. Production2.xxx.amazonaws.com
© 2014 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
リストア or Point-in-time-recovery
- 23. © 2014 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
本番インスタンス
Production2.xxx.amazonaws.com
リストア or Point-in-time-recovery
Update Ver.
Old Ver.
Issue?
- 24. © 2014 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
スナップショット利用シーン
スナップショットのリージョン間コピー
• 別リージョンにスナップショットをコピー可能。
• 別リージョンで、スナップショットからインスタンス起動可能
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.htm
l
- 25. © 2014 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
主要な機能
信頼性向上
運用
性能
セキュリティ
- 26. © 2014 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
ソフトウェアメンテナンス
RDS標準機能
• メンテナンスウインドウで指定した曜日・時間帯に自動実施
メンテナンス内容
• 安全性・堅牢性に関わるソフトウェアパッチを自動適用
• Rebootを伴う場合も
TIPS
• メンテナンスは数ヶ月に一度の頻度で発生(毎週必ずではない)
• 指定した時間帯の数分間で実施(メンテナンス内容に依存)
• アプリケーション側で、DBアクセス出来ない場合にSorryペー
ジを返す仕組みを入れておく
• トラフィックが少ない曜日・時間帯を指定しておく
• Event 通知を運用監視に組み込んでおく
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_TerminologyandKeyConcepts.html#Concepts.DBMaintenance
- 27. © 2014 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
イベント通知 (DB Event Subscriptions)
RDSで発生した40以上のイベントをSNS経由でPush通知
• シャットダウン、再起動、バックアップ開始終了、フェイルオーバー、設
定変更、メンテナンス開始終了、etc
アプリケーションと組み合わせた自動化やログ保存が容易に
DB event
Alarm
Queue
Email
Notification
Message
HTTP
Notification
Amazon SNS
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html
- 28. ログアクセス機能
各種ログを直接参照する機能
• API経由 でダウンロード or マネジメントコンソールで表示
© 2014 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
DBエンジンログ種別保持期間
PostgreSQL - (ログ種別という概念がない) 7日間※2
MySQL Error, Slow Query※1, General※1 24時間
Oracle Alert, Trace 7日間※2
SQL Server Error, Agent, Trace 7日間※2
※1 Parameter Groupで有効化するとアクセス可能
※2 Parameter Groupで調整可能
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html
- 30. 障害後の復旧として
© 2014 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
Rename ケース1
Production.xxx.amazonaws.com
Old.xxx.amazonaws.com
Snapshot
本番インスタンス
prod2.xxx.amazonaws.com
Prodduction.xxx.amazonaws.com
- 31. 大型リリース時の切り戻し対策として
© 2014 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
Rename ケース2
Production.xxx.amazonaws.com
Old.xxx.amazonaws.com
本番インスタンス
rr1.xxx.amazonaws.com
Prodduction.xxx.amazonaws.com
Update Ver.
Old Ver.
Issue
- 32. © 2014 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
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
- 33. © 2014 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
主要な機能
信頼性向上
運用
性能
セキュリティ
- 34. © 2014 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
CloudWatch対応
各種メトリクスを60秒間隔で取得・確認可能
• ホスト層のメトリクス( CPU, Memory, etc. )
• ストレージのメトリクス(IOPS, Queue Depth, etc.)
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Monitoring.html
- 35. © 2014 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
設定パラメータのカスタマイズ
パラメータグループ
• 複数のDBインスタンスに一括適用可能なパラメータ群
• DBエンジンごとにデフォルト設定を用意。
カスタマイズ
• 新たにパラメータグループを作成・編集し、DBインスタンスに
適用することでカスタマイズ可能
制約事項
• 一部パラメータは、変更不可
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html
- 36. $ aws rds modify-db-instance
--db-instance-identifier test-db
--db-instance-class db.m2.4xlarge
--apply-immediately
© 2014 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
スケールアップ機能
マネージメントコンソールやAPIからスケールアップ可能
• インスタンスrebootを伴う
• コマンドライン(AWS CLI)からも可能
スケールダウンももちろん可能
• 一時的に大きくして、その後戻す、といった運用
• 開発DBを日中だけ大きくして使わない夜間は小さくする運用
スペックの範囲
• 最小: db.t2.micro (1vCPU, 1GBメモリ)
• 最大: db.r3.8xlarge( 32vCPU, 244GBメモリ)
スケールアップ
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeInstance.html
- 37. © 2014 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
標準ストレージ
EBSボリュームベースのDBストレージ
• データベースとログの格納に利用
• ストライピングした複数のEBSボリュームで構成
• サイズを増量するとボリューム数が増え、IOPS性能が向上
• ストレージサイズを動的に(オンラインで)増量可能
DBエンジンサイズ動的増量
PostgreSQL 5GB-3TB
✔
MySQL 5GB-3TB
✔
Oracle 10GB-3TB
✔
SQL Server( Web , Ex) 20GB-1TB
SQL Server (SE, EE) 200GB-1TB
- 38. © 2014 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
プロビジョンドIOPS (PIOPS)ストレージ
高性能なストレージオプション
• ストレージパフォーマンスの性能(IOPS)を指定可能
• 低レイテンシと高スループットを安定して実現
• 標準ストレージからオンラインでPIOPSに変更可能
• フェイルオーバー、クラッシュリカバリの時間短縮にも有効
DBエンジンIOPS サイズ動的増量
PostgreSQL 1000-30,000 100GB-3TB
✔
MySQL 1000-30,000 100GB-3TB
✔
Oracle 1000-30,000 100GB-3TB
✔
SQL Server( Web , Ex) 1000-10,000 100GB-1TB
SQL Server (SE, EE) 1000-10,000 200GB-1TB
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.html
- 39. © 2014 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
プロビジョンドIOPS ストレージ(続き)
IOPSについての注意点
• 各DBエンジンの仕様、Page Sizeや仮想化技術の違いで実際の
IOPSは以下の表のような目安になる
• 大きいPIOPSで、低レイテンシ・高スループットが増す
• 小さなインスタンスタイプではストレージとのN/W帯域不足で
設定したIOPSに達しない場合がある(m3.xlarge以上を推奨)
DBエンジン
(最大サイズ、IOPS)
Page Size Max IOPS
PostgreSQL(3TB, 30,000) 8KB 25,000
MySQL(3TB, 30,000) 16KB 20,000
Oracle(3TB, 30,000) 8KB 25,000
SQL Server(1TB, 10,000) 8KB 10,000
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.ProvisionedIOPS.html#US
ER_PIOPS.Realized
※ Read 50%, Write 50%の場合
- 40. © 2014 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
主要な機能
信頼性向上
運用
性能
セキュリティ
- 41. © 2014 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
VPC対応
VPC内部の任意のサブネットで起動可能
• 起動する先のサブネットを、DB Subnet Groupで事前に定義
• Default VPC環境ではデフォルトで定義済み
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html
- 42. © 2014 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
アクセス制御
Security Groupで実現
• EC2インスタンスからDBインスタンスへのアクセス制御を実現
• アクセス元 EC2 インスタンスに適用しているSecurity Groupとの紐付け
によりアクセス可能になる
注意事項
• DBインスタンスの起動場所によって設定対象が異なる
• VPC Default環境では DB Security Groupの替りにSecurity Groupを使う
• DB Security Groupでは、アクセス元としてSecurity Groupのみ指定可能
起動場所設定対象
EC2 Classic DB Security Group
EC2 VPC VPC Security Group
VPC Default VPC Security Group
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.
html
- 43. PostgreSQL MySQL Oracle SQL Server
Multi-AZ ✔ ✔ ✔ △※
リードレプリカ✔ (GOLDEN GATE)
クロスリージョン
レプリカ
© 2014 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
DBエンジンごとの主要機能まとめ
※ Virginia, Oregon, Irelandリージョンでのみ可能
✔ (GOLDEN GATE)
Point-In-Time-
Recovery
✔ ✔ ✔ ✔
VPC ✔ ✔ ✔ ✔
Max Storage 3TB 3TB 3TB 1TB
Provisioned IOPS 30,000 30,000 30,000 10,000
- 44. © 2014 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
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
Agenda
- 45. © 2014 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
RDSアップデート一覧(2013-2014) 2013.4.18 Microsoft SQL Serverメジャーバージョンアップ機能
2013.4.18 Oracle Advanced Securityが利用可能に
2013.5.23 MySQLのリードレプリカの状態監視をサポート
2013.6.7 GA および SLAの発表
2013.6.10 料金値下げ(MySQL, Oracle Database, SQL Server)
2013.6.20 MySQLのメジャーバージョンアップグレード機能
2013.7.1 MySQL 5.6のサポート
2013.7.9 Amazon RDS のすべてのリソースにタグ付けをサポート
2013.7.9 Amazon RDS のリソースにリソースレベルのアクセス許可をサポート
2013.8.29 MySQLのリードレプリカ機能の拡張
(並列レプリカ作成、スナップショットとポイントインタイムリカバリ、2層のレプリカ)
2013.9.4 MySQL5.6で cr1インスタンスをサポート
2013.9.5 オンプレミス、RDS間のデータインポート/エクスポート機能
2013.9.18 モバイル版AWSコンソールがRDSをサポート
2013.9.26 Oracle Statspackが利用可能に
2013.10.31 リージョン間スナップショットコピーが利用可能に
2013.11.7 Microsoft SQL ServerでTDEが利用可能に
2013.11.14 PostgreSQLをサポート
2013.11.26 MySQLでクロスリージョン・リードレプリカを作成可能に
2014.1.13 Oracle Databaseでタイムゾーンオプションが利用可能に
2014.1.22 PostgreSQLでXML型とXML関数が利用可能に
2014.2.20 M3インスタンスをサポート
2014.4.1 料金値下げ(MySQL, Oracle Database, SQL Server, PostgreSQL)
2014.4.5 Oracle GoldenGateが利用可能に
2014.4.24 MySQL 5.5 から MySQL 5.6へのアップグレードをサポート
2014.5.21 SQL Serverにて、Multi-AZが利用可能に(一部リージョン)
2014.5.29 R3インスタンスをサポート
2014.7.23 PostgreSQLにて、Service Level Agreement とGeneral Availabilityを発表
2014.8.4 T2インスタンスをサポート
2014.9.4 MySQL 5.6でキャッシュウォーミング機能が利用可能に
http://aws.amazon.com/releasenotes/Amazon-RDS
- 46. © 2014 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
RDS全般(エンジン共通)
インスタンス
• R3追加
• M3追加
• T2追加
ボリューム
• gp2追加
可用性
• リージョン間スナップショットコピー機能
• GA化 (SLA対応)
運用
• モバイル版AWSコンソールに対応
• タグ対応
セキュリティ
• リソースレベルアクセス許可
- 47. © 2014 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
DBエンジン – MySQL-
バージョン
• 5.6対応
• 5.1から 5.5へのメジャーバージョンアップ機能
• 5.5から 5.6へのメジャーバージョンアップ機能
可用性
• クロスリージョンレプリカ機能
• 階層レプリカ 構成対応
• 並列レプリカ作成
性能
• キャッシュウォーミング機能
- 48. Buffer
Pool
Availability zone
ダンプ
リストア
© 2014 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
キャッシュウォーミング機能
MySQL5.6新機能、バッファプールのダンプ/リストアが使用
可能に!
• 起動直後のDBに対するアクセス性能劣化を防止
ダンプ/リストアのイメージ
使いどころ
• 再起動直後のパフォーマンス劣化を防止
— 停止前のダンプ、起動後のリストアで、再起動で消えるキャッシュを復元
— フェールオーバー、メンテナンス時の再起動の際に有用
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.InnoDBCacheWarming
- 49. => CALL mysql.rds_innodb_buffer_pool_dump_now();
© 2014 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
キャッシュウォーミング機能
注意点
• DB異常終了時、シャットダウン時のダンプ実行がされない可能性あり
使い方
1. 再起動時に自動的にバッファプールのダンプとリストアを行う場合
• 下記の設定値をParameter Groupsで設定する
– innodb_buffer_pool_dump_at_shutdown = 1
– innodb_buffer_pool_load_at_startup = 1
2. 任意のタイミングでバッファプールのダンプ、リストアを行う場合
• 下記の関数を実行する
– mysql.rds_innodb_buffer_pool_dump_now
– mysql.rds_innodb_buffer_pool_load_now
– mysql.rds_innodb_buffer_pool_load_abort
• 実行例
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.InnoDBCacheWarming
- 50. © 2014 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
DBエンジン – Oracle -
標準機能
• 11.2.0.3に対応
• Character Set ( JA16SJISTILDE, AL32UTF8, etc. )選択
• Oracle GoldenGate 利用可能
対応オプション
• Oracle Statspack
• Oracle Advanced Security(Native Network Encryption, Transparent Data Encryption)
• Oracle Time Zone
• 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
詳細情報
• https://aws.amazon.com/jp/rds/oracle/
- 51. © 2014 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
Oracle Statspack
Oracle StatspackによるDBの性能監視が可能に!
• Oracle Statspackとは
• 必要な期間におけるパフォーマンス統計データを出力するツール
• スリークエリの発見やチューニングに役立つ情報を取得可能
• RDSでの使い方
• RDS for Oracleの全てのバージョン、エディションで利用可能
• Option Groupで有効にする
• 詳細は以下を参照
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appen
dix.Oracle.Options.html#Appendix.Oracle.Options.Statspack
- 52. http://docs.aws.amazon.com/AmazonRDS/latest/
UserGuide/Appendix.OracleGoldenGate.html
© 2014 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
Oracle GoldenGate
Oracle GoldenGateを使用したレプリケーションが可能に!
• Oracle GoldenGateとは
• DB間のデータ連携を提供するツール
• ログからデータを抽出し、リモートのデータベースへ転送
• RDSでの使い方
• RDS for Oracleの全てのバージョン、エディションで利用可能
• EC2上にGoldenGate hubを立てる
• 詳しくは以下を参照
• 利用シナリオの例
• オンプレミスのDBデータをRDSへ
• EC2上のDBデータをRDSへ
• RDS上のDBデータを別のRDSへ(別リージョンへも可能!)
• RDS上のDBデータをオンプレミスのDBへ
- 53. © 2014 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
DBエンジン – SQL Server -
標準機能
• SQL Server Migration Assistant
• Database Engine Tuning Advisor (SE, EE, Web)
• SQL Server Agent
• SSL接続
• Multi-AZ対応(Virginia, Oregon, Irelandリージョン)
RDS オプション
• Transparent Data Encryption
バージョンアップ
• 2008 R2から 2012へのメジャーバージョンアップ機能
詳細情報
• https://aws.amazon.com/jp/rds/sqlserver/
- 54. © 2014 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
DBエンジン – PostgreSQL -
バージョン
• 9.3.1 - 9.3.3
標準機能
• SSL接続がデフォルトで有効
• 多くの拡張モジュールをインストール可能
• 拡張モジュールをインストールすることで利用できる機能の例
– プロシージャ
– データ暗号化
– 外部DBからのデータ取得
• PostGISをRDSオリジナルの拡張モジュールとして提供
RDS機能
• Multi-AZ, プロビジョンドIOPSなどの主要なRDSの機能をサポート
詳細情報
• https://aws.amazon.com/jp/rds/postgresql/
- 55. => SHOW rds.extensions;
© 2014 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
拡張モジュール(contrib)
btree_gin earthdistance pgrowlocks sslinfo
btree_gist fuzzystrmatch pg_trgm tablefunc
chkpass hstore plperl tsearch2
citext intagg plpgsql unaccent
cube intarray pltcl uuid-ossp
dblink isn postgis
dict_int ltree postgis_tiger_geocoder
dict_xsyn pgcrypto postgis_topology
- 56. 手続き言語(プロシー
ジャ)を使用できる。
=> SHOW rds.extensions;
Key-Value形式でデ
ータを格納できる
© 2014 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.
56
拡張モジュール(contrib)
btree_gin earthdistance pgrowlocks sslinfo
btree_gist fuzzystrmatch pg_trgm tablefunc
chkpass hstore plperl tsearch2
citext intagg plpgsql unaccent
cube intarray pltcl uuid-ossp
dblink isn postgis
dict_int ltree postgis_tiger_geocoder
dict_xsyn pgcrypto postgis_topology
GIS (地理情報システ
ム) オブジェクトを扱
うことができる
データを暗号/複合化
できる
外部のPostgreSQLに
アクセスできる
• その他の拡張モジュールについては以下を参照。
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#SQLServ
er.Concepts.General.FeatureSupport
- 57. (例)
© 2014 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.
57
拡張モジュールのインストール方法
下記のSQLで拡張モジュールをインストールできる
=> CREATE EXTENSION [拡張モジュール名];
=> CREATE EXTENSION dblink;
CREATE EXTENSION
- 58. © 2014 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.
58
Tips
ロケールの設定
• RDS for PostgreSQLのデフォルトのロケール:「en_US」
→ 日本語を使う場合、インデックスが使われないなど、問題となる可
能性があるため、データベースLaunch後に、ロケールを設定したデー
タベースを作り直す必要がある。
=> CREATE DATABASE newdb WITH template template0 encoding
'utf8' lc_collate 'C' lc_ctype 'C’;
※ 日本語を使用する場合は、ロケールにCを設定するとよい
- 59. © 2014 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.
59
Tips
タイムゾーンの設定
• デフォルトは UTC
• パラメータグループで
Asia/Tokyo を設定するとJSTに
変更可能
- 60. © 2014 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.
60
Tips
クライアント認証設定
• pg_hba.confではなく、Security Groupで制御
→ アクセス元は、Security Groupで設定
データベースごと、DBユーザごとのアクセス権限設定が
必要な場合は、EC2上にPostgreSQLをたてる必要がある。
- 61. © 2014 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.
61
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
Agenda
- 62. © 2014 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.
62
RDSの料金体系
DBインスタンス利用時間 ($/時間)
• 標準配備 or Multi-AZ
• BYOL or ライセンス込 ( Oracle, SQL Server )
ストレージ
• ストレージ容量($/GB/月) とI/O料金
• 標準ストレージ or PIOPS
• 標準配備 or Multi-AZ
• バックアップストレージ容量($/GB/月)
• I/Oリクエスト数(標準ストレージ) or PIOPS
ネットワーク
• RDSからインターネット経由で送信したバイト数 ($/GB)
http://aws.amazon.com/jp/rds/pricing/
- 63. © 2014 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.
63
2つの価格モデル
オンデマンド DB インスタンス
• 通常の時間単位の課金
Amazon RDS リザーブドインスタンス(RI)
• 予約金を支払うことで時間当たり価格を割引(最大70%節減)
• 全てのエンジンに対応
• RI購入時に以下を指定
• リージョン、DBエンジン、DBインスタンスクラス、デプロイメン
トタイプ(マルチAZ or シングルAZ)、期間(1年 or 3年)
• Oracle, SQL Serverは、ライセンス込みかBYOLを指定
http://aws.amazon.com/jp/rds/reserved-instances/
- 64. © 2014 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.
64
Multi-AZ 値下げ!
2013年6月 最大28%の値下げ。
2014年4月 平均28%の値下げ。
http://aws.typepad.com/aws_japan/2013/06/amazon-rds-price-reduction-on-demand-and-reserved.html
http://aws.typepad.com/aws_japan/2014/03/aws-price-reduction-42-ec2-s3-rds-elasticache-and-elastic-mapreduce.html
- 65. © 2014 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.
65
Simple Monthly Calculator
Webフォームで概算費用を試算できます
§ http://calculator.s3.amazonaws.com/index.html?lng=ja_JP
- 66. © 2014 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.
66
AWS無料試用枠
AWSでは、無料試用枠( Free Tier)を用意しています
• http://aws.amazon.com/jp/free/
RDSでの無料試用枠 適用条件
• PostgreSQL, MySQL, Oracle (BYOL), SQL Server Express
• Single-AZ db.t1.micro 750時間/月
• スタンダードストレージ20GB (スナップショット20GB含む)
• 1,000万 I/O
• https://aws.amazon.com/jp/rds/free/
- 67. © 2014 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.
67
今日のAgenda
Amazon RDSの概要
Amazon RDSの主要機能について
Amazon RDSの新機能紹介
料金モデル
まとめ
Agenda
- 68. PostgreSQL MySQL Oracle SQL Server
Multi-AZ ✔ ✔ ✔ △※
リードレプリカ✔ (GOLDEN GATE)
クロスリージョン
レプリカ
© 2014 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.
68
DBエンジンごとの主要機能まとめ(再掲)
※ Virginia, Oregon, Irelandリージョンでのみ可能
✔ (GOLDEN GATE)
Point-In-Time-
Recovery
✔ ✔ ✔ ✔
VPC ✔ ✔ ✔ ✔
Max Storage 3TB 3TB 3TB 1TB
Provisioned IOPS 30,000 30,000 30,000 10,000
- 69. © 2014 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.
69
各種制限
デフォルトで制限がかかっています。
• http://docs.aws.amazon.com/general/latest/gr/aws_servi
ce_limits.html#limits_rds
• (例)
• RDSインスタンス数: 40
• リードレプリカ数: 5
• 手動スナップショット数: 50
• ストレージ総量: 100TB
必要に応じて、上限緩和申請をお願いします
• https://aws.amazon.com/jp/contact-us/
- 70. © 2014 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.
70
参考文献
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
ディスカッション・フォーラム
• https://forums.aws.amazon.com/forum.jspa?forumID=60
ブログ
• Amazon Web Services Japan blog
• http://aws.typepad.com/aws_japan/
• AWS Solutions Architect ブログ
• http://aws.typepad.com/sajp/
- 71. © 2014 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.
71
24時間・365日での日本語サポートの提供
日本語でのサポートをご提供しております
http://aws.amazon.com/jp/premiumsupport/
ベーシックデベロッパービジネスエンタープライズ
受付時間24時間 / 365日(年中無休)
初回応答時間セルフサービス12時間
(営業時間内) 1時間15分
サポート連絡先N/A 1人5人無制限
チャット不可不可可能可能
TEL 不可不可可能可能
専任スタッフなしなしなしあり
料金(月額) 無料(AWSの利用料に
含まれる) $49/月
AWS利用総額の
10%~
※最低料金:$100/月
AWS利用総額の
10%~
※最低$15,000/月
- 72. © 2014 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.
72
Webinar資料の配置場所
AWS クラウドサービス活用資料集
• http://aws.amazon.com/jp/aws-jp-introduction/
- 73. © 2014 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.
73
ご参加ありがとう
ございました。
- 74. © 2014 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.
74
Appendix ~ RDS for PostgreSQL
RDS 独自のパラメータ
• 素のPostgreSQLにはないRDS独自のパラメータを以下に示しま
す。
パラメータ概要変更可否
rds.extensions RDSで使用できる拡張モジュール
の一覧。
不可
rds.log_retention_period ログの保持期間可
- 75. © 2014 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.
75
Appendix ~ RDS for PostgreSQL
日本語での全文検索
• RDSではPostgreSQL組み込みのテキスト検索機能やcontrib/trgm
が使用できます。しかし、これらは日本語での検索に対応していな
いため、現状、日本語の全文検索をRDS上で行うことはできませ
ん。
ストリーミング・レプリケーション
• PostgreSQL組み込みのレプリケーションを使用することはできま
せん。そのため、リードレプリカを持つこともできません。