SlideShare a Scribd company logo
1 of 58
Download to read offline
Amazon DynamoDB Deep Dive
アマゾンデータサービスジャパン株式会社
シニアソリューションアーキテクト
安川 健太
自己紹介
• 安川 健太 (@thenkentiest)
– AWSソリューションアーキテクト
– 担当するお客様の範囲
• スタートアップ
• ゲーム・ソーシャルサービス
• 時々エンタープライズ
• 略歴
– エリクソンリサーチにてM2MやSNS + IoTな感じの技術の研究開発
– ユーザとして触ったAWSに感銘を受けてAWSソリューションアーキテ
クトに
(↑イマココ)
IT インフラストラクチャ
Amazonの3つのコアビジネス
セラー向け
ビジネス
アマゾンの
ウェブサイト上で販売
自社小売ウェブサイトに
Amazonの技術を利用
アマゾンフルフィルメント
センター(物流センター)
の活用
コンシューマ向け
ビジネス
1億を超えるアクティブなア
カウント
8カ国で展開 :
米国, 英国, ドイツ, 日本, フ
ランス, カナダ, 中国,
イタリア
スケーラビリティ
高可用性
ITインフラストラク
チャ
ビジネス
2006年開始
ウェブスケールでの
クラウド基盤の提供
190以上の国において、数十
万に及ぶ登録アカウント
クラウドコンピューティングとは?
スケールアップ・
ダウンが容易
初期投資が不要 実際の使用分
のみ支払い
セルフサービスな
インフラ
ビジネススピードの
改善
低額な利用価格
Deploy
AWS が提供するデータベースサービス
完全マネージド型で、セットアップ、運用、拡張が
容易なリレーショナル・データベースサービスAmazon RDS
Amazon DynamoDB
完全マネージド型で、高速なパフォーマンス、シー
ムレスな拡張性と信頼性をNoSQLサービス
Amazon Redshift
高速で管理も万全なペタバイト規模のデータウェア
ハウスサービス
Amazon ElastiCache
完全マネージド型で、セットアップ、運用、拡張が
用意なキャッシュサービス
AWS が提供するデータベースサービス
完全マネージド型で、セットアップ、運用、拡張が
容易なリレーショナル・データベースサービスAmazon RDS
Amazon DynamoDB
完全マネージド型で、高速なパフォーマンス、シー
ムレスな拡張性と信頼性をNoSQLサービス
Amazon Redshift
高速で管理も万全なペタバイト規模のデータウェア
ハウスサービス
Amazon ElastiCache
完全マネージド型で、セットアップ、運用、拡張が
用意なキャッシュサービス
Amazon DynamoDBとは
• NoSQL as a Service
• 超高速・予測可能な一貫したパフォーマンス
• シームレスなスケーラビリティと低コスト
運用管理必要なし
低レイテンシ、SSD
プロビジョンスループット
無限に使えるストレージ
ADMIN
Amazon DynamoDBの生い立ち
• RDBMSのスケールの限界を超えるため開発された
Dynamoが祖先
• 結果整合性モデル採用に
よる可用性向上
• HWを追加する毎に性能
が向上するスケーラビリ
ティ
• シンプルなクエリモデル
による予測可能な性能
Amazon DynamoDBの特徴
管理不要で信頼性が高い
プロビジョンスループット
ストレージの容量制限がない
特長1:管理不要で信頼性が高い
• SPOFの存在しない構成
• データは3箇所のAZに保存されるので信頼性が高い
• ストレージは自動的にパーティショニング・スケール
クライアント
特長2:プロビジョンスループット
• ReadとWrite、それぞれに対して必要な分だけのスループットキャ
パシティをプロビジョンする(割り当てる)ことができる
• 例えば一般的なReadヘビーなDBなら
– Read : 1,000
– Write : 100
• ライトヘビーなDBなら
– Read : 500
– Write : 500
• この値はDB運用中にオンラインで変更可能
– ただし、スケールダウンに関しては日に4回までしかできないので注意
特長3:ストレージの容量制限がない
• 使った分だけの従量課金制のストレージ
• データ容量が増えてきたのでディスクを足した
り、ノードを足したりという作業が不要
Amazon DynamoDBの料金体系
• プロビジョンスループットで決まる時間料金
– Read/Writeそれぞれプロビジョンしたスループットによって時間あたりの
料金がきまる
– 大規模に利用するのであればリザーブ度による割引もあり
• ストレージ利用量
– 保存したデータ容量によって決まる月額利用料金
– 計算はGBあたりの単価が適用される
実際の料金については下記を参照
http://aws.amazon.com/jp/dynamodb/pricing/
Amazon DynamoDBを使い始めるには
1. テーブルのKeyやIndexを決める
2. Read/Writeそれぞれのスループットを
決める
That’s it, write your code!
ご利用のお客様の一部
AWSの利用:
世界最大級のスポーツイベント
「Super Bowl 2012」の広告配信で
利用
DynamoDBを使用し、秒間50万以上
の書き込み要求を処理
ビジネス効果:
試合当日の急激なトラフィック増加の
ピークに対応
Amazon DynamoDBを使用し、秒間50万以
上の書き込み要求に対応
web
Web
Web
Web
Web
Web
・
・
・
Shazam for TV
Shazamableな広告コン
テンツを配信
利用者はテレビに
スマートホンをかざす キャンペーン情報などを配信
Amazon DynamoDBに増え続けるチャットデータを確
実に保存しつつ、サービスの成長に備える
AWSの利用:
2012年のサービスの開始時からEC2上
にシステムを構築
ビジネス効果:
Amazon DynamoDBの導入で増え続け
るデータの心配や、バックアップやメン
テナンスを考慮する必要がなくなった
課題:
MySQLとRedisでは増え続ける思い出
のデータを保持しながらのサービス成
長が
難しい
RedisからAmazon DynamoDBへ
EC2
Redis
タイムスタンプでの検索が主用途だったので
Rangeキーを用いた検索で置き換えRedisは高機能だがデータ保
存容量の単価は高い
http://timers-tech.hatenablog.com/entry/2013/10/31/232027
Amazon DynamoDBの基礎知識
テーブル設計のための基礎知識(1/2)
• Table
– いわゆるテーブル
– プライマリキーの持ち方が2つ
• Hash keyをプライマリキー
• Hash keyとRange keyの複合キーをプライマリキー
• Hash key
– 順序を指定しないハッシュインデックスを構築するためのキー
– 単体でプライマリキーとして利用されることがある
• Range key
– Hash keyに該当する複数のデータの順序を保証するためのキー
– Hash + Rangeでプライマリキーとすることもできる
テーブル設計のための基礎知識(2/2)
• Item
– RDBで言ういわゆるレコード
– 1つ以上のAttributeを持つ
• Attributes
– データの中身。RDBで言うカラム。
– Hash key, Range keyに該当するAttributes以外は事前定義不要
– レコード間でAttributesが不揃いであっても問題ない
• Attributesの型
– String
– Number
– Binary
– Set of String
– Set of Number
– Set of Binary
データモデル (1/2)
Hash Keyのみの場合
Item
Primary Key
Attribute
A1-1Hash Key
データモデル (2/2)
• Hash Key + Range Key の場合
Item
Primary Key
Attribute
A1-1
Hash Key
A
Range Key 1
Range Key 2
Range Key 3
Attribute
A2-1
Attribute
A3-1
A,D B,E C,F
123456789
Parition1 Partition2 ParitionN
Range key
Partition内での
データの並びを
保証する
Hash key
Partition間での
データ分散に利
用される
Partition
DynamoDBでは、性
能を確保するために
データはパーティショ
ンに分散して格納され
る
Hash keyとRange keyの概念(1/2)
A,D B,E C,F
123456789
Parition1 Partition2 ParitionN
Hash keyとRange keyの概念(2/2)
Partition
• DynamoDBはデータを複数のPartitionに分
散格納
• プロビジョンしたスループットは各パー
ティションに均等に付与、全体で合計値
の性能
• 負荷が特定のキーに偏るとプロビジョン
した性能が出ない可能性があるため、
Hash keyの設計には注意
プロビジョンドスループット: x
x/N x/N x/N
テーブル操作についての基礎知識(1/3)
• GetItem
• Hash keyを条件として指定し、
一件のアイテムを取得
• PutItem
• 1件のアイテムを書き込む
• Update
• 1件のアイテムを更新
• Delete
• 1件のアイテムを削除
• Query
• Hash keyとRange keyの複合条件に
マッチするアイテム群を取得
• BatchGet
• 複数のプライマリキーを指定して
マッチするアイテム群を取得
• Scan
• テーブル総ナメする
API操作
テーブル操作についての基礎知識(2/3)
• 強一貫性を持ったReadオペレーション
• GetItem、QueryにはConsistent Readオプションを指定可
• Readリクエストを受け取るよりも前に成功しているすべてのWriteリクエストが反映
された結果が返る
• Read Capacity Unitを通常の2倍消費する
• Conditional Write
• 「キーにマッチするレコードが存在したら/しなかったら」や「この値が○○
以上/以下だったら」という条件付き書き込み/更新ができる
より高度なオペレーション
テーブル操作についての基礎知識(3/3)
• UpdateItemにおけるAttributeへの操作
• Attributeに対して、UpdateItemでPut、Add、Deleteという3種類の操作が可能
• Put:Attributeを指定した値で更新
• Add:AttributeがNumber型なら足し算/引き算、Set型ならそのセットに対して値を追加
• Delete:当該Attributeを削除する
• Atomic Counter
• 上記のAddを利用することによって、Atomicなカウンターを実現することもできる
より高度なオペレーション
QueryのためのIndex
• Local Secondary Index (LSI)
– Range key以外に絞り込み検索のためのキーを持つことができる
– Hash keyが同一のアイテム群の中からの検索のために利用
– インデックスもテーブルにプロビジョンしたスループットを利用す
る
• Global Secondary Index (GSI)
– Hash Keyをまたいで検索を行うためのインデックス
– インデックスにテーブルとは独立したスループットをプロビジョン
して利用する
ユースケースとテーブル設計例
ユースケースごとのテーブル設計及びクエリの例
1. アプリのイベント履歴管理
– Hash + Range keyの利用例
2. ソーシャル画像共有アプリ
– 複数テーブルによるデータモデル、LSI、GSIの利用例
3. ◯☓ゲーム
– 楽観的ロックによるゲームのステート管理
4. 分散処理におけるロック機構
– 楽観的ロックによる分散システムの競合制御
ゲームの行動履歴管理データベース
User
(Hash)
Timestamp
(Range)
Opponent Result
Alice 2014-02-21 12:21:20 Bob Lost
Alice 2014-02-21 12:42:01 Bob Won
Alice 2014-02-24 09:48:00 Dan Won
Alice 2014-02-25 16:21:11 Charlie Won
Battle History
自分のバトル履歴を確認するケースを想定
– Userに自分(Alice)を指定し、更にTimestampが7日以内のデータ
をクエリしたりできる
Charlie
02-25 16:21
Won!
Your Battle History
Dan
02-24 09:48
Won!
Alice
02-21 12:42
Won!
Amazon DynamoDBのデータも解析に利用
• Amazon Elastic MapReduce (EMR)
で読み出し
• Amazon Redshiftで直接読み込み
• EMRでFilterした後、Redshiftに読み
込み
• etc
EC2
ソーシャル画像共有アプリ
Home My Posts My Profile
Bob
Steak!
10:18
Carol
BBQ! w/Alice
10:12
Dan
Riajuee…
10:11
Alice
Beer!
10:21
Alice
BBQ! w/Carol
10:12
Alice
Starting BBQ!
10:09
Name:
Alice
Mail: foo
Profile: some texts
テーブル設計
Users TableFriends Table
2つのテーブルを定義
• ユーザ情報テーブル
• 友達リストテーブル
User
(Hash)
Nicknames
Bob [ Rob, Bobby ]
Alice [ Allie ]
Carol [ Caroline ]
Dan [ Daniel, Danny ]
友達一覧を取得
Users Table
Item
Attribute
(string, number, binary, set)
Primary Key
(Hash)
User
(Hash)
Nicknames
Bob [ Rob, Bobby ]
Alice [ Allie ]
Carol [ Caroline ]
Dan [ Daniel, Danny ]
友達一覧を取得
Friends Table
User
(Hash)
Friend
(Range)
Bob Alice
Alice Bob
Alice Carol
Alice Dan
Users Table
Hash + Range
Primary Key
Friends Table Users Table
User
(Hash)
Nicknames
Bob [ Rob, Bobby ]
Alice [ Allie ]
Carol [ Caroline ]
Dan [ Daniel, Danny ]
User
(Hash)
Friend
(Range)
Bob Alice
Alice Bob
Alice Carol
Alice Dan
友達一覧を取得
Aliceの友達一覧を取得
1. Query (Table =
Friends, Hash = Alice,
Range = *)
2. BatchGetItem(Bob, Carol, Dan)
投稿画像の保存と検索
Images Table
User
(Hash)
Image
(Range)
Date Link
Bob aed4c 2013-10-01 s3://…
Bob cf2e2 2013-09-05 s3://…
Bob f93bae 2013-10-08 s3://…
Alice ca61a 2013-09-12 s3://…
Bob
Bobの投稿画像一覧を取得
Query (Table=Images,
Hash= Bob,
Range=*)
でもある時刻以降の画像を取得し
たかったら…?
ある日時の画像取得
Images Table
User Image Date Link
Bob aed4c 2013-10-01 s3://…
Bob cf2e2 2013-09-05 s3://…
Bob f93bae 2013-10-08 s3://…
Alice ca61a 2013-09-12 s3://…
User Date Image
Bob 2013-09-05 cf2e2
Bob 2013-10-01 aed4c
Bob 2013-10-08 f93bae
Alice 2013-09-12 ca61a
Table ByDate Local Secondary Index
Local Secondary Index をDateに張る
画像にユーザのタグ付け
ImageTags Table
Image User
aed4c Alice
aed4c Bob
f93bae Alice
f93bae Bob
Image f93baeにAliceをタグ付け
PutItem(Table = ImageTags,
Hash = f93bae, Range = Alice)
Bob
でもあるユーザがタグ付けされて
る画像の一覧を取得したかったら
…?
Image f93baeにタグ付けされたユーザ一覧
Query(Table = ImageTags,
Hash = f93bae, Range = *)
ユーザのタグ付き画像一覧
ImageTags Table
UserにImageをRangeキーとした
Global Secondary Indexを張る
User
(Hash)
Image
(Range)
Bob aed4c
Bob f93bae
Alice aed4c
Alice f93bae
ByUser Global Secondary Index
Image
(Hash)
User
(Range)
aed4c Alice
aed4c Bob
f93bae Alice
f93bae Bob
Table
Bob
Aliceがタグ付けされた画像一覧
◯☓ゲームのステート管理
◯☓ゲーム
{
Id : abecd,
Players : [ Alice, Bob ],
State : STARTED,
Turn : Bob,
Top-Right : O
}
Game Item
◯☓ゲーム
Amazon
DynamoDB
Alice Bob
◯☓ゲーム
Amazon
DynamoDB
Alice Bob
Update:
Top-Left : X
Turn : Alice
◯☓ゲーム – 今のままだとチートが可能
Alice Bob (1)
Amazon
DynamoDB
Bob (2) Bob (3)
◯☓ゲーム – 今のままだとチートが可能
Bob (1)
Amazon
DynamoDB
Bob (2)
Bob (3)
Update:
Turn : Alice
Top-Left : X
Update:
Turn : Alice
Mid : X
State : STARTED,
Turn : Bob,
Top-Right : O
Update:
Turn : Alice
Low-Right : X
◯☓ゲーム – 今のままだとチートが可能
Bob (1)
Amazon
DynamoDB
Bob (2)
Bob (3)
Update:
Turn : Alice
Top-Left : X
Update:
Turn : Alice
Mid : X
State : STARTED,
Turn : Alice,
Top-Right : O,
Top-Left : X,
Mid: X,
Low-Right: X
Update:
Turn : Alice
Low-Right : X
条件付きアップデート(楽観的ロック)
• 現在の特定のAttributeに特定の値が入っていた
場合にのみ更新を実施
• 条件が合わなかったら更新せずに終了
• (但し、1つのアイテムのみで適用可能)
修正版◯☓ゲーム
Bob (1)
Amazon
DynamoDB
Bob (2)
Bob (3)
Update:
Turn : Alice
Top-Left : X
Expect:
Turn : Bob
Top-Left : null
State : STARTED,
Turn : Bob,
Top-Right : O
Update:
Turn : Alice
Mid : X
Expect:
Turn : Bob
Mid : null
Update:
Turn : Alice
Low-Right : X
Expect:
Turn : Bob
Low-Right : null
修正版◯☓ゲーム
Bob (1)
Amazon
DynamoDB
Bob (2)
Bob (3)
State : STARTED,
Turn : Bob,
Top-Right : O
Update:
Turn : Alice
Top-Left : X
Expect:
Turn : Bob
Top-Left : null
Update:
Turn : Alice
Low-Right : X
Expect:
Turn : Bob
Low-Right : null
Update:
Turn : Alice
Mid : X
Expect:
Turn : Bob
Mid : null
修正版◯☓ゲーム
Bob (1)
Amazon
DynamoDB
Bob (2)
Bob (3)
State : STARTED,
Turn : Alice,
Top-Right : O,
Top-Left : X
Update:
Turn : Alice
Top-Left : X
Expect:
Turn : Bob
Top-Left : null
Update:
Turn : Alice
Mid : X
Expect:
Turn : Bob
Mid : null
Update:
Turn : Alice
Low-Right : X
Expect:
Turn : Bob
Low-Right : null
バッチ処理のロック管理
S3 S3
Worker1
Jobs Table
JobID
(Hash)
Created
Time(Range)
Process1 Process2
aed4c 2014-01-01
00:00:00
Done InProcess
aed4c 2014-01-01
00:01:00
NotYet NotYet
Worker2も処理のジョブ
一覧を取得
Scan (Table = jobs,
Process1 = ‘NotYet’)
Worker1が未処理のジョ
ブ一覧を取得
Scan (Table = jobs,
Process1 = ‘NotYet’)
ワーカーが複数クラスタいるので、
複数箇所で同じデータが取得される
Worker2
バッチ処理のロック管理
S3 S3
処理1
Jobs Table
JobID
(Hash)
Created
Time(Range)
Process1 Process2
aed4c 2014-01-01
00:00:00
Done InProcess
aed4c 2014-01-01
00:01:00
NotYet NotYet
Worker2もProcess1をLockしようとする
UpdateItem (Table = jobs,
Key={JobID:aed4c},
AttributeUpdates={Process1:{Acti
on:’Put’,Value:InProcess’}},
Expected:{Process1:‘NotYet’})
片方だけUpdateに成功する
(Lockできる)
Worker1がProcess1をLockしようとする
UpdateItem (Table = jobs,
Key={JobID:aed4c},
AttributeUpdates={Process1:{Acti
on:’Put’,Value:InProcess’}},
Expected:{Process1:‘NotYet’})
まとめ
• Amazon DynamoDBの特徴
– 高い可用性
– 一貫した性能
– 低い運用負荷
• Amazon DynamoDBの高度な機能
– Local Secondary Indexes
– Global Secondary Indexes
• ユースケースを取り上げてテーブル設計やクエリの例
– ユーザの行動履歴
– ソーシャル画像共有アプリ
– マルバツゲーム
– 分散処理におけるロックの管理
DB Tech Showcase 大阪: Amazon DynamoDB Deep Dive

