DynamoDB Flashcards
What is DynamoDB
A fast and flexible NoSQL database. Serverless. Items stored on SSD storage.
Data models that DynamoDB supports
Document (JSON, HTML, or XML)
Key_value pairs
How many geographic distinct data centers is DynamoDB spread across
3
Default consistency model of Dynamo DB
Eventually Consistent Reads
2 types of primary keys DynamoDB supports
Partition Key - unique attribute
Composite Key- combo of partition key and sort key
IAM Condition you can set to restrict user access to their own records in DynamoDB
dynamodb:LeadingKeys
What is an index in DynamoDB
Way to perform fast queries on colum in table can select column you want to include
Local Secondary Index
Must be created when create table
Can not be removed or modified after creation
Partition key must be same as original table
Queries are much faster in index than main table
Global Secondary Index
Can create after table is created
Can edit or delete
Can have different partition key
What can you use if you want a query to only return specific attributes DynamoDB?
ProjectionExpression
How are results sorted DynamoDB?
Ascending order
can reverse by setting ScanIndexForward to false
How to improve performance of a scan
Reduce page size
Avoid using scan if you can
Use parallel scan but try to avoid if table or index is already incurring heavy read and write activity
1 X Write Capacity Unit
1 x Write of 1 KB/sec
1 x Read Capacity Uni
1 x Strongly Consistent Read of 4KB/sec
1 x Read Capacity Unit
2 x Eventually Consistent Read of 4KB/sec