SlideShare una empresa de Scribd logo
1 de 143
Descargar para leer sin conexión
November 13, 2014 | Las Vegas, NV 
David Yanacek, Amazon DynamoDB
Cache read-heavy items
Product A 
Product B 
Shopper 
ProductCatalogTable
Product A 
Product B 
Shopper 
SELECT Id, Description, ... 
FROM ProductCatalog 
WHERE Id=“Product A” 
ProductCatalogTable
Need to scale 
for the sale 
Administrator (You) 
ProductCatalogTable
Administrator (You) 
Provision 5000 read capacity units 
ProductCatalogTable
Administrator (You) 
2500 read capacity units (each) 
Provision 5000 read capacity units 
Partition 1 
Partition 2 
ProductCatalogTable
Administrator (You) 
(no sharing) 
Partition 1 
Partition 2 
ProductCatalogTable 
Provision 5000 read capacity units
Partition 1 
Partition 2 
ProductCatalogTable
Administrator (You) 
ProductCatalogTable 
Provision 100,000 read capacity units 
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU
Product A 
Product B 
Shoppers 
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
ProductCatalogTable
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
Product A 
Product B 
Shoppers 
ProductCatalogTable
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
Product A 
Product B 
Shoppers 
ProductCatalogTable
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
Product A 
Product B 
Shoppers 
ProductCatalogTable
Size 
Throughput
#표푓푃푎푟푡푖푡푖표푛푠= 푇푎푏푙푒푆푖푧푒푖푛푏푦푡푒푠 10퐺퐵 
(푓표푟푠푖푧푒)
#표푓푃푎푟푡푖푡푖표푛푠 
(푓표푟푡ℎ푟표푢푔ℎ푝푢푡) 
= 푅퐶푈푓표푟푟푒푎푑푠 3000푅퐶푈 + 푊퐶푈푓표푟푤푟푖푡푒푠 1000푊퐶푈
(푓표푟푡ℎ푟표푢푔ℎ푝푢푡) 
(푓표푟푠푖푧푒) 
(푡표푡푎푙)
100,000푅퐶푈 50푃푎푟푡푖푡푖표푛푠 ≈ퟐퟎퟎퟎ푟푒푎푑푐푎푝푎푐푖푡푦푢푛푖푡푠푝푒푟푝푎푟푡푖푡푖표푛 
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
ProductCatalogTable
Space 
Time
Partition 
Time 
Heat
0 
400 
800 
1200 
1600 
Capacity Units 
Time 
Provisioned 
Consumed 
“save up” unused capacity 
consume saved up capacity
0 
400 
800 
1200 
1600 
Capacity Units 
Time 
Provisioned 
Consumed 
Attempted 
Burst capacity: 300 seconds 
(1200 ×300 = 3600 CU) 
Throttled requests
Partition 1 
2000 RCU 
Partition K 
2000 RCU 
Partition M 
2000 RCU 
Partition 50 
2000 RCU 
Product A 
Product B 
Shoppers 
ProductCatalogTable
Requests Per Second 
Item Primary Key 
Request Distribution Per Hash Key 
DynamoDB Requests
Requests Per Second 
Item Primary Key 
Request Distribution Per Hash Key 
DynamoDB Requests 
Cache Hits
Partition 1 
Partition 2 
ProductCatalogTable 
User 
DynamoDB 
User 
SELECT Id, Description, ... 
FROM ProductCatalog 
WHERE Id="POPULAR_PRODUCT"
Substitute indexes for filters
GameId 
Date 
Host 
Opponent 
Status 
d9bl3 
2014-10-02 
David 
Alice 
DONE 
72f49 
2014-09-30 
Alice 
Bob 
PENDING 
o2pnb 
2014-10-08 
Bob 
Carol 
IN_PROGRESS 
b932s 
2014-10-03 
Carol 
Bob 
PENDING 
ef9ca 
2014-10-03 
David 
Bob 
IN_PROGRESS 
Games Table
GameId 
Date 
Host 
Opponent 
Status 
d9bl3 
2014-10-02 
David 
Alice 
DONE 
72f49 
2014-09-30 
Alice 
Bob 
PENDING 
o2pnb 
2014-10-08 
Bob 
Carol 
IN_PROGRESS 
b932s 
2014-10-03 
Carol 
Bob 
PENDING 
ef9ca 
2014-10-03 
David 
Bob 
IN_PROGRESS 
Games Table
IN_PROGRESS 
DONE 
PENDING
Secondary Index 
Bob 
Opponent 
Status 
GameId 
Date 
Host 
Alice 
DONE 
d9bl3 
2014-10-02 
David 
Carol 
IN_PROGRESS 
o2pnb 
2014-10-08 
Bob 
Bob 
IN_PROGRESS 
ef9ca 
2014-10-03 
David 
Bob 
PENDING 
72f49 
2014-10-03 
Alice 
Bob 
PENDING 
b932s 
2014-09-30 
Carol
Secondary Index 
Opponent 
Status 
GameId 
Date 
Host 
Alice 
DONE 
d9bl3 
2014-10-02 
David 
Carol 
IN_PROGRESS 
o2pnb 
2014-10-08 
Bob 
Bob 
IN_PROGRESS 
ef9ca 
2014-10-03 
David 
Bob 
PENDING 
72f49 
2014-10-03 
Alice 
Bob 
PENDING 
b932s 
2014-09-30 
Carol 
Bob
Secondary Index 
Opponent 
Status 
GameId 
Date 
Host 
Alice 
DONE 
d9bl3 
2014-10-02 
David 
Carol 
IN_PROGRESS 
o2pnb 
2014-10-08 
Bob 
Bob 
IN_PROGRESS 
ef9ca 
2014-10-03 
David 
Bob 
PENDING 
72f49 
2014-10-03 
Alice 
Bob 
PENDING 
b932s 
2014-09-30 
Carol 
Bob 
SELECT * FROM Game 
WHERE Opponent='Bob' 
AND Status='PENDING'
Bob 
SELECT * FROM Game 
WHERE Opponent='Bob' 
AND Status='PENDING' 
ORDER BY Date? 
Opponent 
Status 
GameId 
Date 
Host 
Alice 
DONE 
d9bl3 
2014-10-02 
David 
Carol 
IN_PROGRESS 
o2pnb 
2014-10-08 
Bob 
Bob 
IN_PROGRESS 
ef9ca 
2014-10-03 
David 
Bob 
PENDING 
72f49 
2014-10-03 
Alice 
Bob 
PENDING 
b932s 
2014-09-30 
Carol 
Secondary Index
SELECT * FROM Game 
WHERE Opponent='Bob' 
AND Status='IN_PROGRESS' 
ORDER BY Date? 
(hash) 
(range) 
(?)
Secondary Index 
Opponent 
Date 
GameId 
Status 
Host 
Alice 
2014-10-02 
d9bl3 
DONE 
David 
Carol 
2014-10-08 
o2pnb 
IN_PROGRESS 
Bob 
Bob 
2014-09-30 
72f49 
PENDING 
Alice 
Bob 
2014-10-03 
b932s 
PENDING 
Carol 
Bob 
2014-10-03 
ef9ca 
IN_PROGRESS 
David 
Bob
Secondary Index 
Bob 
Opponent 
Date 
GameId 
Status 
Host 
Alice 
2014-10-02 
d9bl3 
DONE 
David 
Carol 
2014-10-08 
o2pnb 
IN_PROGRESS 
Bob 
Bob 
2014-09-30 
72f49 
PENDING 
Alice 
Bob 
2014-10-03 
b932s 
PENDING 
Carol 
Bob 
2014-10-03 
ef9ca 
IN_PROGRESS 
David 
SELECT * FROM Game 
WHERE Opponent='Bob' 
ORDER BY Date DESC 
FILTER ON Status='PENDING' 
(filtered out)
Bob
Bob
StatusDate 
DONE_2014-10-02 
IN_PROGRESS_2014-10-08 
IN_PROGRESS_2014-10-03 
PENDING_2014-09-30 
PENDING_2014-10-03 
Status 
DONE 
IN_PROGRESS 
IN_PROGRESS 
PENDING 
PENDING 
Date 
2014-10-02 
2014-10-08 
2014-10-03 
2014-10-03 
2014-09-30
Secondary Index 
Opponent 
StatusDate 
GameId 
Host 
Alice 
DONE_2014-10-02 
d9bl3 
David 
Carol 
IN_PROGRESS_2014-10-08 
o2pnb 
Bob 
Bob 
IN_PROGRESS_2014-10-03 
ef9ca 
David 
Bob 
PENDING_2014-09-30 
72f49 
Alice 
Bob 
PENDING_2014-10-03 
b932s 
Carol
Opponent 
StatusDate 
GameId 
Host 
Alice 
DONE_2014-10-02 
d9bl3 
David 
Carol 
IN_PROGRESS_2014-10-08 
o2pnb 
Bob 
Bob 
IN_PROGRESS_2014-10-03 
ef9ca 
David 
Bob 
PENDING_2014-09-30 
72f49 
Alice 
Bob 
PENDING_2014-10-03 
b932s 
Carol 
Secondary Index 
Bob 
SELECT * FROM Game 
WHERE Opponent='Bob' 
AND StatusDate STARTS_WITH 'PENDING'
Status + Date
Distribute large items
Messages 
Table 
Messages app
David 
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) 
MessagesTable
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 
MessagesTable 
SELECT * 
FROM Messages 
WHERE Recipient='David' 
LIMIT 50 
ORDER BY Date DESC
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 
MessagesTable 
Cost of query? 
SELECT * 
FROM Messages 
WHERE Recipient='David' 
LIMIT 50 
ORDER BY Date DESC
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) 
MessagesTable 
Average item size = 256 KB 
Large message bodies 
Attachments? 
David 
SELECT * 
FROM Messages 
WHERE Recipient='David' 
LIMIT 50 
ORDER BY Date DESC
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 
MessagesTable 
50 items ×256 KB each 
SELECT * 
FROM Messages 
WHERE Recipient='David' 
LIMIT 50 
ORDER BY Date DESC
Items evaluated by query 
Average item size 
Conversion ratio 
Eventually consistent reads
Messages 
Table 
Inbox 
Table 
Messages app
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 Table 
Messages Table 
MsgId 
Body 
9d2b 
… 
3kf8 
… 
ct7r 
… 
afed 
… 
(Bulk message data) 
(Message metadata, indexed by recipient)
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 Table 
Messages Table 
MsgId 
Body 
9d2b 
… 
3kf8 
… 
ct7r 
… 
afed 
… 
David 
1.Query Inbox: 1 RCU 
(50 sequential items at 128 bytes)
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 Table 
Messages Table 
MsgId 
Body 
9d2b 
… 
3kf8 
… 
ct7r 
… 
afed 
… 
David 
1.Query Inbox: 1 RCU 
2.BatchGetItem Messages: 1600 RCU 
(50 separate items at 256 KB) 
(50 sequential items at 128 bytes)
Messages 
Table 
Inbox 
Table 
David 
PutItem 
{ 
MsgId: 123, 
Body: ... 
} 
PutItem 
{ 
Recipient: Steve, 
Date: 2014-10-23, 
MsgId: 123, 
... 
}
Messages 
Table 
Inbox 
Table 
David 
PutItem 
{ 
MsgId: 123, 
Body: ... 
} 
PutItem 
{ 
Recipient: Steve, 
Date: 2014-10-23, 
MsgId: 123, 
... 
}
David 
PutItem 
{ 
MsgId: 123, 
Body: ..., 
Recipient: Steve, 
Sender: David, 
Date: 2014-10-23, 
... 
} 
Inbox 
Global secondary 
index 
Messages 
Table
Inbox 
Global secondary 
index 
Messages 
Table 
David 
Outbox 
Global secondary 
index 
Coming soon:
Inbox 
Messages
De-normalize schemas 
Design for retries
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
Friends Table 
HighScoresTable 
User 
Friend 
Bob 
Alice 
Bob 
Chuck 
Alice 
Bob 
Alice 
Chuck 
Alice 
Erin
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
Friends Table 
HighScoresTable 
User 
Friend 
Bob 
Alice 
Bob 
Chuck 
Alice 
Bob 
Alice 
Chuck 
Alice 
Erin 
Alice
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
Friends Table 
HighScoresTable 
User 
Friend 
Bob 
Alice 
Bob 
Chuck 
Alice 
Bob 
Alice 
Chuck 
Alice 
Erin 
1. Query 
2. BatchGetItem 
Alice
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
20 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
Table 
FriendScoresTable 
HighScoresTable
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
20 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
H.S. 
Friend 
Bob 
20 
Chuck 
Bob 
1000 
Alice 
Alice 
20 
Chuck 
Alice 
470 
Bob 
Alice 
580 
Erin 
Table 
Local Secondary Index 
FriendScoresTable 
HighScoresTable
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
20 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
User 
HighScore 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
H.S. 
Friend 
Bob 
20 
Chuck 
Bob 
1000 
Alice 
Alice 
20 
Chuck 
Alice 
470 
Bob 
Alice 
580 
Erin 
Table 
Local Secondary Index 
FriendScoresTable 
HighScoresTable 
Query 
FROM FriendScores-Index 
WHERE User=Alice, DESC, LIMIT 10 
Alice
Scores 
Friends
User 
HighScore 
Chuck 
30 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
30 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
1. UpdateItem 
2. UpdateItem(s) 
Chuck
User 
HighScore 
Chuck 
30 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
1. UpdateItem 
2. UpdateItem(s) 
Chuck
User 
H.S. 
Updating 
Chuck 
20 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
20 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
truewhile updating the high score
User 
H.S. 
Updating 
Chuck 
30 
true 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
20 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
1. UpdateItem 
Chuck
User 
H.S. 
Updating 
Chuck 
30 
true 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
Chuck 
2. UpdateItem(s)
User 
H.S. 
Updating 
Chuck 
30 
true 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
20 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
Chuck 
3. GetItem
User 
H.S. 
Updating 
Chuck 
30 
true 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
30 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
Chuck 
4. UpdateItem(s)
User 
H.S. 
Updating 
Chuck 
30 
Alice 
1000 
Bob 
470 
Dave 
850 
Erin 
580 
User 
Friend 
H.S. 
Bob 
Alice 
1000 
Bob 
Chuck 
30 
Alice 
Bob 
470 
Alice 
Chuck 
30 
Alice 
Erin 
580 
FriendScoresTable 
HighScoresTable 
5. UpdateItem 
Chuck
PutItemRequestacceptBob; 
PutItemRequestacknowledgeChuck; 
Transaction t = txManager.newTransaction(); 
t.putItem(acceptBob); 
t.putItem(acknowledgeChuck); 
t.commit();
Friends Table 
Transactions Table 
Transaction Images 
Table 
Transaction 
Client 
Bob
Your app 
FriendScoresTable 
HighScoresTable
Your app 
FriendScoresTable 
HighScoresTable
Your 
Kinesis-enabled app 
Your app 
FriendScoresTable 
HighScoresDynamoDB Stream 
HighScoresTable
User 
H.S. 
Chuck 
20 
Alice 
100 
HighScoresTable 
Chuck 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
HighScoresStream
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
Chuck 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
HighScoresStream
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
Chuck 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
Chuck 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
User 
Friend 
H.S. 
Bob 
Chuck 
20 
Alice 
Chuck 
20 
FriendScoresTable 
Friend 
User 
Chuck 
Alice 
Chuck 
Bob 
Table 
Global Secondary Index 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream 
Your 
Kinesis-enabled app
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
User 
Friend 
H.S. 
Bob 
Chuck 
20 
Alice 
Chuck 
20 
FriendScoresTable 
Friend 
User 
Chuck 
Alice 
Chuck 
Bob 
Table 
Global Secondary Index 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream 
Your 
Kinesis-enabled app
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScoresTable 
User 
Friend 
H.S. 
Bob 
Chuck 
30 
Alice 
Chuck 
30 
FriendScoresTable 
Friend 
User 
Chuck 
Alice 
Chuck 
Bob 
Table 
Global Secondary Index 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream 
Your 
Kinesis-enabled app
User 
H.S. 
Chuck 
30 
Alice 
100 
HighScores Table 
User 
Friend 
H.S. 
Bob 
Chuck 
30 
Alice 
Chuck 
30 
FriendScores Table 
Friend 
User 
Chuck 
Alice 
Chuck 
Bob 
Table 
Global Secondary Index 
Seq 
User 
Old 
New 
1 
Chuck 
10 
20 
2 
Alice 
80 
90 
3 
Alice 
90 
100 
4 
Chuck 
20 
30 
HighScoresStream 
Your 
Kinesis-enabled app 
Streams Checkpoint Table
Shard write-heavy items 
Design for retries
Candidate A 
Votes: 20 
Candidate B 
Votes: 30 
Voter 
Votes Table
Candidate A 
Votes: 21 
Candidate B 
Votes: 30 
Votes Table 
UPDATE Votes 
SET Votes = Votes + 1 
WHERE Id=“Candidate A” 
Voter 
(aka atomic increment)
Need to scale 
for the election 
Administrator (You) 
Votes Table
Administrator (You) 
Provision 200,000 write capacity units 
Partition 1 
1000 WCU 
Partition K 
1000 WCU 
Partition M 
1000 WCU 
Partition N 
1000 WCU 
Votes Table
Candidate A 
Candidate B 
Voters 
Partition 1 
1000 WCU 
Partition K 
1000 WCU 
Partition M 
1000 WCU 
Partition N 
1000 WCU 
Votes Table
Partition 1 
1000 WCU 
Partition K 
1000 WCU 
Partition M 
1000 WCU 
Partition N 
1000 WCU 
Votes Table 
Candidate A 
Candidate B 
Voters
Candidate A 
Candidate A_2 
Candidate A_1 
Candidate A_3 
Candidate A_4 
Candidate A_7 
Candidate A_6 
Candidate A_8 
Candidate A_5
Candidate A_2 
Candidate B_1 
Candidate B_2 
Candidate B_3 
Candidate B_5 
Candidate B_4 
Candidate B_7 
Candidate B_6 
Candidate A_1 
Candidate A_3 
Candidate A_4 
Candidate A_7 
Candidate B_8 
Candidate A_6 
Candidate A_8 
Candidate A_5 
Voter 
Votes Table
Candidate A_2 
Candidate B_1 
Candidate B_2 
Candidate B_3 
Candidate B_5 
Candidate B_4 
Candidate B_7 
Candidate B_6 
Candidate A_1 
Candidate A_3 
Candidate A_4 
Candidate A_7 
Candidate B_8 
UpdateItem: “CandidateA_” + rand(0, 10) 
ADD 1 to Votes 
Candidate A_6 
Candidate A_8 
Candidate A_5 
Voter 
Votes Table
Votes Table 
Candidate A_2 
Candidate B_1 
Candidate B_2 
Candidate B_3 
Candidate B_5 
Candidate B_4 
Candidate B_7 
Candidate B_6 
Candidate A_1 
Candidate A_3 
Candidate A_4 
Candidate A_5 
Candidate A_6 
Candidate A_8 
Candidate A_7 
Candidate B_8 
Periodic Process 
Candidate A 
Total: 2.5M 
1. Sum 
2. Store 
Voter
UserId 
Candidate 
Date 
Alice 
A 
2013-10-02 
Bob 
B 
2013-10-02 
Eve 
B 
2013-10-02 
Chuck 
A 
2013-10-02 
RawVotesTable 
Voter
UserId 
Candidate 
Date 
Alice 
A 
2013-10-02 
Bob 
B 
2013-10-02 
Eve 
B 
2013-10-02 
Chuck 
A 
2013-10-02 
RawVotesTable 
Segment 
Votes 
A_1 
23 
B_2 
12 
B_1 
14 
A_2 
25 
AggregateVotesTable 
Voter 
1. Record vote and de-dupe, retry 
2. Increment candidate counter
UserId 
Candidate 
Date 
Alice 
A 
2013-10-02 
Bob 
B 
2013-10-02 
Eve 
B 
2013-10-02 
Chuck 
A 
2013-10-02 
RawVotesTable 
Segment 
Votes 
A_1 
23 
B_2 
12 
B_1 
14 
A_2 
25 
AggregateVotesTable 
Voter
AggregateVotes 
Table 
Voters 
RawVotesTable 
Voting app
AggregateVotes 
Table 
Amazon Redshift 
Amazon EMR 
Your 
Kinesis-enabled app 
Voters 
RawVotesTable 
Voting app 
RawVotes 
DynamoDB Stream
AggregateVotes 
Table 
Amazon Redshift 
Amazon EMR 
Your 
Kinesis-enabled app 
Voters 
RawVotesTable 
Voting app 
RawVotes 
DynamoDB Stream
AggregateVotes 
Table 
Amazon Redshift 
Amazon EMR 
Your 
Kinesis-enabled app 
Voters 
RawVotesTable 
Voting app 
RawVotes 
DynamoDB Stream
AggregateVotes 
Table 
Amazon Redshift 
Amazon EMR 
Your 
Kinesis-enabled app 
Voters 
RawVotesTable 
Voting app 
RawVotes 
DynamoDB Stream
AggregateVotes 
Table 
Amazon Redshift 
Amazon EMR 
Your 
Kinesis-enabled app 
Voters 
RawVotesTable 
Voting app 
RawVotes 
DynamoDB Stream
Status + Date
Inbox 
Messages
Scores 
Friends
http://bit.ly/awsevals

