SlideShare a Scribd company logo
1 of 43
Download to read offline
Optimize Your Database for the Cloud
with DynamoDB
A Deep Dive into
Global Secondary Indexes (GSI)

David Pearson
Siva Raghupathy
1

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
automated operations

=

predictable performance

database service

durable low latency

cost effective

2

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Durable Low Latency

WRITES
Continuously replicated to 3 AZ’s
Quorum acknowledgment
Persisted to disk (custom SSD)

READS
Strongly or eventually consistent
No trade-off in latency
3

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Recent Announcements
Secondary Indexes (Local and Global)
DynamoDB Local
• Disconnected development with full API support
• No network
• No usage costs
• No SLA

Fine-Grained Access Control
• Direct-to-DynamoDB access for mobile devices

Geospatial and Transaction Libraries
4

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
table

5

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
table
items

6

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
table
items

attributes
schema-less
schema is defined per attribute

7

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
hash

hash keys
mandatory for all items in a table
key-value access pattern

8

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts

partition 1 .. N

hash keys
mandatory for all items in a table
key-value access pattern
determines data distribution
9

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
hash

range
range keys
model 1:N relationships
enable rich query capabilities
composite primary key

all items for a hash key
==, <, >, >=, <=
“begins with”
“between”
sorted results
counts
top / bottom N values
paged responses
10

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts

local secondary indexes (LSI)
alternate range key + same hash key
index and table data is co-located (same partition)
11

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
LSI Attribute Projections
Table

LSIs

A1
A2
(hash) (range)

A3

A1
A3
A2
(hash) (range) (table key)

A4

A5

KEYS_ONLY

A1
A4
A2
A3
(hash) (range) (table key) (projected)

INCLUDE A3

A1
A4
A2
A3
A5
(hash) (range) (table key) (projected) (projected)

ALL
12

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Concepts
global secondary
indexes (GSI)
any attribute indexed as
new hash and/or range key

13

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Local Secondary Index
1 Key = hash key and a range key

Global Secondary Index
Key = hash or hash-and-range

2

Hash same attribute as that of the table. Range key
can be any scalar table attribute

The index hash key and range key (if present) can be
any scalar table attributes

3

For each hash key, the total size of all indexed items
must be 10 GB or less

No size restrictions for global secondary indexes

4

Query over a single partition, as specified by the hash
Query over the entire table, across all partitions
key value in the query

5 Eventual consistency or strong consistency

Eventual consistency only

6

Read and write capacity units consumed from the
table.

Every global secondary index has its own provisioned
read and write capacity units

7

Query will automatically fetch non-projected attributes Query can only request projected attributes. It will not
from the table
fetch any attributes from the table

14

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
GSI Attribute Projections
Table

A1
(hash)

A2

A2
A1
(hash) (table key)
GSIs

A3

A4

A5

KEYS_ONLY

A5
A3
A1
(hash) (range) (table key)

KEYS_ONLY

A5
A4
A1
A3
(hash) (range) (table key) (projected)

INCLUDE A3

A4
A5
A1
A2
A3
(hash) (range) (table key) (projected) (projected)

ALL
15

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
GSI Query Pattern
Query covered by GSI
• Query GSI & get the attributes

Query not covered by GSI
• Query GSI get the table key(s)
• BatchGetItem/GetItem from table
• 2 or more round trips to DynamoDB
Tip: If you need very low latency then project all required attributes into GSI

16

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
How do GSI updates work
Client
Table

Primary
Primary
Primary
table Global
Primary
table
table
Secondary
table

2. Asynchronous
update (in progress)

Index

17

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
1 Table update = 0, 1 or 2 GSI updates
Table Operation

No of GSI index
updates

• Item not in Index before or after update

0

• Update introduces a new indexed-attribute
• Update deletes the indexed-attribute

1

• Updated changes the value of an indexed attribute from 2
A to B

18

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
GSI EXAMPLES
19

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Example1: Multi-tenant application for file
storing and sharing
Access Patterns
1.
2.
3.
4.
5.
6.

Users should be able to query all the files they own
Search by File Name
Search by File Type
Search by Date Range
Keep track of Shared Files
Search by descending order or File Size

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DynamoDB Data Model
Users
• Hash key = UserId (S)
• Attributes = User Name (S), Email (S), Address (SS), etc.

User_Files
• Hash key = UserId (S) – This is also the tenant id
• Range key = FileId (S)
• Attributes = Name (S), Type (S), Size (N), Date (S), SharedFlag
(S), S3key (S)

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Global Secondary Indexes
Table Name

Index Name

Attribute to
Index

Projected Attribute

User_Files

NameIndex

Name

KEYS

User_Files

TypeIndex

Type

KEYS + Name

User_Files

DateIndex

