More Related Content Similar to [CTO Night & Day 2019] AWS Database Overview -データベースの選択指針- #ctonight
Similar to [CTO Night & Day 2019] AWS Database Overview -データベースの選択指針- #ctonight (20) More from Amazon Web Services Japan
More from Amazon Web Services Japan (20) [CTO Night & Day 2019] AWS Database Overview -データベースの選択指針- #ctonight1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Morning Session
AWS Database Overview
- データベースの選択指針 -
2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本セッションについて
AWSのデータベースサービスの特徴を理解し
適切なデータベースを選択できるようになる
3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
⾃⼰紹介
• 北村 聖児
• Amazon Web Service Japan K.K.
• Solution Architect
• Media & Entertainment
• 前職
• Server Side Engineer
• 好きなAWSサービス
• Amazon Connect
4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベース
5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1970 1980 1990 2000
Oracle DB2
SQL Server
MySQL
PostgreSQL
DynamoDB
Redis
MongoDB
Elasticsearch
Neptune
CassandraAccess
Aurora
2010
Timestream
QLDB
DocumentDB
6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
従来のアプリケーション要件
HR Payroll …
CRM ERP
従来要件 新要件
ユーザー: 10-10万 100万+
データ量: GB-TB TB-PB-EB
場所: 社内 グローバル
パフォーマンス: 秒 ミリ秒/マイクロ秒
リクエスト: 万 百万
アクセス: 社内サーバー モバイル/IoT
拡張: スケールアップ スケールアウト
⽀払い: 前払い 従量課⾦
開発者アクセス: ⽇次/週次/⽉次 APIアクセス
従来要件
7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
新しいアプリケーション要件
Social media
Ride hailing Media streaming
Dating
ユーザー: 10-10万 100万+
データ量: GB-TB TB-PB-EB
場所: 社内 グローバル
パフォーマンス: 秒 ミリ秒/マイクロ秒
リクエスト: 万 百万
アクセス: 社内サーバー モバイル/IoT
拡張: スケールアップ スケールアウト
⽀払い: 前払い 従量課⾦
開発者アクセス: ⽇次/週次/⽉次 APIアクセス
従来要件 新要件
8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
万能のデータベース
は存在しない
“A one size fits all database
doesn't fit anyone”
Werner Vogels
CTO - Amazon.com
https://www.allthingsdistributed.com/2018/06/
purpose-built-databases-in-aws.html
9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベースの選択
• AWS では多様な
データベースの選択肢
• ワークロードに応じて
最適な選択が可能
Purpose built
The right tool for
the right job
https://www.allthingsdistributed.com/2018/06/purpose-built-databases-in-aws.html
適材適所の選択
10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリ
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリ
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
リレーショナル
キーバリュー
ドキュメント
インメモリー
グラフ
時系列
台帳
12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリ
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
リレーショナル
キーバリュー
ドキュメント
インメモリー
グラフ
時系列
台帳
13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリとユースケース
Relational
参照整合性、
ACIDトランザク
ション、
Schema-On-
Write
リフト&シフト、
ERP、CRM、⾦融
Key-value
⾼スループット、
低レイテンシー
の読み取り、書
き込み、無限の
スケール
リアルタイム⼊札、
ショッピングカー
ト、ソーシャル、
製品カタログ、
顧客の好み
Document
ドキュメントを
保存し、任意の
属性にクエリー
ですばやくアク
セス
コンテンツ管理、
パーソナライゼー
ション、モバイル
In-memory
マイクロ秒のレイ
テンシーでキーに
よるクエリ
リーダーボード、
リアルタイム分析、
キャッシング
Graph
すばやく簡単に
データ間の関係を
作成しナビゲート
不正検出、
ソーシャルネット
ワーキング、
レコメンド
エンジン
Time-series
データを時間順に
収集、格納、処理
IoTアプリケー
ション、
イベント
トラッキング
Ledger
完全で不変で検証
可能なアプリケー
ションデータに対
するすべての変更
履歴
SoR(System of
Record)、
サプライチェーン、
ヘルスケア、
届出、財務
特徴
ユース
ケース
14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
Amazon
DynamoDB
Amazon
Neptune
Amazon
RDS
Aurora CommercialCommunity
Amazon
Timestream
Amazon
QLDB
Amazon
ElastiCache
Amazon
DocumentDB
15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リレーショナルデータベース
RDBMS
Relational
17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リレーショナルデータ
• テーブル間でデータを分割
• ⾼度に構造化されたデータ
• キーを介して確⽴された
リレーションシップ(関係性)
• データの正確性と⼀貫性
Patient
* Patient ID
First Name
Last Name
Gender
DOB
* Doctor ID
Visit
* Visit ID
* Patient ID
* Hospital ID
Date
* Treatment ID
Medical Treatment
* Treatment ID
Procedure
How Performed
Adverse Outcome
Contraindication
Doctor
* Doctor ID
First Name
Last Name
Medical Specialty
* Hospital Affiliation
Hospital
* Hospital ID
Name
Address
Rating
リレーション
多 対 1
18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• エンタープライズ
アプリケーション
• 基幹系システム
• ERP
• CRM 等
• SaaS アプリケーション
• E コマースアプリケーション
• ウェブアプリケーション 等
19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• 汎⽤的
• 既存アプリケーション移⾏
• 正規化/リレーショナル
• SQLを使⽤可能
• 複数の表を結合 (JOIN) して
利⽤できる
• 柔軟なクエリ
• トランザクション処理
• データの堅牢性/⼀貫性
Patient
* Patient ID
First Name
Last Name
Gender
DOB
* Doctor ID
Visit
* Visit ID
* Patient ID
* Hospital ID
Date
* Treatment ID
Medical Treatment
* Treatment ID
Procedure
How Performed
Adverse Outcome
Contraindication
Doctor
* Doctor ID
First Name
Last Name
Medical Specialty
* Hospital Affiliation
Hospital
* Hospital ID
Name
Address
Rating
JOIN
20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Relational Database Service (Amazon RDS)
6つのデータベースエンジンから選択できるマネージリレーショナルデータベース
容易な管理 ⾼可⽤性と永続性 ⾼スケール ⾼速でセキュア
インフラストラクチャの
プロビジョニング、データ
ベースのインストール、
メンテナンス不要
マルチAZデータレプリケー
ション、⾃動バックアップ、
スナップショット、
⾃動フェイルオーバー
数クリックでコンピュートと
ストレージをスケール可能
アプリケーションの
ダウンタイムは最⼩限
SSDストレージのI/O保証、
保存時と通信時の暗号化
21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
住信SBIネット銀⾏様︓
オンプレミスの Oracle Database を Amazon Aurora へ移⾏
• 2019年3⽉4⽇ Webニュース
• Oracle Database 11g 3ノードRAC から、
Amazon Aurora PostgreSQL 10 への移⾏
を決定
• 機能/⾮機能/移⾏の観点で予備検討を実施
• アプリケーションの書き換えにはコストが
かかるが、リリース後3年で回収可能
出典)https://www.netbk.co.jp/wpl/NBGate/i900500CT/PD/corp_news_20190304
https://japan.zdnet.com/article/35133723/
性 能︓ピーク時のスループットが最⼤50%向上
可⽤性︓障害時は30秒でフェイルオーバーが完了
コスト︓83%のランニングコスト削減
22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Storage Auto Scaling
• MySQL, PostgreSQL, MariaDB, SQL Server, Oracle にて、スト
レージ容量がダウンタイムなしに⾃動的にスケール
• これまでは、⼿動によるサイズ変更は可能だったが、⾃動的にスケー
ルさせることができるように
• 注意点
• 空き⽤容量が10%未満の状態が5分継続した場合に拡張
• 拡張する容量は元の容量の10%(最低5GiB)
• 拡張後6時間は拡張不可(⼿動による拡張も不可)
NEW !!
23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aurora Serverless
• 負荷の少ないシステムなど
(例: アクセスの少ないブログサイト)
• 可変負荷のアプリケーション - 予測が困難な活動のピーク
(ニュースサイトなど)
• 夜間または週末に必要とされない開発データベースまたは
テストデータベース
• マルチテナントSaaSアプリケーションの統合基盤
NEW !! Amazon Aurora
24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1
2
4
8
16
32
64
128
0
500
1000
1500
2000
2500
3000
1
12
23
34
45
56
67
78
89
100
111
122
133
144
155
166
177
188
199
210
221
232
243
254
265
276
287
298
309
320
331
342
353
364
375
386
397
408
419
430
441
452
463
474
485
496
507
518
529
540
551
562
573
584
595
606
617
628
639
650
661
672
683
694
705
716
727
TPS ACU
NEW !!
AuroraServerless-負荷に応じたスケールアップ・ダウン
Amazon Aurora
25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Aurora Global Databases
• Aurora with MySQL 5.6 のクロスリージョン
リードレプリカが強化され、Global Databases に
• 通常1秒未満の低レイテンシなレプリケーションと、
通常1分以内の⾼速なフェールオーバーが可能に
• 従来はBinlogを基にしたレプリカインスタンスを作成していたが、
Global Databases では、Auroraストレージレベルでのクラスター間の
物理レプリケーションで実現
バージニア北部 オレゴン
NEW !!
26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS Performance Insights が
Aurora MySQL5.7 で利⽤可能に
NEW !!
27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance Insights ダッシュボード
Database Loadチャート
Top N Dimensionテーブル
28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS Performance Insights 概要
p 対応エンジン
ü Aurora PostgreSQL
ü Aurora MySQL 5.6 1.17.3+
ü Aurora MySQL 5.7 2.04.2+
ü RDS MariaDB 10.2.21+
ü RDS PostgreSQL 10
ü RDS MySQL 5.6.41+、5.7.22+
ü RDS Oracle
ü RDS Microsoft SQL Server (2008を除く)
db.t2インスタンスクラスではサポートされていません
p 主要な機能
ü Database Loadチャート
ü Top N Dimensionテーブル
• Dimension: 待機、SQL、ホスト、ユーザー
ü 7⽇間のデータ保持期間(デフォルト)
• 2年間の⻑期保持も選択可能
p CloudWatchアラーム / API / SDK
Performance Measure
- Database Load
- (Average Active Sessions)
Dimension
- 待機イベント
- SQL
- ホスト
- ユーザー
29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance Insights 無料枠
• 無料枠
• 7 ⽇間分のパフォーマンスデータ履歴
• 1 か⽉あたり 100 万件のAPIリクエスト
• 最⻑で2年分のパフォーマンスデータ履歴を保存可能
https://aws.amazon.com/jp/rds/performance-insights/pricing/
Amazon RDS
Amazon Aurora
30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Non Relational
32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Non Relational – “ Not only SQL”
NoSQL︓
ü RDBMSではないデータベースの総称
ü 従来のRDBMSの課題を解決するために⽣まれた
ü NoSQLは⾮常に多くの種類がある
33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDBMS と NoSQL の主な特徴
リレーショナルデータベース NoSQL
ストレージに最適化 計算リソースに最適化
正規化/リレーショナル ⾮正規化/階層構造
SQLを使⽤可能
各データベースによって
異なるクエリ⽅法
トランザクション処理 トランザクション処理は限定的
データの堅牢性/⼀貫性
データの堅牢性/⼀貫性
はデータベースによる
スケールアウトの煩雑さ ⾼いスケーラビリティ
https://aws.amazon.com/jp/nosql/
34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDBMS と NoSQL の主な特徴
リレーショナルデータベース NoSQL
ストレージに最適化 計算リソースに最適化
正規化/リレーショナル ⾮正規化/階層構造
SQLを使⽤可能
各データベースによって
異なるクエリ⽅法
トランザクション処理 トランザクション処理は限定的
データの堅牢性/⼀貫性
データの堅牢性/⼀貫性
はデータベースによる
スケールアウトの煩雑さ ⾼いスケーラビリティ
https://aws.amazon.com/jp/nosql/
35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDBMS と NoSQL の主な特徴
リレーショナルデータベース NoSQL
ストレージに最適化 計算リソースに最適化
正規化/リレーショナル ⾮正規化/階層構造
SQLを使⽤可能
各データベースによって
異なるクエリ⽅法
トランザクション処理 トランザクション処理は限定的
データの堅牢性/⼀貫性
データの堅牢性/⼀貫性
はデータベースによる
スケールアウトの煩雑さ ⾼いスケーラビリティ
https://aws.amazon.com/jp/nosql/
36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Key Value Store
Key-value
39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
キーバリューストア (KVS)
• キーとバリュー(値)という単純な構造
• 超⾼速なパフォーマンス
• RDBMSに⽐べ読み書きが⾼速
Key1 Value1
Key2 Value2
Key3 Value3
1 対 1
40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
あらゆる規模で低レイテンシー
⾼スループットのデータアクセス
• モバイル
• ウェブ
• ゲーム
• 広告技術 etc.
41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• オンラインゲームデータ
• 永続化が必須のアイテムステータスなど
• Eコマースのショッピングカート
• ホリデーシーズン等のピーク時の更新処理など
42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• インターネットスケールのシステム
• スケール規模を事前に予測するが難しい
• 低レイテンシー/⾼スループットが求められる
• RDBではスケールに限界がある
• スケールアップはハードウェアの性能・容量に依存
• スケールアウトさせるには分散管理が必要
43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• スケーラビリティが求められる
• レスポンスタイム 数ミリ秒 が求められる
• シンプルなクエリ
• Amazon DynamoDB
• 規模に関係なく、数ミリ秒のレスポンス
• 1 ⽇に 10 兆件以上のリクエスト処理可能
• 毎秒 2,000 万件を超えるリクエストをサポート
44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB
どんな規模にも対応する⾼速で柔軟な キーバリュー データベース
⾼いセキュリティ
デフォルトですべての
データを暗号化
堅牢なセキュリティのため
AWS Identity and Access
Managementと完全に統合
スケールに応じた
パフォーマンス
規模に関係なく、⼀貫した
数ミリ秒台の応答時間を実現
事実上無制限のスループットで
アプリケーションを構築可能
グローバルデータベース
複数のAWSリージョンにまたがり
テーブルを簡単に複製することで、
ローカルデータに素早くアクセスで
きるグローバルアプリケーションを
構築
サーバーレス
サーバーのプロビジョニング、
ソフトウェアのパッチ適⽤、
アップグレードは不要
⾃動スケールアップ/ダウン
データの継続的なバックアップ
45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
この規模を⽀えるデータベースを開発
世界最⼤の EC ビジネスである
Amazon.com は、その規模、パフォー
マンス、およびメンテナンスの利点か
ら、⾮リレーショナルクラウドデータ
ベースで運営されています。
“既存のデータベースをどのように使⽤していた
のか調べると、リレーショナル・データベース
ではなくても実現出来るパターンが多かった.”
— Werner Vogels
CTO, Amazon
46. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DynamoDB on-demand
機能
• 事前のキャパシティプランニングを不要に。
• シンプルなAPI操作で設定変更が可能
• Read/Write共に使った分だけが課金
利点
• 過剰なCUの設定や不足によるスロットリン
グなどを排除
• トラフィックの増減に合わせワークロードに
対応
NEW !!
47. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
48. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ドキュメントデータベース
Document
49. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ドキュメント指向データベース
• JSONやXML等の不定形なデータ構造に対応
• 複雑なデータモデリングを容易に表現可能
{
”id": ”tttak”,
“job”: “sa”,
”info": {
”skill": [ “youtuber”, ”video-shoping" ],
”database": ”oracle"
}
}
Key1 Object1
Key2 Object2
Key3 Object3
50. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• コンテンツ管理
• ニュース記事、ブログ、レシピ 等
• カタログ
• E コマースアプリケーション
• 製品情報、在庫の説明
• コンテンツとメタデータのマッピング 等
• プロファイル管理
• ユーザーの設定管理 等
51. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• 頻繁に変更される属性情報
• Amazon.com の商品属性情報
• アプリケーション・ログ
• デバイス・ログ
• RDBではスキーマ設計が必須
• 全ての属性情報定義は難しい
• 属性を定義しないとINSERTができない
52. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• スキーマを決められないデータの格納
• 後から属性情報の変更を⾏いたい
• JSONやXML形式のをそのまま扱いたい
• 構造を意識したドキュメント思考の検索
• Amazon DocumentDB
• フルマネージドなMongoDB互換データベース
• 読み取り容量を数百万件/秒までスケール
53. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DocumentDB
⾼速でスケーラブルかつ⾼可⽤性の MongoDB 互換データベースサービス
フルマネージド型
AWSによる管理︓
ハードウェアプロビジョニ
ング、ソフトウェアパッチ、
セットアップ、設定、
バックアップは不要
⾼速なパフォーマンス
毎秒数百万のリクエスト、
ミリ秒のレイテンシー
MongoDB との互換性
MongoDB 3.6 のドライバーおよ
びツールと互換性
⾼可⽤性
フルバックアップと復元を⾏う
3つのAZにまたがる
6つのデータのレプリケート
54. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
55. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
インメモリーデータベース
In-memory
56. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
インメモリーデータベース
• KVS (キーバリューストア)
• 最⼤限メモリで処理
• 短い応答時間が期待できる
57. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• データキャッシュ
• 推論キャッシュ
• クエリキャッシュ
58. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• リアルタイム性の⾼いアプリケーション
• レイテンシ・クリティカルな処理
• Webサイト/ゲーム/デバイス 等
• RDBではマイクロ秒レベルのレイテンシは難しい
• ディスクベースの処理ではレイテンシに限界がある
• スキャンや結合のコストが⼤きい
59. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• ミリ秒未満のレイテンシー求められる
• キャッシュ可能
• 障害時のデータ損失リスクを許容できる
• インメモリ処理のため障害によるデータ損失の可能性がある
• ⾮同期レプリケーションでも可能
• Amazon ElastiCache
• マイクロ秒の応答時間
• フルマネージドな運⽤管理
60. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ElastiCache
Redis、Memcached 互換のインメモリデータストア、キャッシュ
安全性と
信頼性
ネットワーク分離、
保管時/通信時の暗号化、
HIPAA, PCI, FedRAMP準拠、
マルチAZ、
⾃動フェイルオーバー
Redis & Memcached 互換
オープンソース Redis,
Memcached互換
スケールが簡単
シャーディングとレプリカを使⽤
し書き込みと読み取りをスケール
⾮常に⾼い
パフォーマンス
インメモリデータストア
インメモリキャッシュ機能
マイクロ秒単位の応答時間
61. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Expedia様事例︓ElastiCache を⽤いたリアルタイム分析基盤
Expediaは1兆ドル規模の旅⾏業界のリー
ダーであり、世界で最も信頼される旅⾏
ブランドのいくつかを含む広範なポート
フォリオを持っています。
Expediaでは、テストと学習に向けた実
験のデータを収集するアプリケーション
のために ElastiCache Redis を使⽤し、
1 ⽇最⼤ 2 億件のメッセージを処理して
います。
ElastiCache Redis をキャッシュとして配置
し、プロビジョニングされた DynamoDB の
キャパシティを 90% 減少させ、データベース
の総コストをこれまでの 6 倍削減することに
成功しました。” – Kuldeep Chowhan
Engineering Manager, Expedia
“
Kenesis
Firehose
Real-time
streams of lodging
mark data
EC2
Redshift
Aurora
S3
Ingest
multiple data
streams
Join/
compare
events
ElastiCache
(Redis)
Reference data
on-premises
Historical queries on up
to 2 years of data
Staging near real-
time data
Operational queries
of real-time data
62. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
63. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフデータベース
Graph
64. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフ指向データベース
• データ間を相互に結びつけて
データ同⼠の関係をグラフという形で表す
• 複雑な関係性を表すのを得意とする
• SNSのフレンドの関連性等
多 対 多
65. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
SNSニュースフィード リコメンデーション 不正検出
Friends
Use
Play
Like
Check in
Like
Connect
Read
Credit
card
Product
Email
address
Credit
card
Known
fraud
Uses
Paid
with
Uses
Paid
with
Paid with
Purchased
Approve
purchase?
Sport
Product
Purchased
Purchased
People
who also
follow sports
purchased…
Purchased
Knows
Knows
Do you
know…
Follows
Follows
Follows
66. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• グラフ構造を扱うアプリケーション
• レイテンシーがミリ秒
• 関連を検索したい
• 何百万⼈ものユーザーが照会する
• RDB では多対多関連を扱うのは不得意
• 多対多の SQL は、ネストされたクエリと複雑な JOIN が必要
• クエリや索引のチューニング難易度が⾼い
• スケールアップに限界がある
67. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• 関連を探索するクエリ (トラバーサル)
• 短いクエリが⼤量に来る要件がある
• Amazon Neptune
• 数⼗億のリレーションシップを扱える
• ミリ秒台のレイテンシー
• グラフに最適化された、専⽤のグラフデータベースエンジン
68. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptune
フルマネージドなグラフデータベース
容易
Gremlin または SPARQL を
使⽤して、書き込みが容易
でパフォーマンスに優れた
強⼒なクエリを実⾏
⾼速
数⼗億の関係をミリ秒でクエリ
オープン
Apache TinkerPop & W3C RDF
Graphモデルをサポート
⾼可⽤性
フルバックアップと復元を⾏う
3つのAZにまたがる
6つのデータのレプリケート
69. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
70. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
時系列データベース
Time-series
71. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
時系列データ
• 時間が唯⼀の主軸
• 特定の間隔で記録され続ける
• 時間の経過に伴う変化を測定
• リアルタイムの意思決定、警告 等
72. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• IoTデバイスデータ
• アプリケーション
イベント
• DevOpsデータ
• リソース監視データ 等
• 産業⽤テレメトリ
Humidity
% WATER VAPOR
91.094.086.093.0
73. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• ⼤量ログの絶え間ない格納
• 複数のデバイスが 数百万/秒 レベルのログを⽣成
• ⼤量の挿⼊処理(10M/s)と分析処理を両⽴したい
• 例 : 最新~30秒前 の平均値
• RDBではログの格納と分析の両⽴が難しい
• RDBは粒度の⼩さな挿⼊処理のコストが⾼い
• 頻繁なコミット処理 等
• 検索のため、索引を作るとさらにコストが⾼くなる
• 分析のたびにスキャンが必要で効率が悪い
74. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• 時系列データを扱うか
• ⼤量、粒度が⼩さい、すぐに分析したい
• 多数のソース (IoTデバイスなど) からの頻繁に送信されるか
• ⼀定の時間間隔で分析を実⾏したいか
• Amazon Timestream (Public Preview)
• RDB の 1/10 のコストで 1,000 倍のパフォーマンス
• ⼀⽇あたり数兆規模のイベントに対応
• 挿⼊とクエリを異なる処理階層で実⾏し、競合を解消
75. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Timestream (Preview)
⾼速でスケーラブルな完全マネージド型の時系列データベース
リレーショナルデータベースの
1/10のコストで1,000倍⾼速
数兆に及ぶ⽇々の
イベント
時系列データに最適化
されたアナリティクス
サーバーレス
複数のソースから1秒あた
り何百万回というインサー
トレートで⾼速に移動する
時系列データを収集
毎⽇何兆というイベントを
処理することが可能。適応
型クエリ処理エンジンは安
定した予測可能なパフォー
マンスを維持
トレンド、パターン、外れ
値を特定するための補間、
スムージング、近似のため
のビルトインアナリティク
ス
管理するサーバーなし
ハードウェアのプロビジョ
ニング、ソフトウェアの
パッチ適⽤、セットアップ、
および設定などの時間がか
かる作業は実施済み
76. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
Non Relational
77. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
台帳データベース
Ledger
78. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
台帳データベース
• データの変更履歴はイミュータブル
(変更や削除が不可能)
• 意図しない変更が発⽣していないことを
暗号技術で検証
C | H
J
79. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ユースケース
• 集中管理を⾏う元帳として利⽤
• ヘルスケア︓医療カルテ、保険ログ
• 政府機関︓ 不動産登記、⼾籍、住⺠票、渡航履歴
• ⺠間企業︓ 会計上の証跡、監査証跡、契約書管理
80. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
解決したい課題
• 台帳を管理しなければならないか
• 変更履歴の追跡
• 改ざんが無いことの証明
• RDBでは管理者が存在する
• 管理者が操作できる可能性がある
• 監査は可能かも知れないが間接的
• 商⽤データベースでは、専⽤製品が必要かつ複雑
81. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
選択指針
• 履歴の追跡と変更管理
• 完全で検証可能な変更履歴を⻑期間維持したい
• 管理者でも変更履歴を改ざんできないことを保証したい
• Amazon Quantum Ledger Database
• スケーラブルで完全
• 検証可能なトランザクション
• データの変更全てを追跡可能
82. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Quantum Ledger Database (QLDB)
フルマネージド型台帳データベース
アプリケーションデータに加えられたすべての変更の履歴を追跡して確認
不変かつ透明性 暗号化による可視化 Easy to useHighly scalable
追記型で各履歴データやジャーナ
ルは不変、削除または変更できな
いのですべての変更の履歴を追跡
出来る
意図しない変更が加
えられていないこと
を簡単に確認
⼀般的なブロックチェーン
フレームワークで実現した
よりも2〜3倍のトランザク
ションを実⾏
使い慣れたSQLライクなイ
ンタフェースを備えた柔軟
なドキュメントモデル、ク
エリ
83. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
84. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリ
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
85. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリ
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
リレーショナル
キーバリュー
ドキュメント
インメモリー
グラフ
時系列
台帳
86. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカテゴリとユースケース
Relational
参照整合性、
ACIDトランザク
ション、
Schema-On-
Write
リフト&シフト、
ERP、CRM、⾦融
Key-value
⾼スループット、
低レイテンシー
の読み取り、書
き込み、無限の
スケール
リアルタイム⼊札、
ショッピングカー
ト、ソーシャル、
製品カタログ、
顧客の好み
Document
ドキュメントを
保存し、任意の
属性にクエリー
ですばやくアク
セス
コンテンツ管理、
パーソナライゼー
ション、モバイル
In-memory
マイクロ秒のレイ
テンシーでキーに
よるクエリ
リーダーボード、
リアルタイム分析、
キャッシング
Graph
すばやく簡単に
データ間の関係を
作成しナビゲート
不正検出、
ソーシャルネット
ワーキング、
レコメンド
エンジン
Time-series
データを時間順に
収集、格納、処理
IoTアプリケー
ション、
イベント
トラッキング
Ledger
完全で不変で検証
可能なアプリケー
ションデータに対
するすべての変更
履歴
SoR(System of
Record)、
サプライチェーン、
ヘルスケア、
届出、財務
特徴
ユース
ケース
87. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS のデータベースサービス
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes, endless
scale
Real-time bidding,
shopping cart, social,
product catalog,
customer preferences
Document
Store documents
and quickly
access querying
on any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create and
navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process data
sequenced by
time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history of
all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
DynamoDB NeptuneAmazon RDS
Aurora CommercialCommunity
Timestream QLDBElastiCacheDocumentDB
88. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データベースの選択
• AWS では多様な
データベースの選択肢
• ワークロードに応じて
最適な選択が可能
Purpose built
The right tool for
the right job
https://www.allthingsdistributed.com/2018/06/purpose-built-databases-in-aws.html
適材適所の選択
89. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!