Más contenido relacionado

La actualidad más candente

Kinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみたKinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみたMasaki Misawa
 
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...Amazon Web Services
 
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデートAmazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデートAmazon Web Services Japan
 
AWS Aurora 운영사례 (by 배은미)
AWS Aurora 운영사례 (by 배은미)AWS Aurora 운영사례 (by 배은미)
AWS Aurora 운영사례 (by 배은미)I Goo Lee.
 
Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理Amazon Web Services Japan
 
[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎Shuji Kikuchi
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon Web Services Korea
 
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAmazon Web Services Japan
 
クラウド上のデータ活用デザインパターン
クラウド上のデータ活用デザインパターンクラウド上のデータ活用デザインパターン
クラウド上のデータ活用デザインパターンAmazon Web Services Japan
 
20191001 AWS Black Belt Online Seminar AWS Lake Formation
20191001 AWS Black Belt Online Seminar AWS Lake Formation 20191001 AWS Black Belt Online Seminar AWS Lake Formation
20191001 AWS Black Belt Online Seminar AWS Lake Formation Amazon Web Services Japan
 
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析Amazon Web Services Japan
 
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)NTT DATA Technology & Innovation
 
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...Amazon Web Services Korea
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기I Goo Lee
 
SQLアンチパターン - ナイーブツリー
SQLアンチパターン - ナイーブツリーSQLアンチパターン - ナイーブツリー
SQLアンチパターン - ナイーブツリーke-m kamekoopa
 
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
 
