SlideShare a Scribd company logo
1 of 102
Download to read offline
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Data modeling with
Amazon DynamoDB
Alex DeBrie
Engineering Manager
Serverless, Inc.
A D B 3 0 1
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Agenda
What is DynamoDB?
Key concepts
Data modeling strategies
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Alex DeBrie
Engineering Manager, Serverless, Inc.
DynamoDBGuide.com
@alexbdebrie
alexdebrie.com
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
What is DynamoDB?
NoSQL database
Fully managed by AWS
HTTPS with AWS Identity and Access
Management (IAM) Auth
Fast, consistent performance as it scales
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hyperscale
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hyperephemeral compute
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Concepts
• Table
• Item
• Primary key
• Attributes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Table
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Item
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Primarykey
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Attributes
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Primary key
• Simple primary key (partition key)
• Composite primary key (partition key + sort key)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Simple primarykey
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Composite primarykey
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API actions
• Item-based actions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Item-based actions – Writing, updating, deleting
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Item-based actions – Writing, updating, deleting
Must
provide
entire
primary
key
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API actions
• Item-based actions
• Query
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Query
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Query
Must
provide
partition
key
May
provide sort
key
conditions
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API actions
• Item-based actions
• Query
• Scan
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Scan
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Scan
Avoid!
Expensive at
scale
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Secondary indexes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Secondaryindexes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Secondaryindexes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Secondaryindexes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Secondaryindexes
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Basics
1. Start with an ERD
2. Define your access patterns
3. Design your primary key & secondary indexes
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Forget your relational experience
• Normalization
• JOINs
• One entity type per table
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Setup
• Ecommerce store
• Users make orders
• An order may have many items
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
1. Create your ERD
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Ecommerce store
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
2. Define your access patterns
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Identify access patterns
1. Get user profile
2. Get orders for user
3. Get single order and order items
4. Get orders for user by status
5. Get open orders
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
3. Design your primary keys & secondary indexes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address
Order
Order item
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Denormalization + document types
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address N/A N/A
Order
Order item
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
One-to-many: Sort keys
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address N/A N/A
Order USER#<username> ORDER#<orderId>
Order item
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address N/A N/A
Order USER#<username> ORDER#<orderId>
Order item
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Query:
“PK = USER#alexdebrie AND BEGINS_WITH(SK, ‘ORDER#’)”
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
One-to-many: Sort keys
“PK = USER#alexdebrie AND BEGINS_WITH(SK, ‘ORDER#’)”
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address N/A N/A
Order USER#<username> ORDER#<orderId>
Order item ITEM#<itemId> ORDER#<orderId>
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Entities
PK SK
User USER#<username> #PROFILE#<username>
User address N/A N/A
Order USER#<username> ORDER#<orderId>
Order item ITEM#<itemId> ORDER#<orderId>
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Inverted index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Inverted index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Inverted index
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
One-to-many relationship patterns
1. Attribute (list or map)
2. Primary key + query
3. Secondary index + query
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering
SELECT * FROM ORDERS
WHERE USERNAME = ‘alexdebrie’
AND ORDERDATE > GETDATE() - 14
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Query
Must
provide
partition
key
May
provide sort
key
conditions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filter expressions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
SELECT * FROM ORDERS
WHERE USERNAME = ‘alexdebrie’
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering access patterns
“PK = USER#alexdebrieAND BEGINS_WITH(SK, ‘ORDER#’)”
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering patterns: primary key
“PK = USER#alexdebrieAND BEGINS_WITH(SK, ‘ORDER#’)”
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
SELECT * FROM ORDERS
WHERE USERNAME = ‘alexdebrie’
AND STATUS = ‘SHIPPED’
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie
Filtering access pattern
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie
Filtering access pattern
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie
Filtering access pattern
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie
Filtering patterns: composite sort key
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
SELECT * FROM ORDERS
WHERE USERNAME = ‘alexdebrie’
AND STATUS = ‘SHIPPED’
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering patterns: Composite sort key
“PK = USER#alexdebrieAND BEGINS_WITH(OrderStatusDate, ‘SHIPPED#’)”
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filtering patterns: Composite sort key
“PK = USER#alexdebrieAND BEGINS_WITH(OrderStatusDate, ‘SHIPPED#’)”
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering access patterns
1. Get orders for user
2. Get orders by status for user
3. Get open orders
SELECT * FROM ORDERS
WHERE STATUS = ‘PLACED’
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filteringaccess patterns: Sparse index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filteringaccess patterns: Sparse index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Filteringaccess patterns: Sparse index
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filtering patterns
1. Primary key
2. Composite sort key
3. Sparse index
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Thank you!
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Alex DeBrie
@alexbdebrie
alexdebrie.com

