DynamoDB Flashcards
(38 cards)
Eight things about DynamoDB?
- Fully managed
- Multi-region
- Multi-master
- Durable
- Built-in security
- Backup and restore
- In-memory caching
- Data is stored across multiple AZs
What are the 2 types of reads that DynamoDB provides?
- Strongly Consistent Reads
- Eventually Consistent Reads (Default)
The Key Value and Document database solution for AWS
DynamoDB (NoSQL)
What are the 3 components of a DynamoDB table?
- Keys
- Values
- Attributes
How many partitions does a DynamoDB database start off with?
1
How large can a single DynamoDB partition be? (GB)
10GB
The maximum read and write capacity units for a single DynamoDB partition
3000 Read Capacity Units, 1000 Write Capacity Units
These 2 components make up a composite primary key in DynamoDB
(kəmˈpɑzət)
Partition Key & Sort Key
In Dynamo DB, When using a simple primary key how many items can have the same partition key?
1
In Dynamo DB, What additional key component makes a primary key composite?
Sort key
- (The combination of the partition and the sort has to be unique) There is a secret internal hash function that decides which partition to write data
- New data is added into a partition with similar data, Eg. a category
- Partition Key: Category
- Sort Key: Name
In Dynamo DB, with composite keys multiple items share the same partition key (as long as their sort keys are different)
True or False
True.
- Partition Key: Country
- Sort Key: Citiy
Partition A: VE - CCS VE - MCBO Partition B: CL - STGO CL - CONCE
In Dynamo DB, The 2 methods of retrieving items from a DynamoDB table
Query & Scan
In Dynamo DB, By default what item attributes does a query return?
All attributes
This DynamoDB item retrieval method finds items based on primary key values.
Query
This DynamoDB item retrieval method checks all items, then returns one of more item using filters
Scan
- Scans are one of the most expensive ways to access data in DynamoDB
- Scans can be Slow
In Dynamo DB, which method do you have to avoid because it retrieves everything.
It’s much less efficient than running the other one
Scan
- Scans are one of the most expensive ways to access data in DynamoDB
- Scans can be Slow
With DynamoDB the maximum amount of capacity your application is allowed to read or write per second from a table or index is called this. (The name of the capacity)
Read/Write capacity mode: ___
Provisioned Throughput Capacity
(prəˈvɪʒənd ˈθruˌpʊt kəˈpæsəti)
Provisioned
- RCUs
- WCUs
We can turn on Auto Scaling
Requests that are throttled will be dropped (data lost)
With this DynamoDB capacity type you only pay per request - so you are only paying for what you use
Read/Write capacity mode: ___
On-Demand Capacity
- Provisioned capacity not applicable
- Auto Scaling not applicable
New tables with unknown workloads, unpredictable application traffic
Default upper limits for a table
40,000 RCUs
40,000 WCUs
- Since there is no hard limit On-Demand could become very expensive based on emerging scenarios
In DynamoDB,
What are the 3 requirements for creating a Global Table?
- KMS CMK
- Enable Streams
- StreamViewType (What info is going to be written to the stream)KEYS_ONLY - Only the key attributes of the modified item are written to the stream.NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream.OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream.NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream.
How many underlying reads or writes does DynamoDB perform on every item in a transaction?
2
- One to prepare the transaction
- One to commit the transaction
The 2 operations for performing transactions with DynamoDB
- TransacWriteItems
- TranscGetItems
Which format must you provide your TTL value in?
To use TTL you must use a string which needs to be In Epoch format (Datetime represented as numbers)
(ˈipək) format
What is TTL in DynamoDB?
Time To Live
- It’s great for keeping databases small and manageable because some data is deleted when it expires
Eg: Session data, Usage Patterns, Some logs
In DynamoDB this value specifies when an item should expire/delete itself
Time To Live (TTL) Value