Date

KEYS + Name

User_Files

SharedFlagIndex

SharedFlag

KEYS + Name

User_Files

SizeIndex

Size

KEYS + Name

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 1
Find all files owned by a user
• Query (UserId = 2)
UserId
(Hash)

FileId
(Range)

Name Date

Type

1

1

File1

2013-04-23

JPG

1

2

File2

2013-03-10

PDF

2

3

File3

2013-03-10

PNG

2

4

File4

2013-03-10

3

5

File5

2013-04-10

SharedFlag

Size

S3key

1000

bucket1

Y

100

bucket2

Y

2000

bucket3

DOC

3000

bucket4

TXT

400

bucket5

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 2
NameIndex

Search by file name

Name
(range)

FileId

1

File1

1

1

File2

2

2

File3

3

2

File4

4

3

• Query (IndexName =
NameIndex, UserId =
1, Name = File1)

UserId
(hash)

File5

5

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 3
TypeIndex

Search for file name
by file Type

FileId

Name

1

JPG

1

File1

1

PDF

2

File2

2

DOC

4

File4

2

PNG

3

File3

3

• Query (IndexName =
TypeIndex, UserId = 2,
Type = DOC)

UserId Type
(hash) (range)

TXT

5

File5
Projection

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 4
Search for file name by
date range
• Query (IndexName =
DateIndex, UserId = 1,
Date between 2013-0301 and 2013-03-29)

DateIndex

UserId Date
(hash) (range)

FileId

Name

1

2013-03-10

2

File2

1

2013-04-23

1

File1

2

2013-03-10

3

File3

2

2013-03-10

4

File4

3

2013-04-10

5

File5

Projection

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 5
SharedFlagIndex

Search for names of
Shared files
• Query (IndexName =
SharedFlagIndex,
UserId = 1,
SharedFlag = Y)

UserId SharedFlag
(hash) (range)

FileId

Name

1

Y

2

File2

2

Y

3

File3

Projection

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Access Pattern 6
Query for file names by
descending order of file
size
• Query (IndexName =
SizeIndex, UserId = 1,
ScanIndexForward =
false)

SizeIndex

UserId
(hash)

Size
(range)

FileId

Name

1

100

1

File1

3

400

2

File2

1

1000

3

File3

2

2000

4

File4

2

3000

5

File5

Projection
© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Example2: Find top score for game G1
Game-scores-table
Id
(hash key)

User

Game

Score

Date

1

Bob

G1

1300

2012-12-23 18:00:00

2
3

Bob
Jay

G1
G1

1450
1600

2012-12-23 19:00:00
2012-12-24 20:00:00

4
5
6

Mary
Ryan
Jones

G1
G2
G2

2000
123
345

2012-10-24 17:00:00
2012-03-10 15:00:00
2012-03-20 15:00:00

29

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
GameScoresIndex
Game-scores-table
Id
(hash key)

User

Game

Score

Date

Id
(table key)

User
(projected)

Date
(projected)

Game-scores-index
Games
(hash)

Score
(range)

30

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Game-scores-index
Game
(Hash)

Score
(Range)

Id

User

Date

G1

2000

4

Mary

2012-10-24 17:00:00

G1

1600

3

Jay

2012-12-24 20:00:00

G1

1450

2

Bob

2012-12-23 19:00:00

G1

1300

1

Bob

2012-12-23 18:00:00

G2

345

6

Jones

2012-03-20 15:00:00

G2

123

5

Ryan

2012-03-10 15:00:00
31

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Query: Find top score for game G1

32

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
DATA MODELING WITH GSI
33

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Modeling 1:1 relationships
Use a table with a Hash key or a GSI with a hash key
Example:
Users Table
• Users
Hash key = UserID

• Users-email-GSI
Hash key = Email

Hash key
UserId = bob
UserId = fred

Attributes
Email = bob@gmail.com, JoinDate = 2011-11-15
Email = fred@yahoo.com, JoinDate = 2011-1201, Sex = M

Users-email-GSI
Hash key
Email =
bob@gmail.com
Email =
fred@yahoo.com

Attributes
UserId = bob, JoinDate = 2011-11-15
UserId = fred, JoinDate = 2011-12-01,
Sex = M
34

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Modeling 1:N relationships
Use a table with Hash and Range key or GSI ()
Example:
• One (1) User can play many (N) Games
Hash Key
UserId =
bob
UserId =
fred
UserId =
bob

User-Games-Table
Attributes
GameId = Game1,
HighScore = 10500, ScoreDate = 2011-10-20
GameId = Game2
HIghScore = 12000, ScoreDate = 2012-01-10
GameId = Game3
HighScore = 20000, ScoreDate = 2012-02-12