More Related Content

What's hot

Deep Dive on Amazon Athena - AWS Online Tech Talks
Deep Dive on Amazon Athena - AWS Online Tech TalksDeep Dive on Amazon Athena - AWS Online Tech Talks
Deep Dive on Amazon Athena - AWS Online Tech TalksAmazon Web Services
 
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...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
 
Building Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS GlueBuilding Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS GlueAmazon Web Services
 
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...Amazon Web Services
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
 
Big Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSBig Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSAmazon Web Services
 
Everything You Need to Know About Big Data: From Architectural Principles to ...
Everything You Need to Know About Big Data: From Architectural Principles to ...Everything You Need to Know About Big Data: From Architectural Principles to ...
Everything You Need to Know About Big Data: From Architectural Principles to ...Amazon Web Services
 
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
 
AWS Lake Formation Deep Dive
AWS Lake Formation Deep DiveAWS Lake Formation Deep Dive
AWS Lake Formation Deep DiveCobus Bernard
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTAmazon Web Services
 
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAmazon Web Services
 
Building Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWSBuilding Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWSAmazon Web Services
 
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Amazon Web Services
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022CloudHesive
 

What's hot (20)

Deep Dive on Amazon Athena - AWS Online Tech Talks
Deep Dive on Amazon Athena - AWS Online Tech TalksDeep Dive on Amazon Athena - AWS Online Tech Talks
Deep Dive on Amazon Athena - AWS Online Tech Talks
 
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...
AWS Storage and Database Architecture Best Practices (DAT203) | AWS re:Invent...
 
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
 
Building Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS GlueBuilding Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS Glue
 
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...
User Management and App Authentication with Amazon Cognito - SID343 - re:Inve...
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
 
Big Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSBig Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWS
 
Everything You Need to Know About Big Data: From Architectural Principles to ...
Everything You Need to Know About Big Data: From Architectural Principles to ...Everything You Need to Know About Big Data: From Architectural Principles to ...
Everything You Need to Know About Big Data: From Architectural Principles to ...
 
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) ...
 
AWS Lake Formation Deep Dive
AWS Lake Formation Deep DiveAWS Lake Formation Deep Dive
AWS Lake Formation Deep Dive
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCT
 
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
 
AWS 101
AWS 101AWS 101
AWS 101
 
Building Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWSBuilding Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWS
 
Amazon Aurora: Under the Hood
Amazon Aurora: Under the HoodAmazon Aurora: Under the Hood
Amazon Aurora: Under the Hood
 
AWS Secrets Manager
AWS Secrets ManagerAWS Secrets Manager
AWS Secrets Manager
 
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022
 
Introduction to Amazon Athena
Introduction to Amazon AthenaIntroduction to Amazon Athena
Introduction to Amazon Athena
 

Similar to Data modeling with Amazon DynamoDB - ADB301 - New York AWS Summit

AWS SSA Webinar 4 - Building out your multi-account infrastructure
AWS SSA Webinar 4 - Building out your multi-account infrastructureAWS SSA Webinar 4 - Building out your multi-account infrastructure
AWS SSA Webinar 4 - Building out your multi-account infrastructureCobus Bernard
 
Becoming A High Frequency Enterprise
Becoming A High Frequency EnterpriseBecoming A High Frequency Enterprise
Becoming A High Frequency EnterpriseAmazon Web Services
 
Building AR/VR applications on AWS
Building AR/VR applications on AWSBuilding AR/VR applications on AWS
Building AR/VR applications on AWSAmazon Web Services
 
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019Amazon Web Services Korea
 
