SlideShare a Scribd company logo
1 of 43
Download to read offline
DYNAMODB DEEP DIVE AND BEST PRACTICES
PRESENTED BY CATHY HUI
DYNAMODB DEEP DIVE AND BEST PRACTICES
PRESENTED BY CATHY HUI
•
Ø
Ø
•
•
•
Ø
Ø
•
•
•
•
ü
Ø
Ø
Ø
Ø
ü
Ø
Ø
Ø
•
•
ü
Ø
Ø
Ø
Ø
ü
Ø
Ø
Ø
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Ø
Ø
Ø
Ø
class student signupDate SpecialRequest member
Judo Amy_0001 2016-04-01 Personal_trainer 1
Judo John_0002 2016-04-03 0
Karate Amy_0001 2016-03-03 Personal_trainer 1
Karate Bob_0003 2016-05-17 1
Painting
Swimming
Hash Key Range / Sort Key
Items
Attributes
QUERY WHERE HASH KEY = JUDO --- RETURN RESULT SET STUDENT ARE SORTED IN ORDER
LOCAL SECONDARY INDEX (LSI)LOCAL SECONDARY INDEX (LSI)
Hash key = table hash key
Diff range key
DEPT
(hash)
EMP
(range)	
MGR HIREDATE SALTABLE
DEPT
(hash)
SAL
(range)
EMP
(table	key)
KEYS_ONLY
DEPT
(hash)
MGR
(range)
EMP
(table	key)
HIREDATE
(projected)
INCLUDE HIREDATE
DEPT
(hash)
HIREDATE
(range)
EMP
(table	key)
MGR
(projected)
SAL
(projected)
ALL
LSIs
LIMIT 10GB /PARTITION
GLOBAL SECONDARY INDEX (GSI)GLOBAL SECONDARY INDEX (GSI)
Alternate hash key + Optional Range Key
TABLE
HIREDATE
(hash)
DEPT
(table	key)
EMP
(table key)
EMP
(hash)	
HIREDATE	
(hash)
DEPT
(table	key)
MGR
(projected)
KEYS_ONLY
INCLUDE MGR
MGR
(hash)
EMP
(range)
DEPT
(table	key)
HIREDATE
(projected)
SAL
(projected)
ALL
GSIs
DEPT
(hash)
EMP
(Range)
MGR HIREDATE SAL
dept staff contractAgent hireDate title
acct Amy_0001 abc 2015-12-30 accountant
acct Bob_0003 2016-05-05 acct_mgr
acct John_0004 xyz 2016-03-07 accountant
Finance Sydney_0002 2016-05-05 CFO
Engineering Larry_0007 xyz 2016-06-01 developer
Anonymous_0000
Dept_Staff Table
contractAgent staff Dept
xyz John_0004 acct
xyz Larry_0008 Engineering
abc Amy_0001 acct
Hash key Agent GSI
Hash key
Range key
Range key
•
•
•
•
•
•
••
EXAMPLE:
TABLE: AVG ITEM SIZE 12KB
12KB / 4KB = 3 RCUS ß 3 RCUS TO READ 1 ITEM PER SECOND
PREDICT 100 ITEM READS / SEC
100 X 3 RCUS = 300 RCUS (IF EVENTUAL CONSISTENCY READ: 150 RCU)
EXAMPLE:
TABLE: AVG ITEM SIZE 12KB
12KB / 4KB = 3 RCUS ß 3 RCUS TO READ 1 ITEM PER SECOND
PREDICT 100 ITEM READS / SEC
100 X 3 RCUS = 300 RCUS (IF EVENTUAL CONSISTENCY READ: 150 RCU)
Expected Item Size Consistency Desired Item Reads
Per Second
Provisioned
ThroughputRequired
4 KB Strongly consistent 50 50
8 KB Strongly consistent 50 100
4 KB Eventually consistent 50 25
8 KB Eventually consistent 50 50
Expected Item Size Desired Item Writes Per
Second
Provisioned Throughput
Required
1 KB 50 50
2 KB 50 100
RCU EXAMPLES:
WCU EXAMPLES:
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
TABLES ITEMS
CreateTable Put/GetItem
UpdateTable BatchPut/GetItem
DeleteTable UpdateItem
DescribeTable DeleteItem
ListTables Query
Scan
•
•
•
•
•
•
•
•
•
•
ü
ü
ü
Ø
Ø
•
•
ü
ü
ü
Ø
Ø
•
•
•
•
•
•
•
•
•
•
•
•
BEST PRACTICESBEST PRACTICES
•
v
•
v
•
v
•
v
•
v
•
v
•
v
•
v
•
v
•
v
•
•
•
•
•
•
•
•
USE OF SPARSE GSI …USE OF SPARSE GSI …
WHEN GSI IS ON A SELECTIVE ATTRIBUTEWHEN GSI IS ON A SELECTIVE ATTRIBUTE
•
•
•
•
EXPERIENCE SHARING & FAQEXPERIENCE SHARING & FAQ
Ø
Ø
Ø
Ø
Ø
Ø
ØØ
WORKAROUND: Use of iterator on the application.
Iterator<MyObject> iterator = mapper.query(query.withLimit(20)).iterator();
for (int i = 0; iterator.hasNext() && i < 20; ++i) {
MyObject object = iterator.next();
...
}
•
Ø
Ø
Ø
•
Ø
Ø
Ø
•
•
•
•
HTTP://CALCULATOR.S3.AMAZONAWS.COM/INDEX.HTML#S=DYNAMODB
HTTPS://ECONFLUENCE.INT.ASURION.COM/PAGES/VIEWPAGE.ACTION?SPACEKEY=CG&
TITLE=DYNAMODB%3A+COST+SAVINGS+TECHNIQUES
•
•
•
•
HTTP://CALCULATOR.S3.AMAZONAWS.COM/INDEX.HTML#S=DYNAMODB
HTTPS://ECONFLUENCE.INT.ASURION.COM/PAGES/VIEWPAGE.ACTION?SPACEKEY=CG&
TITLE=DYNAMODB%3A+COST+SAVINGS+TECHNIQUES
ü
ü
ü
q
q
q
ü
ü
ü
q
q
q
•
•
Ø
•
•
•
•
Ø
•
•
Dynamodb presentation