User-Games-GSI
Hash Key
Range
Attributes
key
UserId = bob GameId HighScore = 10500,
= Game1 ScoreDate = 2011-10-20
UserId =
GameId HIghScore = 12000,
fred
= Game2 ScoreDate = 2012-01-10
UserId = bob GameId HighScore = 20000,
= Game3 ScoreDate = 2012-02-12
35

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Modeling N:M relationships
Use GSI
• Example: 1 user plays multiple games
and 1 game has multiple users

User-Games-Table
Hash Key
Range key
UserId = bob
GameId = Game1
UserId = fred
GameId = Game2
UserId = bob
GameId = Game3

Game-Users-GSI
Hash Key
Range key
GameId = Game1 UserId = bob
GameId = Game2 UserId = fred
GameId = Game3 UserId = bob

36

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Best Practices
Choose a GSI Hash Key with high cardinality
Employee-Table
Id (hash)

Name

Sex

Address

Cardinality of Sex = 2 (M/F)

SexDOB-GSI
Sex (Hash)

DOB

DOB

Id

Name

Address

Solution: Generate aliases for M/F by suffixing a known range
of integers (say 1 to 100) and Query for each value M_1 to M_100
37

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Best Practices
Take advantage of Sparse Indexes
Game-scores-table
Id
(hash)

User Game Score Date

1

Bob

G1

1300 2012-12-23

2
3

Bob
Jay

G1
G1

1450 2012-12-23
1600 2012-12-24

4
5
6

Mary G1
Ryan G2
Jones G2

2000 2012-10-24
123 2012-03-10
345 2012-03-20

Award-GSI
Award

Award
(hash)

Id

User Score

Champ

4

Mary 2000

Champ

38

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Best Practices
Query GSI for quick item lookups
• Less read capacity units consumed
Mail Box-Table
ID (hash key)
Timestamp (range key)

Mail Box-lookup-GSI
Attribute1
Attribute2
Attribute3
….
LargeAttachment

ID (hash key)
Timestamp (range key)

Attribute1
Attribute2
Attribute3

39

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Best Practices
Provision enough throughput for GSI
• one update to the table may result in two writes to an index

If GSIs do not have enough write capacity, table writes
will eventually be throttled down to what the "slowest"
index can consume

40

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Debugging Throughput Issues
ProvisionedThroughputExceededException (HTTP
status code 400)
• "The level of configured provisioned throughput for one or more
global secondary indexes of the table was exceeded. Consider
increasing your provisioning level for the under-provisioned
global secondary indexes with the UpdateTable API"

41

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Debugging Throughput Issues
GSI CloudWatch Metrics
•
•
•
•

ProvisionedReadCapacityUnits Vs ConsumedReadCapacityUnits
ProvisionedWriteCapacityUnits Vs ConsumedWriteCapacityUnits
ReadThrottleEvents
WriteThrottleEvents

42

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Questions

43

© 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

More Related Content

What's hot

SQL to NoSQL Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...
SQL to NoSQL   Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...SQL to NoSQL   Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...
SQL to NoSQL Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...Amazon Web Services
 
Design Patterns using Amazon DynamoDB
 Design Patterns using Amazon DynamoDB Design Patterns using Amazon DynamoDB
Design Patterns using Amazon DynamoDBAmazon Web Services
 
Building Applications with DynamoDB
Building Applications with DynamoDBBuilding Applications with DynamoDB
Building Applications with DynamoDBAmazon Web Services
 
Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Dynamo DB & RDS Deep Dive - AWS India Summit 2012Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Dynamo DB & RDS Deep Dive - AWS India Summit 2012Amazon Web Services
 
Deep Dive on Amazon DynamoDB - AWS Online Tech Talks
Deep Dive on Amazon DynamoDB - AWS Online Tech TalksDeep Dive on Amazon DynamoDB - AWS Online Tech Talks
Deep Dive on Amazon DynamoDB - AWS Online Tech TalksAmazon Web Services
 
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)Amazon Web Services
 
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB Day
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB DayGetting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB Day
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB DayAmazon Web Services Korea
 

What's hot (20)

SQL to NoSQL Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...
SQL to NoSQL   Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...SQL to NoSQL   Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...
SQL to NoSQL Best Practices with Amazon DynamoDB - AWS July 2016 Webinar Se...
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Design Patterns using Amazon DynamoDB
 Design Patterns using Amazon DynamoDB Design Patterns using Amazon DynamoDB
Design Patterns using Amazon DynamoDB
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
AWS Webcast - Dynamo DB
AWS Webcast - Dynamo DBAWS Webcast - Dynamo DB
AWS Webcast - Dynamo DB
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Building Applications with DynamoDB
Building Applications with DynamoDBBuilding Applications with DynamoDB
Building Applications with DynamoDB
 
Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Dynamo DB & RDS Deep Dive - AWS India Summit 2012Dynamo DB & RDS Deep Dive - AWS India Summit 2012
Dynamo DB & RDS Deep Dive - AWS India Summit 2012
 