Keynote_AWS_BecomingAHighFrequencyEnterprise
Keynote_AWS_BecomingAHighFrequencyEnterpriseKeynote_AWS_BecomingAHighFrequencyEnterprise
Keynote_AWS_BecomingAHighFrequencyEnterpriseAmazon Web Services
 
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...Amazon Web Services
 
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...Automate Security Event Management Using Trust-Based Decision Models - AWS Su...
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...Amazon Web Services
 
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...Amazon Web Services
 
Digital transformation for local news - SVC220 - New York AWS Summit
Digital transformation for local news - SVC220 - New York AWS SummitDigital transformation for local news - SVC220 - New York AWS Summit
Digital transformation for local news - SVC220 - New York AWS SummitAmazon Web Services
 
Serverless AI-Powered Identity Management - AWS Summit Sydney
Serverless AI-Powered Identity Management - AWS Summit SydneyServerless AI-Powered Identity Management - AWS Summit Sydney
Serverless AI-Powered Identity Management - AWS Summit SydneyAmazon Web Services
 
Deep dive on AWS Fargate - MAD202 - São Paulo AWS Summit
Deep dive on AWS Fargate - MAD202 - São Paulo AWS SummitDeep dive on AWS Fargate - MAD202 - São Paulo AWS Summit
Deep dive on AWS Fargate - MAD202 - São Paulo AWS SummitAmazon Web Services
 
Trends in Digital Transformation by Joe Chung
Trends in Digital Transformation by Joe ChungTrends in Digital Transformation by Joe Chung
Trends in Digital Transformation by Joe ChungSameer Kenkare
 
Tools for building your Startup on AWS
Tools for building your Startup on AWSTools for building your Startup on AWS
Tools for building your Startup on AWSRob De Feo
 
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Amazon Web Services
 
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...Amazon Web Services
 
Building-Event-Driven-Serverless-Apps-with-AWS-Event-Forkines
Building-Event-Driven-Serverless-Apps-with-AWS-Event-ForkinesBuilding-Event-Driven-Serverless-Apps-with-AWS-Event-Forkines
Building-Event-Driven-Serverless-Apps-with-AWS-Event-ForkinesAmazon Web Services
 
Building AR-VR applications on AWS
Building AR-VR applications on AWSBuilding AR-VR applications on AWS
Building AR-VR applications on AWSAmazon Web Services
 
Rapid Prototyping with AWS - AWS Summit Sydney
Rapid Prototyping with AWS - AWS Summit SydneyRapid Prototyping with AWS - AWS Summit Sydney
Rapid Prototyping with AWS - AWS Summit SydneyAmazon Web Services
 
Why serverless will revolutionize your software process.
Why serverless will revolutionize your software process.Why serverless will revolutionize your software process.
Why serverless will revolutionize your software process.James Beswick
 
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS Summit
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS SummitBuilding AR/VR Apps with AWS - SVC201 - Anaheim AWS Summit
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS SummitAmazon Web Services
 

Similar to Data modeling with Amazon DynamoDB - ADB301 - New York AWS Summit (20)

AWS SSA Webinar 4 - Building out your multi-account infrastructure
AWS SSA Webinar 4 - Building out your multi-account infrastructureAWS SSA Webinar 4 - Building out your multi-account infrastructure
AWS SSA Webinar 4 - Building out your multi-account infrastructure
 
Becoming A High Frequency Enterprise
Becoming A High Frequency EnterpriseBecoming A High Frequency Enterprise
Becoming A High Frequency Enterprise
 
Building AR/VR applications on AWS
Building AR/VR applications on AWSBuilding AR/VR applications on AWS
Building AR/VR applications on AWS
 
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019
클라우드 세상에서 CIO로 살아남기 - 이한주 대표이사, Bespin Global :: AWS Summit Seoul 2019
 