More Related Content

Similar to Dynamodb presentation

Similar to Dynamodb presentation (7)

Deep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDBDeep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDB
 
개발자가 알아야 할 Amazon DynamoDB 활용법 :: 김일호 :: AWS Summit Seoul 2016
개발자가 알아야 할 Amazon DynamoDB 활용법 :: 김일호 :: AWS Summit Seoul 2016개발자가 알아야 할 Amazon DynamoDB 활용법 :: 김일호 :: AWS Summit Seoul 2016
개발자가 알아야 할 Amazon DynamoDB 활용법 :: 김일호 :: AWS Summit Seoul 2016
 
Amazon DynamoDB Workshop
Amazon DynamoDB WorkshopAmazon DynamoDB Workshop
Amazon DynamoDB Workshop
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Paris data-geeks-2013-03-28
Paris data-geeks-2013-03-28Paris data-geeks-2013-03-28
Paris data-geeks-2013-03-28
 
SRV404 Deep Dive on Amazon DynamoDB
SRV404 Deep Dive on Amazon DynamoDBSRV404 Deep Dive on Amazon DynamoDB
SRV404 Deep Dive on Amazon DynamoDB
 
Etsy Search: How We Index and Query 26 Million One-of-a-kind Items
Etsy Search: How We Index and Query 26 Million One-of-a-kind ItemsEtsy Search: How We Index and Query 26 Million One-of-a-kind Items
Etsy Search: How We Index and Query 26 Million One-of-a-kind Items
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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 Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 

Dynamodb presentation