DynamoDB Flashcards
How many facilities in a region is DynamoDB replicated
3
Eventual Consistent Reads vs. Strongly
Eventual (Default) consistency is usually reached in under 1 second and has the best performance. Strongly requires that the data has been completely written prior to the read.
What components are part of DynamoDB
Tables, Items (think rows), Attributes (think column of data in a row)
Type of primary key that is a single attribute (think unique id) Partition key a.k.a Hash key
Single Attribute
Type of primary key that composed of two attributes
Composite - Partition Key and Sort Key (Hash and Range)
What does DD use to determine the physical location where the data is stored
Partition Key - used as an input to an internal hash function to determine location
How are multliple items with the same Partition Key stored together
Using a different sort key. For example same userid creating multiple posts to a forum.
What type of Index can only be created when creating the table, cannot be removed or modified, and has the SAME partition key, different sort key.
Local Secondary Index
What type of index has a different partition key and different sort key and can be created at any time
Global Secondary Index
What is more efficient to use, Scan or Query
Query, since it find items in a table using only primary key attribute values.
What are DynamoDB streams used for?
To capture any kind of modification and then take certain action on those changes
What changes are captured by DynamoDB Streams during an update?
The before and after image of any attributes that were modified in the item
What changes are captured by DynamoDB Streams during an item delete from a table?
An image of the complete item before it was deleted
What is the lifetime of a Stream
24 hours and then the data is subject to trimming (removal) at any given time
How can you make a Scan operation more efficient?
Use the ProjectionExpression parameter which is like a filter
You have an application that requires to read 5 items at 10KB/sec using eventual consistency. What do you set the read throughput to?
Round 10 up the nearest multiple of 4, so 12. Then divide 12/4 = 3. Then multiple the items by rate/per sec, so 3 x 5 = 15. For eventual consistency /2 so = 7.5 round up to 8.
How to calculate the Write throughput?
Just multiply the numbers.
Why might you receive the 400 HTTP status code of ProvisionedThroughputExceededException
You have exceeded your maximum allow provisioned throughput for a table for one more global secondary indexes
Steps to authenticate with an identity provider
- User authenticates with FB, 2. Token is passed, 3. You code calls AssumeRoleWithWebIdentity API and provides the providers token and specifies the ARN for the IAM role, 4. The app is now authenticated between 15min - 1 hour, 1 hour is default.
What is special about Conditional Writes
They are idempotent
What are Atomic Counters?
The are non-idempotent updates where you use the “UpdateItem” operation to increment or decrement the value of an existing attribute without interfering with other write requests. I.E. website hit counter
When would you use the BatchGetItem call?
When you need to get multiple items at once.
Limits of a single BatchGetItem request.
Can retrieve up to 1MB data containing up to 100 items. A single request can also contain items from multiple tables
What limit of DynamoDB can be increased by a request to AWS?
Provisioned throughput limits and Table Size (initial limit of 256 tables per regions)