More Related Content

What's hot

モバイルゲームにおけるAWSの泥臭い使い方
モバイルゲームにおけるAWSの泥臭い使い方モバイルゲームにおけるAWSの泥臭い使い方
モバイルゲームにおけるAWSの泥臭い使い方Junpei Nakada
 
EC2 Deep Dive at CTO Night&Day 2016
EC2 Deep Dive at CTO Night&Day 2016 EC2 Deep Dive at CTO Night&Day 2016
EC2 Deep Dive at CTO Night&Day 2016 Yasuhiro Matsuo
 
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例Amazon Web Services Japan
 
20161027 hadoop summit Generating Recommendations at Amazon Scale with Apach...
20161027 hadoop summit  Generating Recommendations at Amazon Scale with Apach...20161027 hadoop summit  Generating Recommendations at Amazon Scale with Apach...
20161027 hadoop summit Generating Recommendations at Amazon Scale with Apach...Amazon Web Services Japan
 
Serverless Architecture Overview #cdevc
Serverless Architecture Overview #cdevcServerless Architecture Overview #cdevc
Serverless Architecture Overview #cdevcMasahiro NAKAYAMA
 
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05都元ダイスケ Miyamoto
 
実践!AWSクラウドデザインパターン
実践!AWSクラウドデザインパターン実践!AWSクラウドデザインパターン
実践!AWSクラウドデザインパターンHiroyasu Suzuki
 
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -Akio Katayama
 