Deep Dive on Amazon DynamoDB - AWS Online Tech Talks
Deep Dive on Amazon DynamoDB - AWS Online Tech TalksDeep Dive on Amazon DynamoDB - AWS Online Tech Talks
Deep Dive on Amazon DynamoDB - AWS Online Tech Talks
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)
AWS re:Invent 2016: Deep Dive on Amazon DynamoDB (DAT304)
 
Amazon DynamoDB Workshop
Amazon DynamoDB WorkshopAmazon DynamoDB Workshop
Amazon DynamoDB Workshop
 
Deep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDBDeep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDB
 
Introduction to Amazon DynamoDB
Introduction to Amazon DynamoDBIntroduction to Amazon DynamoDB
Introduction to Amazon DynamoDB
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB Day
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB DayGetting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB Day
Getting Strated with Amazon Dynamo DB (Jim Scharf) - AWS DB Day
 
Amazon DynamoDB Design Workshop
Amazon DynamoDB Design WorkshopAmazon DynamoDB Design Workshop
Amazon DynamoDB Design Workshop
 
Amazon DynamoDB 深入探討
Amazon DynamoDB 深入探討Amazon DynamoDB 深入探討
Amazon DynamoDB 深入探討
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
DynamoDB Design Workshop
DynamoDB Design WorkshopDynamoDB Design Workshop
DynamoDB Design Workshop
 

Viewers also liked

AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...
AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...
AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...Amazon Web Services
 
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...Amazon Web Services
 
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...Amazon Web Services
 
AWS Customer Presentation : PBS - AWS Summit 2012 - NYC
AWS Customer Presentation : PBS - AWS Summit 2012 - NYCAWS Customer Presentation : PBS - AWS Summit 2012 - NYC
AWS Customer Presentation : PBS - AWS Summit 2012 - NYCAmazon Web Services
 
The 2014 AWS Enterprise Summit Keynote
The 2014 AWS Enterprise Summit Keynote The 2014 AWS Enterprise Summit Keynote
The 2014 AWS Enterprise Summit Keynote Amazon Web Services
 
Design Patterns for Developers - Technical 201
Design Patterns for Developers - Technical 201Design Patterns for Developers - Technical 201
Design Patterns for Developers - Technical 201Amazon Web Services
 
AWS Future Building Blocks - Werner Vogels - berlin 2010
AWS Future Building Blocks - Werner Vogels - berlin 2010AWS Future Building Blocks - Werner Vogels - berlin 2010
AWS Future Building Blocks - Werner Vogels - berlin 2010Amazon Web Services
 
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the Cloud
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the CloudAWS Sydney Summit 2013 - Technical Lessons on How to do DR in the Cloud
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the CloudAmazon Web Services
 
GOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case StudyGOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case StudyAmazon Web Services
 
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...Amazon Web Services
 
Deep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudDeep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudAmazon Web Services
 
Un backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésUn backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésAmazon Web Services
 
Amazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart ApplicationsAmazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart ApplicationsAmazon Web Services
 
AWS Partner Presentation - Suse Linux Proven Cloud Success
AWS Partner Presentation - Suse Linux Proven Cloud SuccessAWS Partner Presentation - Suse Linux Proven Cloud Success
AWS Partner Presentation - Suse Linux Proven Cloud SuccessAmazon Web Services
 
AWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAmazon Web Services
 
Running Microsoft Enterprise Workloads on Amazon Web Services
Running Microsoft Enterprise Workloads on Amazon Web ServicesRunning Microsoft Enterprise Workloads on Amazon Web Services
Running Microsoft Enterprise Workloads on Amazon Web ServicesAmazon Web Services
 
AWS Customer Presentation - AdaptiveBlue
AWS Customer Presentation - AdaptiveBlueAWS Customer Presentation - AdaptiveBlue
AWS Customer Presentation - AdaptiveBlueAmazon Web Services
 
AWS Customer Presentation - Justin.tv
AWS Customer Presentation - Justin.tvAWS Customer Presentation - Justin.tv
AWS Customer Presentation - Justin.tvAmazon Web Services
 

Viewers also liked (20)

AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...
AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...
AWS re:Invent 2016: Amazon Aurora Best Practices: Getting the Best Out of You...
 
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...
Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 20...
 
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...
Consolidate MySQL Shards Into Amazon Aurora Using AWS Database Migration Serv...
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
AWS Customer Presentation : PBS - AWS Summit 2012 - NYC
AWS Customer Presentation : PBS - AWS Summit 2012 - NYCAWS Customer Presentation : PBS - AWS Summit 2012 - NYC
AWS Customer Presentation : PBS - AWS Summit 2012 - NYC
 
