DynamoDB Flashcards

1
Q

Your low latency web application needs to store its session state in a scalable way so that it can be accessed quickly. Which service do you recommend? RDS DynamoDB Elastic File Store In memory on your EC2 instance

A

DynamoDB

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

Which of the following attributes would make a good Sort Key? CustomerID OrderNumber InvoiceDate EmailAddress

A

InvoiceDate

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

DynamoDB is a No-SQL database provided by AWS. False True

A

True

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

What is the difference between a Global Secondary Index and a Local Secondary Index (Choose 2) You can create a Local Secondary Index at any time but you can only create a Global Secondary Index at table creation time You can create a Global Secondary Index at any time but you can only create a Local Secondary Index at table creation time You can delete a Local Secondary Index at any time You can delete a Global Secondary Index at any time

A

You can create a Global Secondary Index at any time but you can only create a Local Secondary Index at table creation time You can delete a Global Secondary Index at any time

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

n DynamoDB, a scan operation is used for which of the following? Return the entire contents of a table Return the entire contents of a table filtered on the Primary Key attribute Find items in a table based on the Sort Key attribute Find items in a table based on the Primary Key attiribute

A

Return the entire contents of a table

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

In terms of performance, a scan is more efficient than a query. False True

A

False

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

Which of the following services provides in-memory write-through cache optimized for DynamoDB? Elasticache DAX CloudFront Read-replica

A

DAX (DynamoDB Accelerator)

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

By default, a DynamoDB query operation is used for which of the following? Return the entire contents of a table filtered on the Primary Key attribute Find items in a table based on the Primary Key attribute Return the entire contents of a table Find items in a table based on the Sort Key attribute

A

Find items in a table based on the Primary Key attribute

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

What is the API call to retrieve multiple items from a DynamoDB table? BatchGet GetItems BatchGetItem BatchGetItems

A

BatchGetItem

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

Using the AWS portal, you are trying to Scale DynamoDB past its preconfigured maximums. Which service can you increase by raising a ticket to AWS support? Provisioned throughput limits Global Secondary Indexes Item Sizes Local Secondary Indexes

A

Provisioned throughput limits

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

Which of the following attributes would make a good Partition Key? Size ProductType ProductID WarehouseLocation

A

ProductID

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

You have an application which reads 80 items of data every second. Each item consists of 3KB. Your application uses eventually consistent reads. What should you set the RCU read throughput to? 60 RCU 80 RCU 20 RCU 40 RCU

A

40 RCU

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

You have an application that needs to read 25 items of 13KB in size per second. Your application uses strongly consistent reads. What should you set the read throughput to? 10 25 100 50

A

100

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

Which of the following are recommended ways to optimise a query or scan in DynamoDB? (Choose 2) Set your queries to be eventually consistent Reduce the page size to return fewer items per results page Run parallel scans Filter your results based on the Primary Key and Sort Key

A

Reduce the page size to return fewer items per results page Run parallel scans

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

Your application is storing customer order data in DynamoDB. Which of the following pairs of attributes would make the best composite key to allow you to query DynamoDB efficiently to find a customer order that was placed on a specific day? CustomerID + ProductCategory CustomerID + ProductID CustomerID + Size CustomerID + OrderDate

A

CustomerID + OrderDate Sorry! To find an order placed on a specific date, use CustomerID and OrderDate as the composite key

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

What does the error “ProvisionedThroughputExceededException” mean in DynamoDB? Your EC2 instance has run out of CPU or memory The DynamoDB table is unavailable. The DynamoDB table has exceeded the allocated space. You exceeded your maximum allowed provisioned throughput for a table or for one or more global secondary indexes.

A

You exceeded your maximum allowed provisioned throughput for a table or for one or more global secondary indexes.

17
Q

You have a motion sensor which writes 600 items of data every minute. Each item consists of 5KB. What should you set the write throughput to? 10 50 20 40

A

50 1 write Capacity Unit allows you to write 1KB of data per second. To calculate the write capacity: 600 / 60 = 10 writes per second x 5KB = 50KB written per second Therefore 50 WCU.

18
Q

You have an application that needs to read 25 items of 13KB in size per second. Your application uses eventually consistent reads. What should you set the read throughput to? 50 RCU 10 RCU 25 RCU 100 RCU

A

50 RCU Each Read Capacity unit represents 1 x 4KB Strongly Consistent Read. 13KB / 4KB = 3.25 rounded up to 4 multiply by 25 = 100 which gives you the figure for Strongly consistent reads. Divide that by 2 for Eventually consistent. So the answer is 50 RCU.

19
Q

Your application is storing customer order data in a DynamoDB table. You need to run a query to find all the orders placed by a specific customer in the last month, which attributes would you use in your query? The Partition Key of CustomerID and a Sort Key of OrderDate The Partition Key of OrderDate and a Sort Key of CustomerID The Partition Key of OrderDate and Sort Key of CustomerName A composite Primary Key made up of the CustomerName and OrderDate

A

The Partition Key of CustomerID and a Sort Key of OrderDate CustomerName is unlikely to be a unique value in the database, CustomerID is a better choice as will be a unique value. To identify all the orders placed in the last month by a customer, use OrderDate as the Sort Key.

20
Q

You are running a query on your Customers table in DynamoBD, however you only want the query to return CustomerID and EmailAddress for each item in the table, how can you refine the query so that it only includes the required attributes? Use a scan operation instead Run a query based on the Primary Key and filter the results using a Sort Key of EmailAddress Create a Global Secondary Index which only includes the attributes you need and run the query on the Global Seconday Index Use the ProjectionExpression parameter

A

Use the ProjectionExpression parameter