Amazon DynamoDBの紹介と東急ハンズでの活用について
Amazon DynamoDBの紹介と東急ハンズでの活用についてAmazon DynamoDBの紹介と東急ハンズでの活用について
Amazon DynamoDBの紹介と東急ハンズでの活用についてTaiji INOUE
 
オンプレからAuroraへの移行とその効果
オンプレからAuroraへの移行とその効果オンプレからAuroraへの移行とその効果
オンプレからAuroraへの移行とその効果Masato Kataoka
 
AI & Deep Learning on AWS at CTO Night&Day 2016 Winter
AI & Deep Learning on AWS at CTO Night&Day 2016 WinterAI & Deep Learning on AWS at CTO Night&Day 2016 Winter
AI & Deep Learning on AWS at CTO Night&Day 2016 WinterYasuhiro Matsuo
 
AWSでのバースト ― GP2 T2 ご紹介資料
AWSでのバースト ― GP2 T2 ご紹介資料AWSでのバースト ― GP2 T2 ご紹介資料
AWSでのバースト ― GP2 T2 ご紹介資料Rasmus Ekman
 
Re invent 2017 データベースサービス総復習!
Re invent 2017 データベースサービス総復習!Re invent 2017 データベースサービス総復習!
Re invent 2017 データベースサービス総復習!Satoru Ishikawa
 