The 2014 AWS Enterprise Summit Keynote
The 2014 AWS Enterprise Summit Keynote The 2014 AWS Enterprise Summit Keynote
The 2014 AWS Enterprise Summit Keynote
 
Design Patterns for Developers - Technical 201
Design Patterns for Developers - Technical 201Design Patterns for Developers - Technical 201
Design Patterns for Developers - Technical 201
 
AWS Future Building Blocks - Werner Vogels - berlin 2010
AWS Future Building Blocks - Werner Vogels - berlin 2010AWS Future Building Blocks - Werner Vogels - berlin 2010
AWS Future Building Blocks - Werner Vogels - berlin 2010
 
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the Cloud
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the CloudAWS Sydney Summit 2013 - Technical Lessons on How to do DR in the Cloud
AWS Sydney Summit 2013 - Technical Lessons on How to do DR in the Cloud
 
GOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case StudyGOWAR - Virtual Wars Real Places. AWS Case Study
GOWAR - Virtual Wars Real Places. AWS Case Study
 
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...
Dole Food's Global Collaboration Platform and Web Presence on AWS (ENT209) | ...
 
Deep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudDeep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private Cloud
 
Un backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésUn backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectés
 
Amazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart ApplicationsAmazon Machine Learning: Empowering Developers to Build Smart Applications
Amazon Machine Learning: Empowering Developers to Build Smart Applications
 
AWS Partner Presentation - Suse Linux Proven Cloud Success
AWS Partner Presentation - Suse Linux Proven Cloud SuccessAWS Partner Presentation - Suse Linux Proven Cloud Success
AWS Partner Presentation - Suse Linux Proven Cloud Success
 
AWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyte
 
From Development to Production
From Development to ProductionFrom Development to Production
From Development to Production
 
Running Microsoft Enterprise Workloads on Amazon Web Services
Running Microsoft Enterprise Workloads on Amazon Web ServicesRunning Microsoft Enterprise Workloads on Amazon Web Services
Running Microsoft Enterprise Workloads on Amazon Web Services
 
AWS Customer Presentation - AdaptiveBlue
AWS Customer Presentation - AdaptiveBlueAWS Customer Presentation - AdaptiveBlue
AWS Customer Presentation - AdaptiveBlue
 
AWS Customer Presentation - Justin.tv
AWS Customer Presentation - Justin.tvAWS Customer Presentation - Justin.tv
AWS Customer Presentation - Justin.tv
 

Similar to AWS Webcast - Optimize your database for the cloud with DynamoDB – A Deep Dive into Global Secondary Indexes

AWS Webcast - Data Modeling for low cost and high performance with DynamoDB
AWS Webcast - Data Modeling for low cost and high performance with DynamoDBAWS Webcast - Data Modeling for low cost and high performance with DynamoDB
AWS Webcast - Data Modeling for low cost and high performance with DynamoDBAmazon Web Services
 
AWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQLAWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQLAmazon Web Services
 
AWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon RedshiftAWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon RedshiftAmazon Web Services
 
AWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon RedshiftAWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon RedshiftAmazon Web Services
 
DynamoDB and Dax - Miguel Cervantes
DynamoDB and Dax - Miguel CervantesDynamoDB and Dax - Miguel Cervantes
DynamoDB and Dax - Miguel CervantesAmazon Web Services
 
Access 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationAccess 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationdgdotson
 
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...Amazon Web Services
 
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Amazon Web Services
 
Hive 3 - a new horizon
Hive 3 - a new horizonHive 3 - a new horizon
Hive 3 - a new horizonThejas Nair
 
SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...
 SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ... SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...
SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...Amazon Web Services
 
Excel module 2 ppt presentation
Excel module 2 ppt presentationExcel module 2 ppt presentation
Excel module 2 ppt presentationdgdotson
 
Introduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLIntroduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLAmazon Web Services
 
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013) Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013) Clare Hoang
 
Getting started with Amazon DynamoDB
Getting started with Amazon DynamoDBGetting started with Amazon DynamoDB
Getting started with Amazon DynamoDBAmazon Web Services
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Amazon Web Services
 
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdf
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdfDEV305_Manage Your Applications with AWS Elastic Beanstalk.pdf
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdfAmazon Web Services
 
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Amazon Web Services
 

Similar to AWS Webcast - Optimize your database for the cloud with DynamoDB – A Deep Dive into Global Secondary Indexes (20)

AWS Webcast - Data Modeling for low cost and high performance with DynamoDB
AWS Webcast - Data Modeling for low cost and high performance with DynamoDBAWS Webcast - Data Modeling for low cost and high performance with DynamoDB
AWS Webcast - Data Modeling for low cost and high performance with DynamoDB
 
AWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQLAWS Webcast - Introducing Amazon RDS for PostgreSQL
AWS Webcast - Introducing Amazon RDS for PostgreSQL
 
AWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon RedshiftAWS Webcast - Introducing Amazon Redshift
AWS Webcast - Introducing Amazon Redshift
 
AWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon RedshiftAWS Webcast - Data Integration into Amazon Redshift
AWS Webcast - Data Integration into Amazon Redshift
 
DynamoDB & DAX
DynamoDB & DAXDynamoDB & DAX
DynamoDB & DAX
 
DynamoDB and Dax - Miguel Cervantes
DynamoDB and Dax - Miguel CervantesDynamoDB and Dax - Miguel Cervantes
DynamoDB and Dax - Miguel Cervantes
 
Access 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentationAccess 2016 module 1 ppt presentation
Access 2016 module 1 ppt presentation
 
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
Amazon DynamoDB Deep Dive Advanced Design Patterns for DynamoDB (DAT401) - AW...
 
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
 
Hive 3 - a new horizon
Hive 3 - a new horizonHive 3 - a new horizon
Hive 3 - a new horizon
 
Hive 3 a new horizon
Hive 3  a new horizonHive 3  a new horizon
Hive 3 a new horizon
 
SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...
 SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ... SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...
SRV307 Applying AWS Purpose-Built Database Strategy: Match Your Workload to ...
 
Excel module 2 ppt presentation
Excel module 2 ppt presentationExcel module 2 ppt presentation
Excel module 2 ppt presentation
 
Introduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQLIntroduction to Data Driven Apps with GraphQL
Introduction to Data Driven Apps with GraphQL
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013) Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
 
Getting started with Amazon DynamoDB
Getting started with Amazon DynamoDBGetting started with Amazon DynamoDB
Getting started with Amazon DynamoDB
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
 
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdf
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdfDEV305_Manage Your Applications with AWS Elastic Beanstalk.pdf
DEV305_Manage Your Applications with AWS Elastic Beanstalk.pdf
 
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
 

More from 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
 

More from 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
 

Recently uploaded

