API Gateway & Dynamo DB Flashcards
Can you use mapping templates when you have the proxy setting enabled?
No
What is the difference between provisioned and on-demand mode for DynamoDB?
Provisioned (default) - you specify the number of reads/writes per second, plan capacity beforehand, pay for provisioned units.
On-demand - read/writes automatically scale with your workloads. No planning needed but more expensive.
What is one write capacity unit (WCU) in DynamoDB?
Represents one write per second for an item up to 1KB in size (rounded up to the nearest whole KB)
Work out the number of write capacity units needed to write 6 items per second into DynamoDB each with a size of 1.5KB
6 x 2 = 12 1.5KB would be rounded up to 2KB (because amazon are money greedy bastards)
Work out the number of write capacity units needed to write 120 items per minute into DynamoDB each with a size of 2KB
120/60 x 2 = 4
What are the two “modes” for reading items from DynamoDB (in the context of consistency)
Eventually consistent read (default) - if we read straight after a write we might get stale data as replication may not complete in time.
Strongly consistent read - reading always up-to-date data, this is done via a parameter in the api call, consumes twice the RCU (read capacity units).
What does one read capacity unit represent in DynamoDB?
Represents one strongly consistent read per second or two eventually consistent reads per second, for an item up to 4KB in size.
Work out the number of read capacity units for 10 strongly consistent reads per second, with an item size of 4KB
10 RCUs
Work out the number of read capacity units for 16 eventually consistent reads per second with an item size of 12KB
We need (16/2) x (12kb / 4kb) = 24 RCUs
What is the difference between the PutItem and UpdateItem api calls to DynamoDB?
PutItem creates or replaces an item (based on primary key) whereas UpdateItem edits a subset of an existing items attributes.
What is the most efficient way to delete all the items in a DynamoDB table?
Use the DeleteTable api call, do not use the DeleteItem with a scan
In DynamoDB when using batch operations what happens if one operation in a batch fails?
The whole batch does not roll back, just the parts that failed are returned as failed, the client can then retry just those failed operations.
What is PartiQL?
SQL compatible query language for DynamoDB (without joins)
What is DynamoDB Accelerator (DAX)?
In memory cache for DynamoDB
What can be cached in a DAX?
Individual objects, queries / scans