7. Gaming use case
Nexon delivers unparalleled mobile gaming with DynamoDB
Nexon is a leading South Korean video game developer
and a pioneer in the world of interactive entertainment.
By using AWS, we
decreased our initial
investment costs, and only
pay for what we use.
Chunghoon Ryu
Department Manager, Nexon
”
“ • Nexon ではゲームでDynamoDBを
Primary DBとして採用
• 韓国で最もヒットしたモバイルゲームでは
初日に200万の登録ユーザーがいた
• Nexonは快適なゲーム環境の為に10ms
以下の平均レスポンスを同時接続17万人
で実現出来る要件でDynamoDBを採用
8. Analytics use case
Expedia’s real-time analytics application uses DynamoDB
Expedia is a leader in the $1 trillion travel industry, with an
extensive portfolio that includes some of the world’s most
trusted travel brands.
With DynamoDB, we were up
and running in a less than
day, and there is no need for
a team to maintain.
Kuldeep Chowhan
Engineering Manager, Expedia
”
“ • Expediaではリアルタイム分析の為の
データ保存先としてDynamoDBを採
用
• この分析では200万件のメッセージが
日次で生成され保存する必要があっ
た。
• セットアップ、モニタリングの容易さ、
およびスケーリングがDynamoDBを
選ぶ際に重要な要因だった
12. AWS SDKs and CLI
• 各種言語むけのオフィシャルSDKやCLIを利用
Java Python PHP .NET Ruby nodeJS
iOS Android
Javascript
in the Browser AWS CLI
13. Data Types
• String (S)
• Number (N)
• Binary (B)
• String Set (SS)
• Number Set (NS)
• Binary Set (BS)
• Boolean (BOOL)
• Null (NULL)
• List (L)
• Map (M)
JSON用に定義
14. 00 55 A954 AA FF
Partition Table
• Partition key は単体でプライマリキーとして利用
• 順序を指定しないハッシュインデックスを構築するためのキー
• テーブルは、性能を確保するために分割(パーティショニング)される場合あり
00 FF
Id = 1
Name = Jim
Partition (1) = 7B
Id = 2
Name = Andy
Dept = Engg
Partition (2) = 48
Id = 3
Name = Kim
Dept = Ops
Partition (3) = CD
Key Space
15. データは3箇所にレプリケーション
Id = 2
Name = Andy
Dept = Engg
Id = 3
Name = Kim
Dept = Ops
Id = 1
Name = Jim
Id = 2
Name = Andy
Dept = Engg
Id = 3
Name = Kim
Dept = Ops
Id = 1
Name = Jim
Id = 2
Name = Andy
Dept = Engg
Id = 3
Name = Kim
Dept = Ops
Id = 1
Name = Jim
Replica 1
Replica 2
Replica 3
Partition 1 Partition 2 Partition N
45. Messages
Table
Messages App
David
SELECT *
FROM Messages
WHERE Recipient='David'
LIMIT 50
ORDER BY Date DESC
Inbox
SELECT *
FROM Messages
WHERE Sender ='David'
LIMIT 50
ORDER BY Date DESC
Outbox
46. Recipient Date Sender Message
David 2014-10-02 Bob …
… 48 more messages for David …
David 2014-10-03 Alice …
Alice 2014-09-28 Bob …
Alice 2014-10-01 Carol …
大小のデータが混在
(Many more messages)
David
Messages Table
50 items × 平均 256 KB
大きなメッセージボディーを
格納
SELECT *
FROM Messages
WHERE Recipient='David'
LIMIT 50
ORDER BY Date DESC
Inbox
48. Recipient Date Sender Subject MsgId
David 2014-10-02 Bob Hi!… afed
David 2014-10-03 Alice RE: The… 3kf8
Alice 2014-09-28 Bob FW: Ok… 9d2b
Alice 2014-10-01 Carol Hi!... ct7r
大きいデータを分けて配置
Inbox-GSI Messages Table
MsgId Body
9d2b …
3kf8 …
ct7r …
afed …
David
1. Query Inbox-GSI: 1 RCU
2. BatchGetItem Messages: 1600 RCU
(50 separate items at 256 KB)
(50 sequential items at 128 bytes)
均等に大きいアイテムを読むように配置
(Recipientをindex,
Message メタデータを格納)
55. View Type Destination
Old Image – 更新前の情報 Name = John, Destination = Mars
New Image – 更新後の情報 Name = John, Destination = Pluto
Old and New Images Name = John, Destination = Mars
Name = John, Destination = Pluto
Keys Only Name = John
View types
更新情報(Name = John, Destination = Mars)
⇒(Name = John, Destination = Pluto)