[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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

[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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

AWS Webcast - Optimize your database for the cloud with DynamoDB – A Deep Dive into Global Secondary Indexes

  • 1. Optimize Your Database for the Cloud with DynamoDB A Deep Dive into Global Secondary Indexes (GSI) David Pearson Siva Raghupathy 1 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. automated operations = predictable performance database service durable low latency cost effective 2 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 3. Durable Low Latency WRITES Continuously replicated to 3 AZ’s Quorum acknowledgment Persisted to disk (custom SSD) READS Strongly or eventually consistent No trade-off in latency 3 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 4. Recent Announcements Secondary Indexes (Local and Global) DynamoDB Local • Disconnected development with full API support • No network • No usage costs • No SLA Fine-Grained Access Control • Direct-to-DynamoDB access for mobile devices Geospatial and Transaction Libraries 4 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 5. DynamoDB Concepts table 5 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 6. DynamoDB Concepts table items 6 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 7. DynamoDB Concepts table items attributes schema-less schema is defined per attribute 7 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 8. DynamoDB Concepts hash hash keys mandatory for all items in a table key-value access pattern 8 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 9. DynamoDB Concepts partition 1 .. N hash keys mandatory for all items in a table key-value access pattern determines data distribution 9 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 10. DynamoDB Concepts hash range range keys model 1:N relationships enable rich query capabilities composite primary key all items for a hash key ==, <, >, >=, <= “begins with” “between” sorted results counts top / bottom N values paged responses 10 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 11. DynamoDB Concepts local secondary indexes (LSI) alternate range key + same hash key index and table data is co-located (same partition) 11 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 12. LSI Attribute Projections Table LSIs A1 A2 (hash) (range) A3 A1 A3 A2 (hash) (range) (table key) A4 A5 KEYS_ONLY A1 A4 A2 A3 (hash) (range) (table key) (projected) INCLUDE A3 A1 A4 A2 A3 A5 (hash) (range) (table key) (projected) (projected) ALL 12 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 13. DynamoDB Concepts global secondary indexes (GSI) any attribute indexed as new hash and/or range key 13 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 14. Local Secondary Index 1 Key = hash key and a range key Global Secondary Index Key = hash or hash-and-range 2 Hash same attribute as that of the table. Range key can be any scalar table attribute The index hash key and range key (if present) can be any scalar table attributes 3 For each hash key, the total size of all indexed items must be 10 GB or less No size restrictions for global secondary indexes 4 Query over a single partition, as specified by the hash Query over the entire table, across all partitions key value in the query 5 Eventual consistency or strong consistency Eventual consistency only 6 Read and write capacity units consumed from the table. Every global secondary index has its own provisioned read and write capacity units 7 Query will automatically fetch non-projected attributes Query can only request projected attributes. It will not from the table fetch any attributes from the table 14 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 15. GSI Attribute Projections Table A1 (hash) A2 A2 A1 (hash) (table key) GSIs A3 A4 A5 KEYS_ONLY A5 A3 A1 (hash) (range) (table key) KEYS_ONLY A5 A4 A1 A3 (hash) (range) (table key) (projected) INCLUDE A3 A4 A5 A1 A2 A3 (hash) (range) (table key) (projected) (projected) ALL 15 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 16. GSI Query Pattern Query covered by GSI • Query GSI & get the attributes Query not covered by GSI • Query GSI get the table key(s) • BatchGetItem/GetItem from table • 2 or more round trips to DynamoDB Tip: If you need very low latency then project all required attributes into GSI 16 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 17. How do GSI updates work Client Table Primary Primary Primary table Global Primary table table Secondary table 2. Asynchronous update (in progress) Index 17 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 18. 1 Table update = 0, 1 or 2 GSI updates Table Operation No of GSI index updates • Item not in Index before or after update 0 • Update introduces a new indexed-attribute • Update deletes the indexed-attribute 1 • Updated changes the value of an indexed attribute from 2 A to B 18 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 19. GSI EXAMPLES 19 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 20. Example1: Multi-tenant application for file storing and sharing Access Patterns 1. 2. 3. 4. 5. 6. Users should be able to query all the files they own Search by File Name Search by File Type Search by Date Range Keep track of Shared Files Search by descending order or File Size © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 21. DynamoDB Data Model Users • Hash key = UserId (S) • Attributes = User Name (S), Email (S), Address (SS), etc. User_Files • Hash key = UserId (S) – This is also the tenant id • Range key = FileId (S) • Attributes = Name (S), Type (S), Size (N), Date (S), SharedFlag (S), S3key (S) © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 22. Global Secondary Indexes Table Name Index Name Attribute to Index Projected Attribute User_Files NameIndex Name KEYS User_Files TypeIndex Type KEYS + Name User_Files DateIndex Date KEYS + Name User_Files SharedFlagIndex SharedFlag KEYS + Name User_Files SizeIndex Size KEYS + Name © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 23. Access Pattern 1 Find all files owned by a user • Query (UserId = 2) UserId (Hash) FileId (Range) Name Date Type 1 1 File1 2013-04-23 JPG 1 2 File2 2013-03-10 PDF 2 3 File3 2013-03-10 PNG 2 4 File4 2013-03-10 3 5 File5 2013-04-10 SharedFlag Size S3key 1000 bucket1 Y 100 bucket2 Y 2000 bucket3 DOC 3000 bucket4 TXT 400 bucket5 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 24. Access Pattern 2 NameIndex Search by file name Name (range) FileId 1 File1 1 1 File2 2 2 File3 3 2 File4 4 3 • Query (IndexName = NameIndex, UserId = 1, Name = File1) UserId (hash) File5 5 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 25. Access Pattern 3 TypeIndex Search for file name by file Type FileId Name 1 JPG 1 File1 1 PDF 2 File2 2 DOC 4 File4 2 PNG 3 File3 3 • Query (IndexName = TypeIndex, UserId = 2, Type = DOC) UserId Type (hash) (range) TXT 5 File5 Projection © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 26. Access Pattern 4 Search for file name by date range • Query (IndexName = DateIndex, UserId = 1, Date between 2013-0301 and 2013-03-29) DateIndex UserId Date (hash) (range) FileId Name 1 2013-03-10 2 File2 1 2013-04-23 1 File1 2 2013-03-10 3 File3 2 2013-03-10 4 File4 3 2013-04-10 5 File5 Projection © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 27. Access Pattern 5 SharedFlagIndex Search for names of Shared files • Query (IndexName = SharedFlagIndex, UserId = 1, SharedFlag = Y) UserId SharedFlag (hash) (range) FileId Name 1 Y 2 File2 2 Y 3 File3 Projection © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 28. Access Pattern 6 Query for file names by descending order of file size • Query (IndexName = SizeIndex, UserId = 1, ScanIndexForward = false) SizeIndex UserId (hash) Size (range) FileId Name 1 100 1 File1 3 400 2 File2 1 1000 3 File3 2 2000 4 File4 2 3000 5 File5 Projection © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 29. Example2: Find top score for game G1 Game-scores-table Id (hash key) User Game Score Date 1 Bob G1 1300 2012-12-23 18:00:00 2 3 Bob Jay G1 G1 1450 1600 2012-12-23 19:00:00 2012-12-24 20:00:00 4 5 6 Mary Ryan Jones G1 G2 G2 2000 123 345 2012-10-24 17:00:00 2012-03-10 15:00:00 2012-03-20 15:00:00 29 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 30. GameScoresIndex Game-scores-table Id (hash key) User Game Score Date Id (table key) User (projected) Date (projected) Game-scores-index Games (hash) Score (range) 30 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 31. Game-scores-index Game (Hash) Score (Range) Id User Date G1 2000 4 Mary 2012-10-24 17:00:00 G1 1600 3 Jay 2012-12-24 20:00:00 G1 1450 2 Bob 2012-12-23 19:00:00 G1 1300 1 Bob 2012-12-23 18:00:00 G2 345 6 Jones 2012-03-20 15:00:00 G2 123 5 Ryan 2012-03-10 15:00:00 31 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 32. Query: Find top score for game G1 32 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 33. DATA MODELING WITH GSI 33 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 34. Modeling 1:1 relationships Use a table with a Hash key or a GSI with a hash key Example: Users Table • Users Hash key = UserID • Users-email-GSI Hash key = Email Hash key UserId = bob UserId = fred Attributes Email = bob@gmail.com, JoinDate = 2011-11-15 Email = fred@yahoo.com, JoinDate = 2011-1201, Sex = M Users-email-GSI Hash key Email = bob@gmail.com Email = fred@yahoo.com Attributes UserId = bob, JoinDate = 2011-11-15 UserId = fred, JoinDate = 2011-12-01, Sex = M 34 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 35. Modeling 1:N relationships Use a table with Hash and Range key or GSI () Example: • One (1) User can play many (N) Games Hash Key UserId = bob UserId = fred UserId = bob User-Games-Table Attributes GameId = Game1, HighScore = 10500, ScoreDate = 2011-10-20 GameId = Game2 HIghScore = 12000, ScoreDate = 2012-01-10 GameId = Game3 HighScore = 20000, ScoreDate = 2012-02-12 User-Games-GSI Hash Key Range Attributes key UserId = bob GameId HighScore = 10500, = Game1 ScoreDate = 2011-10-20 UserId = GameId HIghScore = 12000, fred = Game2 ScoreDate = 2012-01-10 UserId = bob GameId HighScore = 20000, = Game3 ScoreDate = 2012-02-12 35 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 36. Modeling N:M relationships Use GSI • Example: 1 user plays multiple games and 1 game has multiple users User-Games-Table Hash Key Range key UserId = bob GameId = Game1 UserId = fred GameId = Game2 UserId = bob GameId = Game3 Game-Users-GSI Hash Key Range key GameId = Game1 UserId = bob GameId = Game2 UserId = fred GameId = Game3 UserId = bob 36 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 37. Best Practices Choose a GSI Hash Key with high cardinality Employee-Table Id (hash) Name Sex Address Cardinality of Sex = 2 (M/F) SexDOB-GSI Sex (Hash) DOB DOB Id Name Address Solution: Generate aliases for M/F by suffixing a known range of integers (say 1 to 100) and Query for each value M_1 to M_100 37 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 38. Best Practices Take advantage of Sparse Indexes Game-scores-table Id (hash) User Game Score Date 1 Bob G1 1300 2012-12-23 2 3 Bob Jay G1 G1 1450 2012-12-23 1600 2012-12-24 4 5 6 Mary G1 Ryan G2 Jones G2 2000 2012-10-24 123 2012-03-10 345 2012-03-20 Award-GSI Award Award (hash) Id User Score Champ 4 Mary 2000 Champ 38 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 39. Best Practices Query GSI for quick item lookups • Less read capacity units consumed Mail Box-Table ID (hash key) Timestamp (range key) Mail Box-lookup-GSI Attribute1 Attribute2 Attribute3 …. LargeAttachment ID (hash key) Timestamp (range key) Attribute1 Attribute2 Attribute3 39 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 40. Best Practices Provision enough throughput for GSI • one update to the table may result in two writes to an index If GSIs do not have enough write capacity, table writes will eventually be throttled down to what the "slowest" index can consume 40 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 41. Debugging Throughput Issues ProvisionedThroughputExceededException (HTTP status code 400) • "The level of configured provisioned throughput for one or more global secondary indexes of the table was exceeded. Consider increasing your provisioning level for the under-provisioned global secondary indexes with the UpdateTable API" 41 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 42. Debugging Throughput Issues GSI CloudWatch Metrics • • • • ProvisionedReadCapacityUnits Vs ConsumedReadCapacityUnits ProvisionedWriteCapacityUnits Vs ConsumedWriteCapacityUnits ReadThrottleEvents WriteThrottleEvents 42 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 43. Questions 43 © 2011 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.