NoSQL & DynamoDB Flashcards
What is DynamoDB (DDB)?
A fully managed DBaaS providing wide-column key/value stores.
In what ways is DynamoDB resilient?
Across AZs and optionally global.
How are DynamoDB tables keyed?
Either with a simple key (the partition key) or a composite key (the partition key and a sort key).
What is the byte-size maximum for a DynamoDB item?
400KB. This includes the key(s).
How is DynamoDB capacity allocated?
Capacity refers to performance, not storage, and is broken up into Write Capacity Unites (WCUs) and Read Capacity Units (RCUs).
What is Point-in-time Recovery (PITR) and how does it work?
Optional per-table feature that, when enabled, continuously streams backups for a 35 day window. Restores can be applied from this window with 1-second granularity.
What is DynamoDB billing based on?
RCU, WCU, Storage needed, and any enabled features like PITR.
Reservation commitments are available for known, long-term needs.
How many RCUs/WCUs are consumed per operation?
4KB per RCU per second, and 1KB per WCU per second. Every operation consumes at least one R/WCU - small operations can be considered to “round up.”
When running Scan operations on a DynamoDB table, how are RCUs calculated?
The number of RCUs consumed is based on the byte size of the entire table, not just the returned items. Scanned but not returned items still consume capacity during a Scan.
For example, Scanning at table with 38KB of items will always consume 10 RCUs (⌈38KB / 4KB⌉) for strongly-consistent reads.
What are the consistency options in DynamoDB?
Eventually consistent and strictly consistent.
Strongly consistent reads always connect to the leader node, while eventually consistent reads choose a random node and cost half the capacity.
How do DynamoDB Local Secondary Indexes (LSI) work?
LSIs are alternative views of a table that allow the definition of alternative SK (sort key). They share RCU and WCU capacity with the base table.
How many LSIs can be created per DynamoDB Table?
Five.
Can you add LSIs to an already defined DynamoDB table?
No. They must be created at the same time as the base table.
Are DynamoDB indexes sparse or dense?
Sparse. Items which don’t include an attribute value for the index’s key(s) are omitted from the view.
How do DynamoDB Global Secondary Indexes (LSI) work?
GSIs are alternative views of a table that allow the definition of both and alternative PK and SK. They do not share RCU and WCU capacity with the base table.
How many GSIs can be created per DynamoDB Table?
Twenty.
Can you add GSIs to an already defined DynamoDB table?
Yes. Unlike LSIs, they can be added after the base table has been created.
What is the consistency model for DynamoDB GSIs?
Global Secondary Indexes are always eventually consistent, there is no other option.
What is a DynamoDB Stream?
A time-ordered list of changes to items in a table.
How much data is in a DynamoDB Stream?
It’s a 24-hour rolling window of changes, influenced by the view types.
KEYS_ONLY - just the PK/SK of the changed record
NEW_IMAGE - full item before the change
OLD_IMAGE - full item after the change
NEW_AND_OLD_IMAGES - both pre/post change states
What is the use case for DynamoDB Triggers?
Developing a serverless, event-driven architecture based on a DynamoDB Stream + Lambda.
What are DynamoDB Global Tables?
An architecture for cross-region, multi-master replication.
How are write conflicts resolved with DynamoDB multi-master writes?
Last writer wins.
Can you perform strongly-consistent reads from a DynamoDB Global Table?
Yes, but only from within the same region as the write, any cross-region reads are eventually consistent via sub-second replication.
What is DynamoDB Accelerator (DAX)?
An in-memory cache that provides an SDK for tight integration at the application level.
Clustered, deployed into a VPC, and supports write-through.
What is Amazon Athena?
A serverless interactive querying service, allowing ad-hoc queries against data stored in S3.
What is ElastiCache?
Managed in-memory cache, either Redis or Memcached.
What is Amazon Redshift?
An OLAP petabyte-scale data warehouse.
Amazon Redshift typically runs in a single AZ in a VPC - are there ways to integrate with more complex networks?
Yes, by enabling Enhanced VPC Routing.
What are some other AWS services can that directly integrate with Reshift?
Kinesis Firehose, DMS (the Database Migration Service), and S3.
What are the disaster recovery options for Redshift?
Snapshots stored into S3 can be used for restores, which can also be cross-region.