Dynamo DB
Dynamo DB
• Expensive scaling.
• Of course, there are solution! but they’re also not that simple!
Now.. Is NoSQL a Model?
• NoSQL is simple “NOT” Relational.
• Item
• Attributes Number, String, Binary, Boolean, Null, List, Map, Set
DynamoDB Table Structure
• Sensor Readings
Reading Details
Sensor ID Timestamp
First Name Signal Strength Width
2023-10-20T13:15:12 13 12 11
SENSOR-0001
2023-10-20T13:15:15 15 13 10
DynamoDB Table Structure
Operators Access
Direct Access =, !=, >, <, Begins With
Id Date
order#details
12433 12/11/2023
Order#0001
Item Qty
order#lineItem#1
TV 3
DynamoDB Single Table Model???
• You Overload Partition Key and Sort Key.
• E.g. to read all order line items you query Order#0001 partition and
sort key Begins With order#lineItem#.
DynamoDB – Vertical Partitioning
• Instead of stuffing all your data in one item.
• Proceed stuffing the entities into a single DynamoDB table using keys
overloading.
• Evolve the design to serve the access patterns with the least RCU and
WCU possible.
DynamoDB – Example
DynamoDB – Example – Access Patterns
To
Invoice#Details
Sameer
Invoice#0002
Amount
Bill#0001
130
GSI
PK – GSI SK SK – GSI PK Attributes
Amount All Bill Invoices
Invoice#0001
Can be Read in a Single Query
150
Bill#0001
Amount
Invoice#0002
130
To
Invoice#0001
Mohammed
Invoice#Details
To
Invoice#0002 All Invoices Details
Sameer Can be Read in a Single Query
DynamoDB has More to Offer
• TTL – as a free way to delete data.
• DynamoDB Streams.
Single Table Design Disadvantages?
• Steep learning curve.
• Elevated complexity.
DynamoDB, how to begin?
• You can have the NoSQL Workbench.