All Flashcards
What is the difference between Scalar and non-scalar data type?
Scalar is a single value (e.g. string, number, boolean). Non-scalar is a set of values (e.g. a set of numbers or strings).
What is a document data type?
A complex structure with nested attributes (e.g. list, map)
What is automatic synchronous replication, and how is it achieved?
DDB replicates your data across at least 3 facilities within a region an near real-time speeds. This allows for durability of data - the copies at different facilities act as independent failure domains.
What two types of read does DDB offer?
Strong Consistency reads and Eventual Consistency reads
What is a Strong Consistency read?
Provides the most up-to-date data. This type of read must be requested explicity
What is an Eventual Consistency read?
Provides data that may or may not reflect the latest copy of data (it is accessed from any of the data copies). This is the default consistency for all operations, and is 50% cheaper.
What are the main attributes of RCUs and WCUs
Read Capacity Units: 1 RCU is equal to either 1 strongly consistent table read/sec or 2 eventually consistent table reads/sec. Read in 4KB blocks.
Write Capacity Units: 1 WCU is equal to 1 table write/sec. Written in blocks of 1KB.
What is burst capacity?
If read/write load overloads provisioned RCU/WCU capacity (during a burst or spike of activity), DDB provides burst capacity - up to 5 minutes of unused read/write capacity.
What is the maximum capacity a table partition can support?
1000 WCUs or 3000 RCUs.
What is On-Demand Capacity mode, and when does it work best?
DynamoDB charges you for the data reads and writes your application performs on your tables - you do not need to specify this throughput in advance.
On-demand capacity mode might be best if you:
Create new tables with unknown workloads.
Have unpredictable application traffic.
Prefer the ease of paying for only what you use.
What is a partition?
A block of memory located by DDB for storage.
How much data can a partition hold, and what is its optimum throughput?
10gb, about 3000 RCUs and 1000 WCUs
How are partitions managed?
DDB manages partitions automatically. Additional partitions are provided for a table if the data storage or capacity is exceeded.
How can we remove a partition allocated to a table?
Once a partition is allocated to a table, it will not be re-allocated if you scale down a table’s capacity. This means we must be careful when bumping up capacity of a table in the short term, since removing capacity will result in a table with low throughput due to multiple unnecessary partitions.
The only way to improve the throughput at this point would be to simply increase the table throughput (which would also increase costs), or to recreate the entire table.
What is a partition key?
A partition key is also known as a hash key. It can be the whole primary key or part of a composite primary key (along with a sort or range key) to a table. The purpose of the partition key (in DDB’s eyes) is to identify the exact partition the table’s data is stored in.
What are Local Secondary Indexes?
LSIs act as an alternative sort key to data, but use the same partition key. They must be decided upon table creation.
What are Global Secondary Indexes?
An index with a partition key and a sort key that can be different form those on the base table. A GSI is stored in its own partition space away from the base table, and as such can be created whenever desired.
What types of reads can you perform with LSIs and GSIs?
LSIs - Strongly and Eventually. GSIs - Only Eventually.
Why should we avoid using Scan operations?
They operate across all partitions of a table, and so use up a lot of RCUs (resulting in a potentially very expensive operation).
A conditional write to a DDB is said to be Idempotent. What does this mean?
Idempotent - an operation that can be applied multiple times without changing the result beyond the initial application. We can make the same request for a conditional write multiple times - only the first request can affect a change.
Does a ConditionalCheckFailedException consume WCUs?
Yes - despite there being no write operation, WCUs are still consumed.
How much data can DDB return per request?
1MB can be returned per read/scan.
What is the LastEvaluatedKey?
The set of index attributes of the next item up to which the response was returned.