Page 1
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アマゾン ウェブサービス ジャパン 株式会社
2018.01.16
【AWS Black Belt Online Seminar】. AWS re:Invent 2017 Recap Machine Learning / Database
Page 2
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
所属:アマゾンウェブサービスジャパン株式会社
業務:ソリューションアーキテクト(データサイエンス領域)
経歴:Hadoopログ解析基盤の開発データ分析データマネジメントや組織のデータ活用
志村 誠 (Makoto Shimura)
Page 3
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Black Belt Online Seminar とは
AWSJのTechメンバがAWSに関する様々な事を紹介するオンラインセミナーです
【火曜 12:00~13:00】主にAWSのソリューションや業界カットでの使いどころなどを紹介(例:IoT、金融業界向け etc.)
【水曜 18:00~19:00】主にAWSサービスの紹介やアップデートの解説(例:EC2、RDS、Lambda etc.)
※開催曜日と時間帯は変更となる場合がございます。最新の情報は下記をご確認下さい。
オンラインセミナーのスケジュール&申し込みサイト• https://aws.amazon.com/jp/about-aws/events/webinars/
Page 4
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容についての注意点
本資料では2018年1月16日時点のサービス内容および価格についてご説明しています。最新の情報はAWS公式ウェブサイト (http://aws.amazon.com/) にてご確認ください。
• 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます
• 価格は税抜表記となっています。日本居住者のお客様が東京リージョンを使用する場合、別途消費税をご請求させていただきます
AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
Page 5
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Machine Learning
Page 6
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Services Amazon
Rekognition
Amazon
Polly
Amazon
Lex
PlatformAmazon
Machine
Learning
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
Apache Spark
&
Amazon EMR
Amazon
KinesisAWS
Batch
Amazon
ECS
MXNet
AWS Deep Learning AMI
AWS が提供する ML サービススタック
Page 7
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ServicesAmazon
Rekognition
Image
Platform
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
MXNet
AWS Deep Learning AMI (Amazon Linux / Ubuntu / Windows)
AWS が提供する MLサービススタック
Amazon
Polly
Amazon
Lex
Amazon
Comprehend
Amazon
Translate
Amazon
Transcribe
Amazon
Rekognition
Video
Amazon
Machine
Learning
Apache Spark
Amazon EMR
Amazon
KinesisAWS Batch Amazon ECS
Amazon
SageMaker
Page 8
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML Services
Page 9
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ServicesAmazon
Rekognition
Image
Platform
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
MXNet
AWS Deep Learning AMI (Amazon Linux / Ubuntu / Windows)
AWS が提供する MLサービススタック
Amazon
Polly
Amazon
Lex
Amazon
Comprehend
Amazon
Translate
Amazon
Transcribe
Amazon
Rekognition
Video
Amazon
Machine
Learning
Apache Spark
Amazon EMR
Amazon
KinesisAWS Batch Amazon ECS
Amazon
SageMaker
Page 10
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS ML Services Portfolio
大カテゴリ 小カテゴリ サービス名
映像画像認識 Amazon Rekognition
動画認識 Amazon Rekognition Video
音声Speech-to-Text Amazon Transcribe
Text-to-Speech Amazon Polly
自然言語
自然言語理解 Amazon Comprehend
テキスト翻訳 Amazon Translate
チャットボット Amazon Lex
New !
New !
New !
New !
Page 11
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Rekognition Video
Page 12
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
動画解析サービス Amazon Rekognition Video の提供開始
• S3 に蓄積された動画や,ライブストリーミング動画に対してさまざまな分析機能を提供する
• ビデオのサイズは,最大 8GB までをサポート
• H264 コーデックで,拡張子が .mp4 / .mov の必要あり
• バージニア北部,オレゴン,アイルランドで提供
• 動画 1 分につき $0.10〜,ストリーム 1 分につき $0.12〜また顔のメタデータ 1000 個につき $0.01/month
Page 13
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
物体・動作・ラベルの
検出
人物のトラッキング
顔認識 リアルタイムのライブ
ストリーミング
不適切なコンテンツの
認識
有名人の認識
Amazon Rekognition Video
Page 14
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
分析の結果得られるレスポンス
• 結果は JSON で返される
• “Timesamp” がついており,どの時点でその認識処理が行われたかを記録
• さまざまな分析結果がJSON 内に合わせて格納されている
• ライブストリーミングの場合は,1 フレーム 1 レコードで Kinesis Data Stremas にデータを送る
Page 15
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース: 動画データを検索しやすく
ユーザーがアップロードした動画に対して定期的にタグ付けを行い,後から簡単に検索できるようにする
Page 16
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Comprehend
Page 17
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自然言語理解サービス Amazon Comprehend の提供開始
• 入力されたテキストに対して,さまざまな分析を実施
• 英語とスペイン語に対応
Page 18
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
入力した文章を分析
Page 19
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
分析結果
エンティティの抽出 キーフレーズの抽出
Page 20
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
分析結果
言語の認識 センチメント分析
Page 21
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
バッチデータに対するトピックモデリング
Page 22
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース: カスタマーの声を分析
Twitter 等のデータを読み込んで Comprehend でタグ付けや分類を行い,Redshift で分析
Page 23
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Translate
Page 24
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
多言語間翻訳サービス Amazon Translate プレビュー開始
• 深層学習に基づいた,高品質な多言語間翻訳サービス Amazon Translateのプレビューを開始
– Encoder-decoder + attention model
• Polly や Lex との連携による多言語対応サービスの構築が可能に
• バージニア北部,オハイオ,オレゴンでプレビューを提供
アラビア語中国簡体字フランス語ドイツ語
ポルトガル語スペイン語
英語英語
Page 25
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Translate による翻訳
Page 26
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Transcribe
Page 27
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Speech-to-Text サービス Amazon Transcribe のプレビュー開始
• テキストを文章に変換するマネージドサービス
• リアルタイム処理のみならず,S3 に格納された音声データの処理もサポート
• プレビューでの対応言語は英語とスペイン語
Page 28
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Transcribe の特徴
通常音声と電話音声の両方をサポート
カスタム語彙を登録することが可能
発話されたタイムスタンプと,書き起こしの信頼度を出力
複数話者の認識や句読点の自動補完
Page 29
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
タイムスタンプと信頼度
1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0
“Hi, I would like to reschedule my flight to Seattle to later tonight”
3.480 sec
Confidence : 1
6.402 sec
Confidence : 0.95
10.541 sec
Confidence : 1
Page 30
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
句読点の補完
please extrapolate the projections based on market growth
and segment share can you email it to me once you are
done
Please extrapolate the projections based on market
growth and segment share. Can you email it to me once
you’re done?
Page 31
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース: コールセンターの音声データの可視化
AWS Lambda
Amazon S3
Amazon
Athena
Audio Input
Amazon
QuickSight
Amazon
Comprehend
Amazon
Transcribe
Page 32
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS ML Services Portfolio
大カテゴリ 小カテゴリ サービス名
映像画像認識 Amazon Rekognition
動画認識 Amazon Rekognition Video
音声Speech-to-Text Amazon Transcribe
Text-to-Speech Amazon Polly
自然言語
自然言語理解 Amazon Comprehend
テキスト翻訳 Amazon Translate
チャットボット Amazon Lex
New !
New !
New !
New !
Page 33
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML Platform
Page 34
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ServicesAmazon
Rekognition
Image
Platform
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
MXNet
AWS が提供する ML サービススタック
Amazon
Polly
Amazon
Lex
Amazon
Comprehend
Amazon
Translate
Amazon
Transcribe
Amazon
Rekognition
Video
Amazon
Machine
Learning
Apache Spark
Amazon EMR
Amazon
KinesisAWS Batch Amazon ECS
Amazon
SageMaker
AWS Deep Learning AMI (Amazon Linux / Ubuntu / Windows)
Page 35
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Kinesis Video Streams
Page 36
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
数多くの動画ストリームのインジェストを実現するAmazon Kinesis Video Streams の提供開始
• 大量のカメラ(的な)デバイスからアップロードされる,動画ストリームや時系列データを容易に取り扱うことができるマネージドサービス
• デバイス側は Producer SDK を利用して,Kinesis Video Streamsにデータを送信し,Consumer で取得して処理する
• バージニア北部,オレゴン,アイルランド,フランクフルト,東京リージョンで利用可能
Page 37
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kinesis Video Streams の流れ
ストリームとして動画を取得し,S3 に保存.ダッシュボードで確認したり,コンシューマで処理を行うことが可能
Page 38
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース: スマートシティ
街中の監視カメラを取得し,Rekognition と連携することで,車のナンバープレートをインデックスとして集約
Page 39
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker
Page 40
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
end-to-end のフルマネージド機械学習サービスAmazon SageMaker の提供開始
• データサイエンティストや開発者が,容易に機械学習モデルを構築・学習・活用するためのマネージドサービス
• バージニア北部,オハイオ,オレゴン,アイルランドで提供
Page 41
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
機械学習の基本的な流れ
開発 学習 推論
大量の GPU
大規模データの処理
試行錯誤の繰り返し
可視化や集計
機械学習コードを記述
サンプルデータで動作
大量の GPU と CPU
継続的なデプロイ
IoT デバイスで動作
Page 42
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker の構成要素
開発
• コンソール上から簡単に必要なライブラリを含んだインスタンスを起動して,ノートブックによる開発が可能
• アルゴリズム開発を高速に実施可能
• 足りないライブラリは後から追加可能
学習
• 指定したインスタンスタイプで Docker イメージを起動して学習を実行
• 複数インスタンスで分散学習を容易に実行
• ビルトインアルゴリズムやサンプル実装も豊富に用意
推論
• モデルをデプロイして,エンドポイントから推論が可能
• モデルを動作させるDocker イメージとインスタンスタイプを指定可能
• エンドポイントはオートスケーリング,ABテスト機能を持つ
Page 43
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon SageMaker の構成要素
43
開発
• コンソール上から簡単に必要なライブラリを含んだインスタンスを起動して,ノートブックによる開発が可能
• アルゴリズム開発を高速に実施可能
• 足りないライブラリは後から追加可能
学習
• 指定したインスタンスタイプで Docker イメージを起動して学習を実行
• 複数インスタンスで分散学習を容易に実行
• ビルトインアルゴリズムやサンプル実装も豊富に用意
推論
• モデルをデプロイして,エンドポイントから推論が可能
• モデルを動作させるDocker イメージとインスタンスタイプを指定可能
• エンドポイントはオートスケーリング,ABテスト機能を持つ
各要素をそれぞれ個別に利用することも可能また,全て使って一気通貫で機械学習システムを
構築することも可能
Page 44
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ノートブックインスタンスによる素早い開発
マネジメントコンソールからインスタンスを立ち上げて,インスタンス上の Jupyter Notebook にアクセス
(1)
(2)
Page 45
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
開発学習推論
の流れ
Page 46
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
開発
1. ノートブック上で開発を行う2. 作成した学習用のコードを Docker イメージにパッケージする3. 作成したイメージを ECR にパブリッシュする
Page 47
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
学習
1. ノートブックインスタンスから,トレーニングジョブを実行2. SageMaker が ECR からイメージを pull して,S3 上のデータ
を使って学習を実施(GPU インスタンスを使うことも,複数インスタンスで分散学習させることも可能)
3. 学習が終了したら,S3 にモデルを出力して終了
Page 48
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
推論
1. 推論用の Docker イメージを作成して,ECR にパブリッシュ2. ノートブックインスタンスから,作成済みデプロイのデプロイを実施3. SageMaker が ECR からイメージを pull して,指定したインスタン
ス数だけ立ち上げ,エンドポイントを設定4. エンドポイントに対して,推論のリクエストを投げることが可能
開発学習推論
の流れ
Page 49
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML Engine
Page 50
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ServicesAmazon
Rekognition
Image
Platform
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
MXNet
AWS が提供する ML サービススタック
Amazon
Polly
Amazon
Lex
Amazon
Comprehend
Amazon
Translate
Amazon
Transcribe
Amazon
Rekognition
Video
Amazon
Machine
Learning
Apache Spark
Amazon EMR
Amazon
KinesisAWS Batch Amazon ECS
Amazon
SageMaker
AWS Deep Learning AMI (Amazon Linux / Ubuntu / Windows)
Page 51
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deep Learning AMI for Windows
Page 52
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deep Learning AMI for Windows の提供開始
• これまで Amazon Linux / Ubuntu のみの提供だった Deep Learning AMI が Windows でも提供されるように
• サポート対象 OS は Microsoft Windows Server 2012 R2 and 2016
• 主要なディープラーニングフレームワークをサポート
Page 53
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ML Infrastructure
Page 54
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ServicesAmazon
Rekognition
Image
Platform
FrameworksTensorFlow Caffe Torch Theano CNTK Keras
CPU IoT MobileInfrastructure GPU
MXNet
AWS が提供する ML サービススタック
Amazon
Polly
Amazon
Lex
Amazon
Comprehend
Amazon
Translate
Amazon
Transcribe
Amazon
Rekognition
Video
Amazon
Machine
Learning
Apache Spark
Amazon EMR
Amazon
KinesisAWS Batch Amazon ECS
Amazon
SageMaker
AWS Deep Learning AMI (Amazon Linux / Ubuntu / Windows)
Page 55
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS DeepLens
Page 56
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ディープラーニングモデルで推論可能なビデオカメラデバイスAWS DeepLens を提供開始
• ディープラーニングの開発を加速するための,カメラデバイス
• 内蔵されたコンピューティングリソースで深層学習モデルによる推論を実現
Page 57
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Greengrass ML Inference
Page 58
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
エッジデバイスで機械学習モデルの活用を容易にするAWS Greengrass ML Inference のプレビュー開始
AWS Greengrass が稼働するエッジデバイスで,MXNet による深層学習モデルなどの,学習済み機械学習モデルをデプロイ・利用可能に
Page 59
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary
Page 60
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• AWS では 4 レイヤーからなる,さまざまな機械学習サービスを提供
• re:Invent で新たに 9 個の新サービスを提供開始
• これらを活用することで,AWS 上で機械学習システムを構築するのがますます容易に
Services
Platform
Frameworks
Infrastructure
Page 61
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Database Services Update
Page 62
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自己紹介
星野 豊 (ほしの ゆたか)
• Aurora/RDS(MySQL)Specialist SA
@con_mame conmame
• Amazon Aurora / OSSデータベースを主に担当
Page 63
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
おすすめ新サービス・新機能!!
Page 64
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptune
Page 65
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベースサービスの拡充
Amaz on Ne p t u n e
G R A P H
Amaz on Dy n amoDB
A maz on E l a s t i C a c h e
K E Y V A L U E
D O C U M E N T
I N - M E M O R Y S T O R E
A U R O R A
A maz on RDS
C O M M E R C I A L C O M M U N I T Y
Relational databases Non-relational databases
Page 66
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptune
• Apache TinkerPopとW3C RDF Graph modelをサポート
• 億単位のリレーションを保管した状態で、ミリ秒程度のレイテンシ
• 3AZで6つのレプリカを構成し、バックアップとリストアもサポート
• GremlinとSPARQLで簡単に強力なクエリを構築可能
• 対応リージョン: バージニア
Page 67
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptune preview
Fully managed graph database for highly connected data
Fast & Scalable ReliableOpen
10億のリレーションを保持可能で、クエリはmillisecondの
レイテンシ
6つのデータのレプリカを3AZに保存し、バックアップとリストア
サポート
Gremlin と SPARQLでクエリを作成可能
Apache TinkerPopTM & W3C RDF graph models
GremlinSPARQL
Easy
Page 68
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
HIGHLY CONNECTED DATA
Retail Fraud DetectionRestaurant RecommendationsSocial Networks
Page 69
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora MySQL-compatible edition
Page 70
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora Multi-Master preview
• 複数のデータセンターをまたぎ、Read/Write両方でスケールアウト可能なリレーショナルデータベース
• AZで障害や、いずれかのインスタンスが停止しても、アプリケーションでリトライを即時に行うことでダウンタイムを0に
• シングルリージョン・マルチマスターは、11/29にプレビュー開始
• マルチリージョン・マルチマスタ対応は2018年を予定
Availability Zone 1
Scale out both reads and writes
Availability Zone 2
Availability Zone 3
Application
Read/Write Master 1
Shared distributed storage volume
Read/Write Master 2
Read/Write Master 3
Page 71
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hierarchical conflict resolution
両方のマスターが2つのページP1とP2に書き込みを行う
BLUE マスターが page P1のクォーラムで勝ち; ORANGE マスターがP2のクォーラムで勝つ
どちらのマスターも競合を認識し、た場合2つの選択肢がある1. トランザクションをロールバッ
クするか2. リージョナルリゾルバにエスカ
レートする
リージョナルアービトレータがタイブレーカの勝者を決定する
2 3 4 5 61
BT1 [P1]
OT1 [P1]
2 3 4 5 61
OT1[P2]
BT1[P2]
PAGE1 PAGE2
MASTER MASTER
BT1 OT1
Regional resolver
Page 1Page 2 Page 1Page 2
Quorum
X X
Page 72
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Mult i-region Mult i -Master
書き込みはローカルのみ受付
オプティミスティックコンカレンシコントロール - 分散ロックマネージャなし、チャットロック管理プロトコルなし
REGION 1 REGION 2
HEAD NODES HEAD NODES
MULTI-AZ STORAGE VOLUME MULTI-AZ STORAGE VOLUME
LOCAL PARTITION LOCAL PARTITIONREMOTE PARTITION REMOTE PARTITION
競合は、ヘッドノード、ストレージノード、AZおよび地域レベルのアービトレータ
競合が発生していないか、または低い場合、ほぼ直線的なパフォーマンスのスケーリング
Page 73
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora Serverless preview
• 事前にインスタンスサイズを選ぶ代わりに、エンドポイントを作成し最小・最大キャパシティを設定することで負荷に応じて自動的にスケールアウト・インが行われる
• 5秒程度で完了• エンドポイントはproxyとして動作
• コンピュートパワーとメモリに応じて決定されるCapacity Unitsに応じて課金
• 課金は1秒単位で行われ、新規に追加されるリソースに対しては最小1分から開始
• 1日や1週間の間に数時間、もしくは数分の間にリクエストがスパイクするようなワークロードの割り込みがあったり予測が難しいケース向け。定常的にリクエストが予測できる場合は通常のAuroraの利用がおすすめ
• セールや不定期イベント、オンラインゲームや日時・週次のレポーティング、dev/test、新規アプリケーション
Page 74
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora Serverless
オンデマンドで起動し、使用していないときはシャットダウン
自動的にスケールアップ/ダウン
スケーリング時のアプリケーションへの影響なし
秒単位の課金、最低1分
WARM POOL OF INSTANCES
APPLICATION
DATABASE STORAGE
SCALABLE DB CAPACITY
REQUEST ROUTER
DATABASE END-POINT
Page 75
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Instance provisioning and scaling
最初のリクエストによってインスタンスのプロビジョニングする. 約 1-3 seconds
ワークロードの変更に応じてインスタンスが自動スケールアップおよびダウン. 約1-3 seconds
ユーザが設定した非アクティブ期間の後にインスタンスを休止する
スケーリング操作はアプリケーションに透過的。ユーザーセッションは終了ない
データベースストレージは、ユーザーによって明示的に削除されるまで保持される
DATABASE STORAGE
WARM POOL
APPLICATION
REQUEST ROUTER
CURRENT INSTANCE
NEW INSTANCE
Page 76
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Batched scans Lab mode(from 1.16)
MySQLでは行をに1行ずつ評価するためオーバヘッドが以下のような理由で大きくなる:
• ファンクションコールの増加• ロックとラッチ• カーソルストアとリストア• InnoDBとMySQL間でフォーマッ
トの変換
Amazon Auroraはテーブルスキャン、インデックスフルスキャン、インデックスレンジスキャンを行う際にInnoDB buffer pool からタプルをまとめて読み込む
Latency improvement factor vs. Batched Key Access (BKA) join algorithm Decision support benchmark,
R3.8xlarge
1.78X
-
0.20
0.40
0.60
0.80
1.00
1.20
1.40
1.60
1.80
2.00
Que
ry-1
Que
ry-2
Qu
ery
-3
Qu
ery
-4
Qu
ery
-5
Que
ry-6
Que
ry-7
Que
ry-8
Que
ry-9
Que
ry-1
0
Que
ry-1
1
Que
ry-1
2
Que
ry-1
3
Que
ry-1
4
Que
ry-1
5
Que
ry-1
6
Que
ry-1
7
Que
ry-1
8
Que
ry-1
9
Que
ry-2
0
Que
ry-2
1
Que
ry-2
2
Page 77
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hash Joins Lab mode (from 1.16)
Latency improvement factor vs. Batched Key Access (BKA) join algorithmDecision support benchmark, R3.8xlarge, cold buffer cache (lower improvement if all data cached)
8.22
-
1.00
2.00
3.00
4.00
5.00
6.00
7.00
8.00
9.00
Hash join used in queries 2, 3, 5, 7, 8, 9, 10, 11, 12, 15, 16, 17,18, 19, 21
Page 78
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Parallel query coming soon
Auroraストレージは数千のCPUコアを持っている
ストレージ・フリートを使用して問合せ処理をプッシュダウンおよび並列化す
データに近い箇所で処理を実行することで、ネットワークのトラフィックとレイテンシが減少
大きなチャレンジとしては
• ストレージノードに格納されているデータはレンジ分割されていないため、フルスキャンが必要
• データは動的に変更されている
• Read viewsは最新のデータを見ることが出来ないこともある
• 全てのファンクションがプッシュダウン出来るわけではない
これらの問題を解決するための様々な仕組みを導入
DATABASE NODE
STORAGE NODES
PUSH DOWN PREDICATES
AGGREGATERESULTS
Page 79
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Parallel query coming soon
Latency (seconds)Decision support benchmark, R3.8xlarge, cold buffer cache
Improvement factor with Parallel Query
24.6x
18.3x
5.0x
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Aggregate + 2-table join
Aggregate query
Point query on non-indexed column
With Parallel Query Without Parallel Query
Page 80
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Relational Database Service (RDS)
Page 81
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS MySQLをバックアップから起動可能に
• Percona Xtrabackupを利用して作成したバックアップデータを利用してオンプレミス環境やAmazon EC2上のMySQL5.6からAmazon RDS MySQLへ移行する
• バックアップデータをS3にアップロードし、そのデータを利用• アップロードにはManagement ConsoleやCLI tools、データサイズが大きい場合はAWS
Import/Export Snowballを利用してS3へ転送する
• MySQLからRDS for MySQLへレプリケーションを行う機能と合わせて利用することで、アプリケーションのダウンタイムを短縮可能
Page 82
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDS for Oracle/MySQL/MariaDB が新しいR4、T2、M4インスタンスに対応
• R4インスタンスに対応
• r4.16xlargeが追加され、RDS for Oracle で使用できる最大インスタンスサイズが64 vCPU + 488GB に拡大
• そのほか t2.xlarge, t2.2xlarge, m4.16xlarge が対応インスタンスに追加
• m4インスタンスファミリーはElastic Network Adapter (ENA) を搭載し、最大25Gbps/EBSには10Gbpsの帯域
• RDS for SQL ServerもR4/M4インスタンスファミリーに対応
Page 83
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS for MySQL, MariaDB, Oracle, PostgreSQLのストレージサイズを16TBまでサポート
• 今まで6TBまでだったEBSが16TBまでサポート
• gp2のIOPSと容量の割合が10:1から50:1へ
• 40,000IOPSまで拡張
• Amazon Elastic Block Store (Amazon EBS) Elastic Volumesを使うことでストレージの変更時間を今までよりも高速化
Page 84
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS for SQL Serverのストレージサイズを16TBまでサポートなど
• 今まで4TBまでだったEBSが16TBまでサポート
• gp2のIOPSと容量の割合が10:1から50:1へ
• スナップショットから復元時にボリュームタイプとプロビジョニンドIOPSを再設定可能
• オンラインでの変更は未対応
• オンラインでのストレージサイズの変更も可能に
• 数分のダウンタイムが発生する点注意
Page 85
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB
Page 86
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DynamoDB Global Tables
• 複数リージョンに配置したDynamoDBのテーブル間でレプリケーションを行ったり、Multi Masterとして複数リージョンで書き込みが可能に
• DynamoDB Streamsを裏側では利用しEventual consistency・非同期で更新が行われ、最後に書き込まれたの物が利用される
• ほぼ1秒程度でレプリケーションが完了する• ディレイを確認するメトリクスを2つ提供
• テーブルが空の状態から設定する必要があり、hash keyやテーブル名は同一に揃える
• TTLやGSI/LSIは揃えることが推薦• Auto Scalingに関しては自動で設定される• Write Capacity Unitはレプリケーションされて
くるデータの量も考慮して設定する
• バージニア、オハイオ、アイルランド、フランクフルトリージョンで利用可能
Page 87
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DynamoDB backup&restore
• 長期間のarchiveやデータを長期間保持を支援する• 長期的なデータアーカイブやコンプライアンス対応のため
のオンデマンドバックアップをサポート
• バックアップのためにキャパシティの消費は無く、性能に影響を与えない
• バックアップ対象は、テーブル中のデータ、provisioned capacityの設定、LSI/GSI情報、Streams
• 暗号化されて保存される• Auto ScalingやTTL、tag、IAMポリシー、CWメトリクス
やアラームは含まれない• スナップショットを取得し更新ログを保存する
• リストア時間は30分から容量に応じて数時間
• PITRも対応予定
• バージニア、オレゴン、オハイオ、アイルランドリージョンで利用可能
Page 88
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ElastiCache
Page 89
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ElastiCache for RedisOnline Resizing for Redis Clusters
• Elasticache for Redis cluster でOnline Resizeができるようになり、シャードの数を運用しながら増やし、増やしたシャード数での負荷の平準化を行えるように
• 今までElasticache for Redis cluster では、Cold Resizeしかできず、もしデータが溜まってきたり、アクセス数が増えてシャードを増やしたい、もしくは減ってきて減らしたい、となってもサービスの瞬断を伴うものとなっていた
• 最大6.1TiBまでのクラスタが作成可能
Page 90
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Redshift
Page 91
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Short Query Acceleration (SQA)
• ETL処理の様な実行時間の長いクエリの後に短時間で終わるはずの、ショートクエリがキューイングされると、ショートクエリの実行完了までの時間が想定よりも書かてってしまうことがあった
• 機械学習を使い、ショートクエリを判断することで、指定した時間以内で実行完了出来ると判断すると、自動的にショートクエリ用のWLMキューに移動する
• インタラクティブクエリやダッシュボードクエリなどの実行時間の短縮が期待できる。ワークロード依存ではあるが、内部のテストで3倍高速になったケースもある(CTASやSELECTクエリ)
• WLMの設定でSQAを有効にしmaximum run timeをキュー毎に設定(default 5秒, 1-20秒で設定可能)
• Tips: ユーザが設定したキューの合計でコンカレンシーやslot countは15以下にすることが推薦、キュー数が少ないほどSQAに効果的
Page 92
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Result Caching
• BIツールやダッシュボードなどから発行される定型的なクエリをキャッシュする事によってクエリのレスポンス速度を向上
• クエリキャッシュにヒットした場合は結果セットはキャッシュから返却されるため実際にクエリの実行は行われない
• 実際に実行が必要なクエリにリソースを割くことが出来る
• キャッシュにヒットさせるためにはデータの変更が行われておらずクエリも一致する必要がある。そうでない場合はクエリを実行し結果をキャッシュする
• enable_result_cache_for_sessionパラメーターで無効化可能
• SVL_QLOGテーブルにsource_queryカラムが追加され、キャッシュを実行したクエリIDを識別可能に
Page 93
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.