DynamoDB Flashcards
Elasticache
Webservice that makes it easy to to scale an in memory cache in the cloud.
Elasticache Case Point
Retrieve top daily deals. Use cache instead of of DB.
DynmoDB
1) NOSQL DB single digit milisecond latency
2) Stored on SSD
3) 3 Geographically distinct locations
2 Types of Primary Keys
1) Single Attribute
2) Composite
Single Attribute
Partition key (also known as HashKey)
Composite
Partition Key + Sort Key.
Can have the same Partition key (so they are all stored together) but different sort key.
All sorted by sort key value
Streams
Captures any modification of DynamoDB Table. Can trigger Lambda functions through use of triggers. Streams must be enabled.
1) New Item - Captures Entire Image
2) Delete - Captures image of entire item
3) Update - Captures before and after image of any attribute modified
Query
Find items in a table by using only the primary key.
You must provide a partition key attribute name and distinct value to search for.
Typically the most efficient search.
Sort order is Ascending by default and you can use ScanIndexForward to reverse order
Project Expression
Allows you to specify what attributes to return on either Queries or Scans.
ScanIndexForward
Used to change the Sort order of a Query Only. By Default queries sort are Ascending by default and you can use ScanIndexForward to reverse order.
Scan
Examines every item and returns every attribute by default. Must use ProjectExpression to limit attributes.
-Optimize Scan by designing the tables to
Index Types
1) Local Secondary Index
2) Global Secondary Index
Local Secondary Index
- Same Partition Key
- Different Sort Key.
Can only be created during table creation. Cannot be deleted.
Supports both Eventual and Strong Consistency
Global Secondary Index
- Different Partition Key
- Different Sort Key
Can be created at anytime and can be deleted.
Supports only Eventual Consistency
Eventual Consistent Read Formula
(Read Size nearest 4KB/4KB) * (Items) / 2 =Eventual Consistent Read Throughput