20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems ManagerAmazon Web Services Japan
 
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon Web Services Korea
 

La actualidad más candente (20)

Kinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみたKinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみた
 
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...
Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321) ...
 
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデートAmazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデート
 
AWS Aurora 운영사례 (by 배은미)
AWS Aurora 운영사례 (by 배은미)AWS Aurora 운영사례 (by 배은미)
AWS Aurora 운영사례 (by 배은미)
 
Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理
 
[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎[AKIBA.AWS] VPN接続とルーティングの基礎
[AKIBA.AWS] VPN接続とルーティングの基礎
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
 
クラウド上のデータ活用デザインパターン
クラウド上のデータ活用デザインパターンクラウド上のデータ活用デザインパターン
クラウド上のデータ活用デザインパターン
 
AWS BlackBelt AWS上でのDDoS対策
AWS BlackBelt AWS上でのDDoS対策AWS BlackBelt AWS上でのDDoS対策
AWS BlackBelt AWS上でのDDoS対策
 
20191001 AWS Black Belt Online Seminar AWS Lake Formation
20191001 AWS Black Belt Online Seminar AWS Lake Formation 20191001 AWS Black Belt Online Seminar AWS Lake Formation
20191001 AWS Black Belt Online Seminar AWS Lake Formation
 
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析
Amazon Kinesis Analytics によるストリーミングデータのリアルタイム分析
 
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
 
ここから始めるAWSセキュリティ
ここから始めるAWSセキュリティここから始めるAWSセキュリティ
ここから始めるAWSセキュリティ
 
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기
 
SQLアンチパターン - ナイーブツリー
SQLアンチパターン - ナイーブツリーSQLアンチパターン - ナイーブツリー
SQLアンチパターン - ナイーブツリー
 
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
 
20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager
 
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
 

Similar a (SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:Invent 2014

(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014Amazon Web Services
 
DynamoDB as a Secondary Language - Pop-up Loft Tel Aviv
DynamoDB as a Secondary Language - Pop-up Loft Tel AvivDynamoDB as a Secondary Language - Pop-up Loft Tel Aviv
DynamoDB as a Secondary Language - Pop-up Loft Tel AvivAmazon Web Services
 

Similar a (SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:Invent 2014 (7)

Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Amazon DynamoDB Workshop
Amazon DynamoDB WorkshopAmazon DynamoDB Workshop
Amazon DynamoDB Workshop
 
Geemus
GeemusGeemus
Geemus
 
Fog
FogFog
Fog
 
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
 
DynamoDB as a Secondary Language - Pop-up Loft Tel Aviv
DynamoDB as a Secondary Language - Pop-up Loft Tel AvivDynamoDB as a Secondary Language - Pop-up Loft Tel Aviv
DynamoDB as a Secondary Language - Pop-up Loft Tel Aviv
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 

Más de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:Invent 2014

  • 1. November 13, 2014 | Las Vegas, NV David Yanacek, Amazon DynamoDB
  • 2.
  • 3.
  • 4.
  • 6.
  • 7. Product A Product B Shopper ProductCatalogTable
  • 8. Product A Product B Shopper SELECT Id, Description, ... FROM ProductCatalog WHERE Id=“Product A” ProductCatalogTable
  • 9. Need to scale for the sale Administrator (You) ProductCatalogTable
  • 10. Administrator (You) Provision 5000 read capacity units ProductCatalogTable
  • 11. Administrator (You) 2500 read capacity units (each) Provision 5000 read capacity units Partition 1 Partition 2 ProductCatalogTable
  • 12. Administrator (You) (no sharing) Partition 1 Partition 2 ProductCatalogTable Provision 5000 read capacity units
  • 13. Partition 1 Partition 2 ProductCatalogTable
  • 14. Administrator (You) ProductCatalogTable Provision 100,000 read capacity units Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU
  • 15. Product A Product B Shoppers Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU ProductCatalogTable
  • 16. Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU Product A Product B Shoppers ProductCatalogTable
  • 17. Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU Product A Product B Shoppers ProductCatalogTable
  • 18. Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU Product A Product B Shoppers ProductCatalogTable
  • 19.
  • 22. #표푓푃푎푟푡푖푡푖표푛푠 (푓표푟푡ℎ푟표푢푔ℎ푝푢푡) = 푅퐶푈푓표푟푟푒푎푑푠 3000푅퐶푈 + 푊퐶푈푓표푟푤푟푖푡푒푠 1000푊퐶푈
  • 24. 100,000푅퐶푈 50푃푎푟푡푖푡푖표푛푠 ≈ퟐퟎퟎퟎ푟푒푎푑푐푎푝푎푐푖푡푦푢푛푖푡푠푝푒푟푝푎푟푡푖푡푖표푛 Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU ProductCatalogTable
  • 27.
  • 28. 0 400 800 1200 1600 Capacity Units Time Provisioned Consumed “save up” unused capacity consume saved up capacity
  • 29. 0 400 800 1200 1600 Capacity Units Time Provisioned Consumed Attempted Burst capacity: 300 seconds (1200 ×300 = 3600 CU) Throttled requests
  • 30.
  • 31. Partition 1 2000 RCU Partition K 2000 RCU Partition M 2000 RCU Partition 50 2000 RCU Product A Product B Shoppers ProductCatalogTable
  • 32.
  • 33. Requests Per Second Item Primary Key Request Distribution Per Hash Key DynamoDB Requests
  • 34. Requests Per Second Item Primary Key Request Distribution Per Hash Key DynamoDB Requests Cache Hits
  • 35. Partition 1 Partition 2 ProductCatalogTable User DynamoDB User SELECT Id, Description, ... FROM ProductCatalog WHERE Id="POPULAR_PRODUCT"
  • 36.
  • 38.
  • 39. GameId Date Host Opponent Status d9bl3 2014-10-02 David Alice DONE 72f49 2014-09-30 Alice Bob PENDING o2pnb 2014-10-08 Bob Carol IN_PROGRESS b932s 2014-10-03 Carol Bob PENDING ef9ca 2014-10-03 David Bob IN_PROGRESS Games Table
  • 40. GameId Date Host Opponent Status d9bl3 2014-10-02 David Alice DONE 72f49 2014-09-30 Alice Bob PENDING o2pnb 2014-10-08 Bob Carol IN_PROGRESS b932s 2014-10-03 Carol Bob PENDING ef9ca 2014-10-03 David Bob IN_PROGRESS Games Table
  • 42.
  • 43. Secondary Index Bob Opponent Status GameId Date Host Alice DONE d9bl3 2014-10-02 David Carol IN_PROGRESS o2pnb 2014-10-08 Bob Bob IN_PROGRESS ef9ca 2014-10-03 David Bob PENDING 72f49 2014-10-03 Alice Bob PENDING b932s 2014-09-30 Carol
  • 44. Secondary Index Opponent Status GameId Date Host Alice DONE d9bl3 2014-10-02 David Carol IN_PROGRESS o2pnb 2014-10-08 Bob Bob IN_PROGRESS ef9ca 2014-10-03 David Bob PENDING 72f49 2014-10-03 Alice Bob PENDING b932s 2014-09-30 Carol Bob
  • 45. Secondary Index Opponent Status GameId Date Host Alice DONE d9bl3 2014-10-02 David Carol IN_PROGRESS o2pnb 2014-10-08 Bob Bob IN_PROGRESS ef9ca 2014-10-03 David Bob PENDING 72f49 2014-10-03 Alice Bob PENDING b932s 2014-09-30 Carol Bob SELECT * FROM Game WHERE Opponent='Bob' AND Status='PENDING'
  • 46. Bob SELECT * FROM Game WHERE Opponent='Bob' AND Status='PENDING' ORDER BY Date? Opponent Status GameId Date Host Alice DONE d9bl3 2014-10-02 David Carol IN_PROGRESS o2pnb 2014-10-08 Bob Bob IN_PROGRESS ef9ca 2014-10-03 David Bob PENDING 72f49 2014-10-03 Alice Bob PENDING b932s 2014-09-30 Carol Secondary Index
  • 47. SELECT * FROM Game WHERE Opponent='Bob' AND Status='IN_PROGRESS' ORDER BY Date? (hash) (range) (?)
  • 48. Secondary Index Opponent Date GameId Status Host Alice 2014-10-02 d9bl3 DONE David Carol 2014-10-08 o2pnb IN_PROGRESS Bob Bob 2014-09-30 72f49 PENDING Alice Bob 2014-10-03 b932s PENDING Carol Bob 2014-10-03 ef9ca IN_PROGRESS David Bob
  • 49. Secondary Index Bob Opponent Date GameId Status Host Alice 2014-10-02 d9bl3 DONE David Carol 2014-10-08 o2pnb IN_PROGRESS Bob Bob 2014-09-30 72f49 PENDING Alice Bob 2014-10-03 b932s PENDING Carol Bob 2014-10-03 ef9ca IN_PROGRESS David SELECT * FROM Game WHERE Opponent='Bob' ORDER BY Date DESC FILTER ON Status='PENDING' (filtered out)
  • 50.
  • 51. Bob
  • 52. Bob
  • 53.
  • 54. StatusDate DONE_2014-10-02 IN_PROGRESS_2014-10-08 IN_PROGRESS_2014-10-03 PENDING_2014-09-30 PENDING_2014-10-03 Status DONE IN_PROGRESS IN_PROGRESS PENDING PENDING Date 2014-10-02 2014-10-08 2014-10-03 2014-10-03 2014-09-30
  • 55. Secondary Index Opponent StatusDate GameId Host Alice DONE_2014-10-02 d9bl3 David Carol IN_PROGRESS_2014-10-08 o2pnb Bob Bob IN_PROGRESS_2014-10-03 ef9ca David Bob PENDING_2014-09-30 72f49 Alice Bob PENDING_2014-10-03 b932s Carol
  • 56. Opponent StatusDate GameId Host Alice DONE_2014-10-02 d9bl3 David Carol IN_PROGRESS_2014-10-08 o2pnb Bob Bob IN_PROGRESS_2014-10-03 ef9ca David Bob PENDING_2014-09-30 72f49 Alice Bob PENDING_2014-10-03 b932s Carol Secondary Index Bob SELECT * FROM Game WHERE Opponent='Bob' AND StatusDate STARTS_WITH 'PENDING'
  • 59.
  • 61. David 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) MessagesTable
  • 62. 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 MessagesTable SELECT * FROM Messages WHERE Recipient='David' LIMIT 50 ORDER BY Date DESC
  • 63. 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 MessagesTable Cost of query? SELECT * FROM Messages WHERE Recipient='David' LIMIT 50 ORDER BY Date DESC
  • 64. 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) MessagesTable Average item size = 256 KB Large message bodies Attachments? David SELECT * FROM Messages WHERE Recipient='David' LIMIT 50 ORDER BY Date DESC
  • 65. 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 MessagesTable 50 items ×256 KB each SELECT * FROM Messages WHERE Recipient='David' LIMIT 50 ORDER BY Date DESC
  • 66. Items evaluated by query Average item size Conversion ratio Eventually consistent reads
  • 67. Messages Table Inbox Table Messages app
  • 68. 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 Table Messages Table MsgId Body 9d2b … 3kf8 … ct7r … afed … (Bulk message data) (Message metadata, indexed by recipient)
  • 69. 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 Table Messages Table MsgId Body 9d2b … 3kf8 … ct7r … afed … David 1.Query Inbox: 1 RCU (50 sequential items at 128 bytes)
  • 70. 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 Table Messages Table MsgId Body 9d2b … 3kf8 … ct7r … afed … David 1.Query Inbox: 1 RCU 2.BatchGetItem Messages: 1600 RCU (50 separate items at 256 KB) (50 sequential items at 128 bytes)
  • 71. Messages Table Inbox Table David PutItem { MsgId: 123, Body: ... } PutItem { Recipient: Steve, Date: 2014-10-23, MsgId: 123, ... }
  • 72. Messages Table Inbox Table David PutItem { MsgId: 123, Body: ... } PutItem { Recipient: Steve, Date: 2014-10-23, MsgId: 123, ... }
  • 73. David PutItem { MsgId: 123, Body: ..., Recipient: Steve, Sender: David, Date: 2014-10-23, ... } Inbox Global secondary index Messages Table
  • 74.
  • 75. Inbox Global secondary index Messages Table David Outbox Global secondary index Coming soon:
  • 78.
  • 79. User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 Friends Table HighScoresTable User Friend Bob Alice Bob Chuck Alice Bob Alice Chuck Alice Erin
  • 80. User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 Friends Table HighScoresTable User Friend Bob Alice Bob Chuck Alice Bob Alice Chuck Alice Erin Alice
  • 81. User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 Friends Table HighScoresTable User Friend Bob Alice Bob Chuck Alice Bob Alice Chuck Alice Erin 1. Query 2. BatchGetItem Alice
  • 82.
  • 83. User Friend H.S. Bob Alice 1000 Bob Chuck 20 Alice Bob 470 Alice Chuck 20 Alice Erin 580 User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 Table FriendScoresTable HighScoresTable
  • 84. User Friend H.S. Bob Alice 1000 Bob Chuck 20 Alice Bob 470 Alice Chuck 20 Alice Erin 580 User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 User H.S. Friend Bob 20 Chuck Bob 1000 Alice Alice 20 Chuck Alice 470 Bob Alice 580 Erin Table Local Secondary Index FriendScoresTable HighScoresTable
  • 85. User Friend H.S. Bob Alice 1000 Bob Chuck 20 Alice Bob 470 Alice Chuck 20 Alice Erin 580 User HighScore Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 User H.S. Friend Bob 20 Chuck Bob 1000 Alice Alice 20 Chuck Alice 470 Bob Alice 580 Erin Table Local Secondary Index FriendScoresTable HighScoresTable Query FROM FriendScores-Index WHERE User=Alice, DESC, LIMIT 10 Alice
  • 87. User HighScore Chuck 30 Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 30 Alice Erin 580 FriendScoresTable HighScoresTable 1. UpdateItem 2. UpdateItem(s) Chuck
  • 88. User HighScore Chuck 30 Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 20 Alice Erin 580 FriendScoresTable HighScoresTable 1. UpdateItem 2. UpdateItem(s) Chuck
  • 89. User H.S. Updating Chuck 20 Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 20 Alice Bob 470 Alice Chuck 20 Alice Erin 580 FriendScoresTable HighScoresTable truewhile updating the high score
  • 90. User H.S. Updating Chuck 30 true Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 20 Alice Bob 470 Alice Chuck 20 Alice Erin 580 FriendScoresTable HighScoresTable 1. UpdateItem Chuck
  • 91. User H.S. Updating Chuck 30 true Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 20 Alice Erin 580 FriendScoresTable HighScoresTable Chuck 2. UpdateItem(s)
  • 92. User H.S. Updating Chuck 30 true Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 20 Alice Erin 580 FriendScoresTable HighScoresTable Chuck 3. GetItem
  • 93. User H.S. Updating Chuck 30 true Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 30 Alice Erin 580 FriendScoresTable HighScoresTable Chuck 4. UpdateItem(s)
  • 94. User H.S. Updating Chuck 30 Alice 1000 Bob 470 Dave 850 Erin 580 User Friend H.S. Bob Alice 1000 Bob Chuck 30 Alice Bob 470 Alice Chuck 30 Alice Erin 580 FriendScoresTable HighScoresTable 5. UpdateItem Chuck
  • 95.
  • 96. PutItemRequestacceptBob; PutItemRequestacknowledgeChuck; Transaction t = txManager.newTransaction(); t.putItem(acceptBob); t.putItem(acknowledgeChuck); t.commit();
  • 97. Friends Table Transactions Table Transaction Images Table Transaction Client Bob
  • 98.
  • 99.
  • 100. Your app FriendScoresTable HighScoresTable
  • 101. Your app FriendScoresTable HighScoresTable
  • 102. Your Kinesis-enabled app Your app FriendScoresTable HighScoresDynamoDB Stream HighScoresTable
  • 103. User H.S. Chuck 20 Alice 100 HighScoresTable Chuck Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 HighScoresStream
  • 104. User H.S. Chuck 30 Alice 100 HighScoresTable Chuck Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 HighScoresStream
  • 105. User H.S. Chuck 30 Alice 100 HighScoresTable Chuck Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream
  • 106. User H.S. Chuck 30 Alice 100 HighScoresTable Chuck Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream
  • 107. User H.S. Chuck 30 Alice 100 HighScoresTable User Friend H.S. Bob Chuck 20 Alice Chuck 20 FriendScoresTable Friend User Chuck Alice Chuck Bob Table Global Secondary Index Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream Your Kinesis-enabled app
  • 108. User H.S. Chuck 30 Alice 100 HighScoresTable User Friend H.S. Bob Chuck 20 Alice Chuck 20 FriendScoresTable Friend User Chuck Alice Chuck Bob Table Global Secondary Index Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream Your Kinesis-enabled app
  • 109. User H.S. Chuck 30 Alice 100 HighScoresTable User Friend H.S. Bob Chuck 30 Alice Chuck 30 FriendScoresTable Friend User Chuck Alice Chuck Bob Table Global Secondary Index Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream Your Kinesis-enabled app
  • 110. User H.S. Chuck 30 Alice 100 HighScores Table User Friend H.S. Bob Chuck 30 Alice Chuck 30 FriendScores Table Friend User Chuck Alice Chuck Bob Table Global Secondary Index Seq User Old New 1 Chuck 10 20 2 Alice 80 90 3 Alice 90 100 4 Chuck 20 30 HighScoresStream Your Kinesis-enabled app Streams Checkpoint Table
  • 111.
  • 112. Shard write-heavy items Design for retries
  • 113. Candidate A Votes: 20 Candidate B Votes: 30 Voter Votes Table
  • 114. Candidate A Votes: 21 Candidate B Votes: 30 Votes Table UPDATE Votes SET Votes = Votes + 1 WHERE Id=“Candidate A” Voter (aka atomic increment)
  • 115. Need to scale for the election Administrator (You) Votes Table
  • 116. Administrator (You) Provision 200,000 write capacity units Partition 1 1000 WCU Partition K 1000 WCU Partition M 1000 WCU Partition N 1000 WCU Votes Table
  • 117. Candidate A Candidate B Voters Partition 1 1000 WCU Partition K 1000 WCU Partition M 1000 WCU Partition N 1000 WCU Votes Table
  • 118. Partition 1 1000 WCU Partition K 1000 WCU Partition M 1000 WCU Partition N 1000 WCU Votes Table Candidate A Candidate B Voters
  • 119. Candidate A Candidate A_2 Candidate A_1 Candidate A_3 Candidate A_4 Candidate A_7 Candidate A_6 Candidate A_8 Candidate A_5
  • 120. Candidate A_2 Candidate B_1 Candidate B_2 Candidate B_3 Candidate B_5 Candidate B_4 Candidate B_7 Candidate B_6 Candidate A_1 Candidate A_3 Candidate A_4 Candidate A_7 Candidate B_8 Candidate A_6 Candidate A_8 Candidate A_5 Voter Votes Table
  • 121. Candidate A_2 Candidate B_1 Candidate B_2 Candidate B_3 Candidate B_5 Candidate B_4 Candidate B_7 Candidate B_6 Candidate A_1 Candidate A_3 Candidate A_4 Candidate A_7 Candidate B_8 UpdateItem: “CandidateA_” + rand(0, 10) ADD 1 to Votes Candidate A_6 Candidate A_8 Candidate A_5 Voter Votes Table
  • 122. Votes Table Candidate A_2 Candidate B_1 Candidate B_2 Candidate B_3 Candidate B_5 Candidate B_4 Candidate B_7 Candidate B_6 Candidate A_1 Candidate A_3 Candidate A_4 Candidate A_5 Candidate A_6 Candidate A_8 Candidate A_7 Candidate B_8 Periodic Process Candidate A Total: 2.5M 1. Sum 2. Store Voter
  • 123.
  • 124.
  • 125. UserId Candidate Date Alice A 2013-10-02 Bob B 2013-10-02 Eve B 2013-10-02 Chuck A 2013-10-02 RawVotesTable Voter
  • 126. UserId Candidate Date Alice A 2013-10-02 Bob B 2013-10-02 Eve B 2013-10-02 Chuck A 2013-10-02 RawVotesTable Segment Votes A_1 23 B_2 12 B_1 14 A_2 25 AggregateVotesTable Voter 1. Record vote and de-dupe, retry 2. Increment candidate counter
  • 127. UserId Candidate Date Alice A 2013-10-02 Bob B 2013-10-02 Eve B 2013-10-02 Chuck A 2013-10-02 RawVotesTable Segment Votes A_1 23 B_2 12 B_1 14 A_2 25 AggregateVotesTable Voter
  • 128. AggregateVotes Table Voters RawVotesTable Voting app
  • 129. AggregateVotes Table Amazon Redshift Amazon EMR Your Kinesis-enabled app Voters RawVotesTable Voting app RawVotes DynamoDB Stream
  • 130. AggregateVotes Table Amazon Redshift Amazon EMR Your Kinesis-enabled app Voters RawVotesTable Voting app RawVotes DynamoDB Stream
  • 131. AggregateVotes Table Amazon Redshift Amazon EMR Your Kinesis-enabled app Voters RawVotesTable Voting app RawVotes DynamoDB Stream
  • 132. AggregateVotes Table Amazon Redshift Amazon EMR Your Kinesis-enabled app Voters RawVotesTable Voting app RawVotes DynamoDB Stream
  • 133. AggregateVotes Table Amazon Redshift Amazon EMR Your Kinesis-enabled app Voters RawVotesTable Voting app RawVotes DynamoDB Stream
  • 134.
  • 135.
  • 136.
  • 137.
  • 141.
  • 142.