DynamoDB FAQ Flashcards

1
Q

FAQ: What is Amazon DynamoDB?

A

DynamoDB is a fast and flexible nonrelational database service for any scale. DynamoDB enables customers to offload the administrative burdens of operating and scaling distributed databases to AWS so that they don’t have to worry about hardware provisioning, setup and configuration, throughput capacity planning, replication, software patching, or cluster scaling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

FAQ: What does DynamoDB manage on my behalf?

A

DynamoDB takes away one of the main stumbling blocks of scaling databases: the management of database software and the provisioning of the hardware needed to run it. You can deploy a nonrelational database in a matter of minutes. DynamoDB automatically scales throughput capacity to meet workload demands, and partitions and repartitions your data as your table size grows. Also, DynamoDB synchronously replicates data across three facilities in an AWS Region, giving you high availability and data durability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

FAQ: What is the consistency model of DynamoDB?

A

When reading data from DynamoDB, users can specify whether they want the read to be eventually consistent or strongly consistent:

Eventually consistent reads (the default) – The eventual consistency option maximizes your read throughput. However, an eventually consistent read might not reflect the results of a recently completed write. All copies of data usually reach consistency within a second. Repeating a read after a short time should return the updated data.

Strongly consistent reads — In addition to eventual consistency, DynamoDB also gives you the flexibility and control to request a strongly consistent read if your application, or an element of your application, requires it. A strongly consistent read returns a result that reflects all writes that received a successful response before the read.

ACID transactions – DynamoDB transactions provide developers atomicity, consistency, isolation, and durability (ACID) across one or more tables within a single AWS account and region. You can use transactions when building applications that require coordinated inserts, deletes, or updates to multiple items as part of a single logical business operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

FAQ: What kind of query functionality does DynamoDB support?

A

DynamoDB supports GET/PUT operations by using a user-defined primary key. The primary key is the only required attribute for items in a table. You specify the primary key when you create a table, and it uniquely identifies each item. DynamoDB also provides flexible querying by letting you query on nonprimary key attributes using global secondary indexes and local secondary indexes.

A primary key can be either a single-attribute partition key or a composite partition-sort key. A single-attribute partition key could be, for example, UserID. Such a single attribute partition key would allow you to quickly read and write data for an item associated with a given user ID.

DynamoDB indexes a composite partition-sort key as a partition key element and a sort key element. This multipart key maintains a hierarchy between the first and second element values. For example, a composite partition-sort key could be a combination of UserID (partition) and Timestamp (sort). Holding the partition key element constant, you can search across the sort key element to retrieve items. Such searching would allow you to use the Query API to, for example, retrieve all items for a single UserID across a range of time stamps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

FAQ: How do I update and query data items with DynamoDB?

A

After you have created a table using the DynamoDB console or CreateTable API, you can use the PutItem or BatchWriteItem APIs to insert items. Then, you can use the GetItem, BatchGetItem, or, if composite primary keys are enabled and in use in your table, the Query API to retrieve the items you added to the table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

FAQ: Can DynamoDB be used by applications running on any operating system?

A

Yes. DynamoDB is a fully managed cloud service that you access via API. Applications running on any operating system (such as Linux, Windows, iOS, Android, Solaris, AIX, and HP-UX) can use DynamoDB. We recommend using the AWS SDKs to get started with DynamoDB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

FAQ: How an I charged for my use of DynamoDB?

A

Each DynamoDB table has provisioned read-throughput and write-throughput associated with it. You are billed by the hour for that throughput capacity if you exceed the free tier. Note that you are charged by the hour for the throughput capacity, whether or not you are sending requests to your table. If you would like to change your table’s provisioned throughput capacity, you can do so using the AWS Management Console, the UpdateTable API, or the PutScalingPolicy API for auto scaling. Also, DynamoDB charges for data storage as well as the standard internet data transfer fees.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

FAQ: What is the maximum throughput I can provision for a single DynamoDB table?

A

Maximum throughput per DynamoDB table is practically unlimited. For information about the limits in place, see Limits in DynamoDB. If you want to request a limit increase, contact Amazon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

FAQ: What is the minimum throughput I can provision for a single DynamoDB table?

A

The smallest provisioned throughput you can request is 1 write capacity unit and 1 read capacity unit for both auto scaling and manual throughput provisioning. Such provisioning falls within the free tier which allows for 25 units of write capacity and 25 units of read capacity. The free tier applies at the account level, not the table level. In other words, if you add up the provisioned capacity of all your tables, and if the total capacity is no more than 25 units of write capacity and 25 units of read capacity, your provisioned capacity would fall into the free tier.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Name the 3 core components of DynamoDB including a description.

A

Table: A collection of items.

Item: A collection of attributes. There is no limit to the number of items that can be stored in a table.

Attribute: The fundamental data element which doesn’t need to be broken down further. Analogous to a key/value pair or a column in other DB systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a scalar?

A

Something that contains only on value. A number or a string as opposed to an array or object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the two types of primary keys?

A

Partition key: A simple primary key, composed of one attribute known as the partition key.

Partition and sort key: Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What data types can be used in a primary key?

A

Primary key values can be any scalar type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two types of secondary indexes?

A

Global secondary index – An index with a partition key and sort key that can be different from those on the table.

Local secondary index – An index that has the same partition key as the table, but a different sort key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the limit to the number of indexes you can create an a table?

A

26

1 Primary Key

20 Global Secondary Keys

5 Local Secondary Keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a DynamoDB Stream?

A

DynamoDB Streams is an optional feature that captures data modification events in DynamoDB tables. The data about these events appear in the stream in near-real time, and in the order that the events occurred.

17
Q

How long does a record stay in a DynamoDB Stream?

A

24 hours

18
Q

What is DAX?

A

DynamoDB Accelerator. DAX is a DynamoDB compatible cashing service which delivers response times in the micro seconds for eventually consistent data.

19
Q

Name the three core scenarios DAX was designed to cover.

A

As an in-memory cache, DAX reduces the response times of eventually consistent read workloads by an order of magnitude from single-digit milliseconds to microseconds.

DAX reduces operational and application complexity by providing a managed service that is API-compatible with DynamoDB. Therefore, it requires only minimal functional changes to use with an existing application.

For read-heavy or bursty workloads, DAX provides increased throughput and potential operational cost savings by reducing the need to overprovision read capacity units. This is especially beneficial for applications that require repeated reads for individual keys.