Lv1から始めるWebサービスのインフラ構築
Lv1から始めるWebサービスのインフラ構築Lv1から始めるWebサービスのインフラ構築
Lv1から始めるWebサービスのインフラ構築伊藤 祐策
 
MongoDB on AWSクラウドという選択
MongoDB on AWSクラウドという選択MongoDB on AWSクラウドという選択
MongoDB on AWSクラウドという選択Yasuhiro Matsuo
 

What's hot (20)

モバイルゲームにおけるAWSの泥臭い使い方
モバイルゲームにおけるAWSの泥臭い使い方モバイルゲームにおけるAWSの泥臭い使い方
モバイルゲームにおけるAWSの泥臭い使い方
 
20120409 aws meister-reloaded-dynamo-db
20120409 aws meister-reloaded-dynamo-db20120409 aws meister-reloaded-dynamo-db
20120409 aws meister-reloaded-dynamo-db
 
EC2 Deep Dive at CTO Night&Day 2016
EC2 Deep Dive at CTO Night&Day 2016 EC2 Deep Dive at CTO Night&Day 2016
EC2 Deep Dive at CTO Night&Day 2016
 
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
 
20161027 hadoop summit Generating Recommendations at Amazon Scale with Apach...
20161027 hadoop summit  Generating Recommendations at Amazon Scale with Apach...20161027 hadoop summit  Generating Recommendations at Amazon Scale with Apach...
20161027 hadoop summit Generating Recommendations at Amazon Scale with Apach...
 
AWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon AuroraAWS Black Belt Online Seminar Amazon Aurora
AWS Black Belt Online Seminar Amazon Aurora
 
Serverless Architecture Overview #cdevc
Serverless Architecture Overview #cdevcServerless Architecture Overview #cdevc
Serverless Architecture Overview #cdevc
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Rds徹底入門
Rds徹底入門Rds徹底入門
Rds徹底入門
 
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
AWSにおけるバッチ処理の ベストプラクティス - Developers.IO Meetup 05
 
AWSのNoSQL入門
AWSのNoSQL入門AWSのNoSQL入門
AWSのNoSQL入門
 
実践!AWSクラウドデザインパターン
実践!AWSクラウドデザインパターン実践!AWSクラウドデザインパターン
実践!AWSクラウドデザインパターン
 
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
AWSクラウドデザインパターン(CDP) - コンテンツ配信編 -
 
Amazon DynamoDBの紹介と東急ハンズでの活用について
Amazon DynamoDBの紹介と東急ハンズでの活用についてAmazon DynamoDBの紹介と東急ハンズでの活用について
Amazon DynamoDBの紹介と東急ハンズでの活用について
 
オンプレからAuroraへの移行とその効果
オンプレからAuroraへの移行とその効果オンプレからAuroraへの移行とその効果
オンプレからAuroraへの移行とその効果
 
