DynamoDB Flashcards

1
Q

What is Amazon DynamoDB?

A

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.

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

DynamoDB also offers encryption at rest, why is this a benefit to AWS Customers?

A

Encryption at rest eliminates the operational burden and complexity of protecting sensitive data.

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

DynamoDB provides on-demand backup capability.
Which creates full backups of your tables for which two purposes?

A

DynamoDB allows you to create full backups of your tables for long-term retention and archival for regulatory compliance needs

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

How does DynamoDB provide built-in high availability and data durability?

A

All of your data is stored on solid-state disks (SSDs) and is automatically replicated across multiple Availability Zones in an AWS Region,

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

Describe global tables purpose in relation to DynamoDB?

A

You can use global tables to keep DynamoDB tables in sync across AWS Regions.

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

What are the three Core components of Amazon DynamoDB?

A

In DynamoDB, tables, items, and attributes are the core components that you work with.

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

How do tables, items, and attributes work together?

A

A table is a collection of items, and each item is a collection of attributes.

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

Describe how DynamoDB uses primary keys.

What features does the addition of secondary indexes provide you in DynamoDB

A

DynamoDB uses primary keys to uniquely identify each item in a table.
DynamoDB uses secondary indexes to provide more querying flexibility.

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

DynamoDB: What is a table?

A

A table is a collection of data.

For example, a table called People that you could use to store personal contact information about friends, family, or anyone else of interest.

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

DynamoDB: What is an item?

A

An item is a group of attributes that is uniquely identifiable among all of the other items.

In a People table, each item represents a person.

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

Items in DynamoDB are similar to ____ in other database systems.

A

Items in DynamoDB are similar to rows in other database systems.

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

DynamoDB: What are attributes?

A

Each item within a table is composed of one or more attributes.

For example, an item in a People table contains attributes like PersonID, LastName, FirstName, and so on.

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

Attributes in DynamoDB are similar in many ways to ______ or _________ in other database systems.

A

Attributes in DynamoDB are similar in many ways to fields or columns in other database systems.

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

What does it mean when someone says your table is schemaless?

A

Schemaless means that neither the attributes nor their data types must be defined beforehand. Each item can have its own distinct attributes.

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

What is an example of a nested attribute?

A

Some of the items have a nested attribute (Address). DynamoDB supports nested attributes up to 32 levels deep.

Take a look at the address in this example.

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

When you create a table, in addition to the table name, you must specify the

A

primary key of the table

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

What is the function of the primary key?

A

The primary key uniquely identifies each item in the table so that no two items can have the same key.

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

DynamoDB supports two different kinds of primary keys:

A

Simple Primary Key aka Partition Primary Key
and a Composite Primary Key

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

What are the components of a Simple Primary key?

A

A Simple primary key is made up of one attribute known as the partition key.

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

What happens if you try to add two items with the same partition key value in a table with a Simple Primary key setup?

A

No two items can have the same partition key value in a table with only a partition key. You will get an error.

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

What are the components of a Composite Primary key?

A

A Composite Primary Key is composed of two attributes:
Partition key and Sort key

22
Q

Explain how Composite Primary Key differs from a Partition Primary Key.

A

In a table that has a (Partition key and a Sort key = Composite Primary Key) it’s possible for multiple items to have the same partition key value. However, those items must have different sort key values.

23
Q

How are items in a table sorted when using a Composite Primary Key?

A

All items with the same partition key value are stored together, in ascending order by sort key value.

24
Q

What type of flexibility does Composite Primary Key give you when querying data?

A

For example, if you provide only the value for Artist, DynamoDB retrieves all of the songs by that artist. To retrieve only a subset of songs by a particular artist, you can provide a value for the Artist and a range of values for SongTitle.

25
Q

The partition key of an item is also known as its

A

hash attribute.
A partition key notes where the data will be stored in the data base

26
Q

The sort key of an item is also known as its range attribute. Where is the term range derived from?

A

The term range attribute derives from how DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

27
Q

A sort key is a way to represent what type of relationship?

A

A sort key is a way to represent a 1:many relationship

28
Q

What is the purpose of a secondary index?

A

A secondary index lets you query the data in the table using an alternate key

29
Q

DynamoDB supports two kinds of indexes:

A

Global secondary index
Local secondary index

30
Q

What are the features of a Global secondary index

A

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

31
Q

What are the features of a Local secondary index

A

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

32
Q

DynamoDB Streams is an optional feature that captures what?

A

DynamoDB Streams is an optional feature that captures data modification events in DynamoDB tables.

33
Q

DynamoDB Streams data about events that appear in the stream in near-real time and in the

A

the order that the events occurred

34
Q

If you enable a stream on a table, DynamoDB Streams writes a stream record whenever one of the following events occurs: (3)

A

A new item is added to the table:

An item is updated:

An item is deleted from the table:

35
Q

What does a DB stream capture when A new item is added to the table:

A

The stream captures an image of the entire item, including all of its attributes.

36
Q

What does a DB stream capture when An item is updated:

A

The stream captures the “before” and “after” images of any attributes modified in the item.

37
Q

What does a DB stream capture when an item is deleted?

A

The stream captures an image of the entire item before it was deleted.

38
Q

Stream records have a lifetime of __ hours; after that, period of time what happens to them?

A

Stream records have a lifetime of 24 hours; after that, they are automatically removed from the stream.

39
Q

Control plane operations let you ______ and ______ DynamoDB tables.

A

Control plane operations let you create and manage DynamoDB tables.

40
Q

What are 5 Control Pane operations aka API calls?

A

-CreateTable – Creates a new table.
-DescribeTable– Returns information about a table
-ListTables – Names of all of your tables in a list.
-UpdateTable – Modifies the settings of a table or its indexes, creates or removes new indexes on a table, or modifies DynamoDB Streams settings for a table.
-DeleteTable – Removes a table and all of its dependent objects

41
Q

Classic API for Creating data
What does ‘PutItem’ command execute?

A

Writes a single item to a table. You must specify the primary key attributes, but you don’t have to specify other attributes.

42
Q

Classic API for Creating data
What does ‘BatchWriteItem’ command execute?

A

BatchWriteItem – Writes up to 25 items to a table. Can also be used for deleting multiple items from one or more tables.

43
Q

What are Amazon DynamoDB two read/write capacity modes for processing reads and writes on your tables:

A

On-demand
Provisioned (default, free-tier eligible)

44
Q

What does the read/write capacity mode control? (2)

A

The read/write capacity mode controls how you are charged for read and write throughput and how you manage capacity.

45
Q

When can you set the read/write capacity mode on a table? (2)

A

You can set the read/write capacity mode when creating a table or you can change it later.

46
Q

When should you use on-demand pricing with DynamoDB? (3)

A

New tables with unknown workloads.
Unpredictable application traffic.
You prefer the ease of paying for only what you use.

47
Q

In a DynamoDB table, what is the upper limit on the number of distinct sort key values per partition key value?

A

There is no upper limit on the number of distinct sort key values per partition key value.

If you need to store billions of Dog names to a partition key for Dogs with a sort key names in a Pets table. Then DynamoDB would allocate enough storage to handle this requirement automatically.

48
Q

1 read capacity unit represents how many strongly consistent & eventually consistent reads per second for up to how many kbs?

A

1 read capacity unit (RCU) = 1 strongly consistent read of up to 4 KB/s or 2 eventually consistent reads of up to 4 KB/s per read.

49
Q

Transactional read requests require how many read capacity units to perform one read per second for items up to 4 KB?

A

Transactional read requests require two read capacity units to perform one read per second for items up to 4 KB.

2 RCUs = 1 transactional read request (one read per second) for items up to 4 KB.

50
Q

What happens to reads on items greater than 4kbs?

A

For reads on items greater than 4 KB, the total number of reads required = (total item size / 4 KB) rounded up.

51
Q

Write Capacity Unit: On-Demand Mode DynamoDB charges you for the writes that your application performs on your tables in terms of

A

write request units.

52
Q

2 WRUs = how many transactional write requests (one write per second) for items up to 1 KB?
For writes greater than 1 KB, total number of writes required = ?

A

2 WRUs = 1 transactional write request (one write per second) for items up to 1 KB.
For writes greater than 1 KB, total number of writes required = (total item size / 1 KB) rounded up
1 write request unit (WRU) = 1 write of up to 1 KB/s.