Keynote_AWS_BecomingAHighFrequencyEnterprise
Keynote_AWS_BecomingAHighFrequencyEnterpriseKeynote_AWS_BecomingAHighFrequencyEnterprise
Keynote_AWS_BecomingAHighFrequencyEnterprise
 
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...
Expert tips for successful Kubernetes deployments on AWS - MAD305 - São Paulo...
 
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...Automate Security Event Management Using Trust-Based Decision Models - AWS Su...
Automate Security Event Management Using Trust-Based Decision Models - AWS Su...
 
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...
The Theory and Practice, Practice, Practice of AWS Operations - AWS Summit Sy...
 
Digital transformation for local news - SVC220 - New York AWS Summit
Digital transformation for local news - SVC220 - New York AWS SummitDigital transformation for local news - SVC220 - New York AWS Summit
Digital transformation for local news - SVC220 - New York AWS Summit
 
Serverless AI-Powered Identity Management - AWS Summit Sydney
Serverless AI-Powered Identity Management - AWS Summit SydneyServerless AI-Powered Identity Management - AWS Summit Sydney
Serverless AI-Powered Identity Management - AWS Summit Sydney
 
Deep dive on AWS Fargate - MAD202 - São Paulo AWS Summit
Deep dive on AWS Fargate - MAD202 - São Paulo AWS SummitDeep dive on AWS Fargate - MAD202 - São Paulo AWS Summit
Deep dive on AWS Fargate - MAD202 - São Paulo AWS Summit
 
Trends in Digital Transformation by Joe Chung
Trends in Digital Transformation by Joe ChungTrends in Digital Transformation by Joe Chung
Trends in Digital Transformation by Joe Chung
 
Tools for building your Startup on AWS
Tools for building your Startup on AWSTools for building your Startup on AWS
Tools for building your Startup on AWS
 
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
 
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...
[NEW LAUNCH!] Introducti[NEW LAUNCH!] Introduction to event-driven architectu...
 
Building-Event-Driven-Serverless-Apps-with-AWS-Event-Forkines
Building-Event-Driven-Serverless-Apps-with-AWS-Event-ForkinesBuilding-Event-Driven-Serverless-Apps-with-AWS-Event-Forkines
Building-Event-Driven-Serverless-Apps-with-AWS-Event-Forkines
 
Building AR-VR applications on AWS
Building AR-VR applications on AWSBuilding AR-VR applications on AWS
Building AR-VR applications on AWS
 
Rapid Prototyping with AWS - AWS Summit Sydney
Rapid Prototyping with AWS - AWS Summit SydneyRapid Prototyping with AWS - AWS Summit Sydney
Rapid Prototyping with AWS - AWS Summit Sydney
 
Why serverless will revolutionize your software process.
Why serverless will revolutionize your software process.Why serverless will revolutionize your software process.
Why serverless will revolutionize your software process.
 
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS Summit
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS SummitBuilding AR/VR Apps with AWS - SVC201 - Anaheim AWS Summit
Building AR/VR Apps with AWS - SVC201 - Anaheim AWS Summit
 

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
 