AI & Deep Learning on AWS at CTO Night&Day 2016 Winter
AI & Deep Learning on AWS at CTO Night&Day 2016 WinterAI & Deep Learning on AWS at CTO Night&Day 2016 Winter
AI & Deep Learning on AWS at CTO Night&Day 2016 Winter
 
AWSでのバースト ― GP2 T2 ご紹介資料
AWSでのバースト ― GP2 T2 ご紹介資料AWSでのバースト ― GP2 T2 ご紹介資料
AWSでのバースト ― GP2 T2 ご紹介資料
 
Re invent 2017 データベースサービス総復習!
Re invent 2017 データベースサービス総復習!Re invent 2017 データベースサービス総復習!
Re invent 2017 データベースサービス総復習!
 
Lv1から始めるWebサービスのインフラ構築
Lv1から始めるWebサービスのインフラ構築Lv1から始めるWebサービスのインフラ構築
Lv1から始めるWebサービスのインフラ構築
 
MongoDB on AWSクラウドという選択
MongoDB on AWSクラウドという選択MongoDB on AWSクラウドという選択
MongoDB on AWSクラウドという選択
 

Similar to DB Tech Showcase 大阪: Amazon DynamoDB Deep Dive

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBmoai kids
 
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化Amazon Web Services Japan
 
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)Amazon Web Services Japan
 
MariaDB meetup Tokyo 2019 #01
MariaDB meetup Tokyo 2019 #01MariaDB meetup Tokyo 2019 #01
MariaDB meetup Tokyo 2019 #01GOTO Satoru
 
S3をDB利用 ショッピングセンター向けポイントシステム概要
S3をDB利用 ショッピングセンター向けポイントシステム概要S3をDB利用 ショッピングセンター向けポイントシステム概要
S3をDB利用 ショッピングセンター向けポイントシステム概要一成 田部井
 
Effective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンEffective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンNoritaka Sekiyama
 
MariaDB 10.3 概要
MariaDB 10.3 概要 MariaDB 10.3 概要
MariaDB 10.3 概要 GOTO Satoru
 
AWS初心者向けWebinar AWSでBig Data活用
AWS初心者向けWebinar AWSでBig Data活用AWS初心者向けWebinar AWSでBig Data活用
AWS初心者向けWebinar AWSでBig Data活用Amazon Web Services Japan
 
Developers.IO 2019 Effective Datalake
Developers.IO 2019 Effective DatalakeDevelopers.IO 2019 Effective Datalake
Developers.IO 2019 Effective DatalakeSatoru Ishikawa
 
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed な テレコムコアシステムを構築・運用してる話
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed なテレコムコアシステムを構築・運用してる話AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed なテレコムコアシステムを構築・運用してる話
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed な テレコムコアシステムを構築・運用してる話SORACOM,INC
 
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lakede:code 2017
 
AWSが誕生するまでの秘話
AWSが誕生するまでの秘話AWSが誕生するまでの秘話
AWSが誕生するまでの秘話Yasuhiro Horiuchi
 
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAmazon Web Services Japan
 
企業等に蓄積されたデータを分析するための処理機能の提案
企業等に蓄積されたデータを分析するための処理機能の提案企業等に蓄積されたデータを分析するための処理機能の提案
企業等に蓄積されたデータを分析するための処理機能の提案Toshiyuki Shimono
 
Cm re growth-devio-mtup11-sapporo-004
Cm re growth-devio-mtup11-sapporo-004Cm re growth-devio-mtup11-sapporo-004
Cm re growth-devio-mtup11-sapporo-004Satoru Ishikawa
 
継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え株式会社クライム
 
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fall
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fallビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fall
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo FallYusukeKuramata
 
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)Toshiharu Sugiyama
 

Similar to DB Tech Showcase 大阪: Amazon DynamoDB Deep Dive (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化
AWS Lambdaによるデータ処理理の⾃自動化とコモディティ化
 
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)
Amazon Elastic MapReduce with Hive/Presto ハンズオン(講義)
 
MariaDB meetup Tokyo 2019 #01
MariaDB meetup Tokyo 2019 #01MariaDB meetup Tokyo 2019 #01
MariaDB meetup Tokyo 2019 #01
 
S3をDB利用 ショッピングセンター向けポイントシステム概要
S3をDB利用 ショッピングセンター向けポイントシステム概要S3をDB利用 ショッピングセンター向けポイントシステム概要
S3をDB利用 ショッピングセンター向けポイントシステム概要
 
20170705 blackbelt AWS Lambda
20170705 blackbelt AWS Lambda20170705 blackbelt AWS Lambda
20170705 blackbelt AWS Lambda
 
Effective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターンEffective Data Lakes - ユースケースとデザインパターン
Effective Data Lakes - ユースケースとデザインパターン
 
AWS Black Belt - AWS Glue
AWS Black Belt - AWS GlueAWS Black Belt - AWS Glue
AWS Black Belt - AWS Glue
 
MariaDB 10.3 概要
MariaDB 10.3 概要 MariaDB 10.3 概要
MariaDB 10.3 概要
 
AWS初心者向けWebinar AWSでBig Data活用
AWS初心者向けWebinar AWSでBig Data活用AWS初心者向けWebinar AWSでBig Data活用
AWS初心者向けWebinar AWSでBig Data活用
 
Developers.IO 2019 Effective Datalake
Developers.IO 2019 Effective DatalakeDevelopers.IO 2019 Effective Datalake
Developers.IO 2019 Effective Datalake
 
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed な テレコムコアシステムを構築・運用してる話
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed なテレコムコアシステムを構築・運用してる話AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed なテレコムコアシステムを構築・運用してる話
AWS Dev Day Tokyo 2018 | Amazon DynamoDB Backed な テレコムコアシステムを構築・運用してる話
 
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake
[DI07] あらゆるデータに価値がある! アンチ断捨離ストのための Azure Data Lake
 
AWSが誕生するまでの秘話
AWSが誕生するまでの秘話AWSが誕生するまでの秘話
AWSが誕生するまでの秘話
 
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
 
企業等に蓄積されたデータを分析するための処理機能の提案
企業等に蓄積されたデータを分析するための処理機能の提案企業等に蓄積されたデータを分析するための処理機能の提案
企業等に蓄積されたデータを分析するための処理機能の提案
 
Cm re growth-devio-mtup11-sapporo-004
Cm re growth-devio-mtup11-sapporo-004Cm re growth-devio-mtup11-sapporo-004
Cm re growth-devio-mtup11-sapporo-004
 
継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え
 
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fall
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fallビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fall
ビッグデータ活用を加速する!分散SQLエンジン Spark SQL のご紹介 20161105 OSC Tokyo Fall
 
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)
DeNAtechcon_DeNAのセキュリティの取り組みと、スマートフォンセキュリティ(same-origin policy)
 

Recently uploaded

IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxAtomu Hidaka
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000Shota Ito
 
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価sugiuralab
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールプレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールsugiuralab
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directoryosamut
 

Recently uploaded (7)

IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
 
プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価プレイマットのパターン生成支援ツールの評価
プレイマットのパターン生成支援ツールの評価
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
 
プレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツールプレイマットのパターン生成支援ツール
プレイマットのパターン生成支援ツール
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
 

DB Tech Showcase 大阪: Amazon DynamoDB Deep Dive

Editor's Notes

  1. Typical data we see developers gathering about the player includes session length, telemetry data, in game data like how long to the first purchase etc, basically any information that will tell you where the game is doing well versus where it is not. This data tends to be unstructured and so developers often deploy a NoSQL solution to store that data. They will later use a batch based sort job to cleanse the data and move it into a relational database of some sort, likely a DataWareHouse, for analysis. Many Game Developers use AWS’s NoSQL offering DynamoDB which can handle very high volumes of read and writes and is highly durable. And as always you can install and manage your own NoSQL offering like MongoDB, Cassandra, Couchbase, etc too.
  2. The Hash and Range schema unlocks the Query API. Given an exact hash key value, in this case, “Bob”, you can Query for all of Bob’s images. This is great, but are there really that many use cases for querying for ALL of Bob’s images, sorted by some GUID image id? This Query gets more and more expensive as Bob uploads more images. This isn’t really the way that users tend to interact with an Image app, but we’ve checked off a first basic requirement.
  3. Here we illustrate a local secondary index on Date. You can think of a Local Secondary Index as a separate table maintained automatically by DynamoDB. You can see that Bob’s images are still grouped together, but now sorted by their alternate range key
  4. Here we illustrate a local secondary index on Date. You can think of a Local Secondary Index as a separate table maintained automatically by DynamoDB. You can see that Bob’s images are still grouped together, but now sorted by their alternate range key
  5. We have two players in a round of tic-tac toe. The item storing the data for this particular game of tic tac toe is here stored in DynamoDB. This is a match between Alice and Bob, and we’re going to have Alice go first.
  6. We can see with this move that Bob is not very good at this game. By playing that, Alice can guarantee a win by playing in the lower-left. Let’s say Bob realizes that he not good at this game, and wants to come up with some other way to win.
  7. Based on the API calls we’ve sketched out, this would work and Bob would win, or crash the game.
  8. Here all of those will be merged together. UpdateItem lets you pick specific attributes in an item to update, leaving all the rest of the attributes alone. PutItem on the other hand replaces the whole item, so then it would have been last write wins. That opens another can of worms around being able to “undo” moves, but that’s a different issue that we’ll fix in the same way.
  9. Apply the write only if the values in the item are still what the request expected them to be.
  10. 9-10 min But, only one of those writes will arrive first. Writes to each item are serialized by DynamoDB.
  11. Thank you for your participation. Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. On-Demand Instances – On-Demand Instances let you pay for compute capacity by the hour with no long-term commitments. This frees you from the costs and complexities of planning, purchasing, and maintaining hardware and transforms what are commonly large fixed costs into much smaller variable costs. On-Demand Instances also remove the need to buy “safety net” capacity to handle periodic traffic spikes. Reserved Instances – Reserved Instances give you the option to make a low, one-time payment for each instance you want to reserve and in turn receive a significant discount on the hourly charge for that instance. Spot Instances – Spot Instances allow customers to bid on unused Amazon EC2 capacity and run those instances for as long as their bid exceeds the current Spot Price. The Spot Price changes periodically based on supply and demand, and customers whose bids meet or exceed it gain access to the available Spot Instances. If you have flexibility in when your applications can run, Spot Instances can significantly lower your Amazon EC2 costs. Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business. Amazon S3 is designed to make web-scale computing easier for developers. Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers. Amazon Elastic MapReduce (Amazon EMR) is a web service that enables businesses, researchers, data analysts, and developers to easily and cost-effectively process vast amounts of data. It utilizes a hosted Hadoop framework running on the web-scale infrastructure of Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3). Amazon Virtual Private Cloud (Amazon VPC) lets you provision a private, isolated section of the Amazon Web Services (AWS) Cloud where you can launch AWS resources in a virtual network that you define. With Amazon VPC, you can define a virtual network topology that closely resembles a traditional network that you might operate in your own datacenter. You have complete control over your virtual networking environment, including selection of your own IP address range, creation of subnets, and configuration of route tables and network gateways. Amazon CloudFront is a web service for content delivery. It integrates with other Amazon Web Services to give developers and businesses an easy way to distribute content to end users with low latency, high data transfer speeds, and no commitments. AWS Direct Connect makes it easy to establish a dedicated network connection from your premise to AWS. Using AWS Direct Connect, you can establish private connectivity between AWS and your datacenter, office, or colocation environment, which in many cases can reduce your network costs, increase bandwidth throughput, and provide a more consistent network experience than Internet-based connections.