Data modeling with Amazon DynamoDB - ADB301 - New York AWS Summit

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Data modeling with Amazon DynamoDB Alex DeBrie Engineering Manager Serverless, Inc. A D B 3 0 1
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Agenda What is DynamoDB? Key concepts Data modeling strategies
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Alex DeBrie Engineering Manager, Serverless, Inc. DynamoDBGuide.com @alexbdebrie alexdebrie.com
  • 4. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T What is DynamoDB? NoSQL database Fully managed by AWS HTTPS with AWS Identity and Access Management (IAM) Auth Fast, consistent performance as it scales
  • 6. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hyperscale
  • 7. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hyperephemeral compute
  • 8. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 9. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Concepts • Table • Item • Primary key • Attributes
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Table
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Item
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Primarykey
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Attributes
  • 15. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Primary key • Simple primary key (partition key) • Composite primary key (partition key + sort key)
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Simple primarykey
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Composite primarykey
  • 18. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. API actions • Item-based actions
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Item-based actions – Writing, updating, deleting
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Item-based actions – Writing, updating, deleting Must provide entire primary key
  • 21. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. API actions • Item-based actions • Query
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Query
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Query Must provide partition key May provide sort key conditions
  • 24. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. API actions • Item-based actions • Query • Scan
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Scan
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Scan Avoid! Expensive at scale
  • 27. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Secondary indexes
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Secondaryindexes
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Secondaryindexes
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Secondaryindexes
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Secondaryindexes
  • 32. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 33. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Basics 1. Start with an ERD 2. Define your access patterns 3. Design your primary key & secondary indexes
  • 34. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Forget your relational experience • Normalization • JOINs • One entity type per table
  • 35. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Setup • Ecommerce store • Users make orders • An order may have many items
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 1. Create your ERD
  • 37. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ecommerce store
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 2. Define your access patterns
  • 39. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Identify access patterns 1. Get user profile 2. Get orders for user 3. Get single order and order items 4. Get orders for user by status 5. Get open orders
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 3. Design your primary keys & secondary indexes
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address Order Order item
  • 45. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 46. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 47. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Denormalization + document types
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address N/A N/A Order Order item
  • 50. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 51. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 52. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T One-to-many: Sort keys
  • 53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address N/A N/A Order USER#<username> ORDER#<orderId> Order item
  • 54. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address N/A N/A Order USER#<username> ORDER#<orderId> Order item
  • 55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Query: “PK = USER#alexdebrie AND BEGINS_WITH(SK, ‘ORDER#’)”
  • 56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T One-to-many: Sort keys “PK = USER#alexdebrie AND BEGINS_WITH(SK, ‘ORDER#’)”
  • 57. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 58. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 59. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 60. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address N/A N/A Order USER#<username> ORDER#<orderId> Order item ITEM#<itemId> ORDER#<orderId>
  • 61. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Entities PK SK User USER#<username> #PROFILE#<username> User address N/A N/A Order USER#<username> ORDER#<orderId> Order item ITEM#<itemId> ORDER#<orderId>
  • 62. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 63. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Inverted index
  • 64. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Inverted index
  • 65. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Inverted index
  • 66. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. One-to-many relationship patterns 1. Attribute (list or map) 2. Primary key + query 3. Secondary index + query
  • 67. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 68. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering SELECT * FROM ORDERS WHERE USERNAME = ‘alexdebrie’ AND ORDERDATE > GETDATE() - 14
  • 69. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 70. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 71. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 72. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 73. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Query Must provide partition key May provide sort key conditions
  • 74. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 75. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 76. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 77. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 78. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 79. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 80. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filter expressions
  • 81. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders
  • 82. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders
  • 83. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders SELECT * FROM ORDERS WHERE USERNAME = ‘alexdebrie’
  • 84. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering access patterns “PK = USER#alexdebrieAND BEGINS_WITH(SK, ‘ORDER#’)”
  • 85. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering patterns: primary key “PK = USER#alexdebrieAND BEGINS_WITH(SK, ‘ORDER#’)”
  • 86. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders
  • 87. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders SELECT * FROM ORDERS WHERE USERNAME = ‘alexdebrie’ AND STATUS = ‘SHIPPED’
  • 88. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie Filtering access pattern
  • 89. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie Filtering access pattern
  • 90. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie Filtering access pattern
  • 91. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T@alexbdebrie Filtering patterns: composite sort key
  • 92. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders SELECT * FROM ORDERS WHERE USERNAME = ‘alexdebrie’ AND STATUS = ‘SHIPPED’
  • 93. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering patterns: Composite sort key “PK = USER#alexdebrieAND BEGINS_WITH(OrderStatusDate, ‘SHIPPED#’)”
  • 94. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filtering patterns: Composite sort key “PK = USER#alexdebrieAND BEGINS_WITH(OrderStatusDate, ‘SHIPPED#’)”
  • 95. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders
  • 96. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders
  • 97. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering access patterns 1. Get orders for user 2. Get orders by status for user 3. Get open orders SELECT * FROM ORDERS WHERE STATUS = ‘PLACED’
  • 98. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filteringaccess patterns: Sparse index
  • 99. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filteringaccess patterns: Sparse index
  • 100. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Filteringaccess patterns: Sparse index
  • 101. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filtering patterns 1. Primary key 2. Composite sort key 3. Sparse index
  • 102. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Alex DeBrie @alexbdebrie alexdebrie.com