AWS DynamoDB Flashcards

1
Q

What type of database is DynamoDB

A

It is a key/value store, but it, not 100% true as the value can be more complex like JSON.

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

Can you have a secondary index?

A

Yes

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

Is DynamoDB deployed to a server or cluster?

A

No, it is a managed service from AWS you consume it as a service and scaling is performed automatically by AWS

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

Is DynamoDB a NoSQL database?

A

Yes, it is a NoSQL database.

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

Can I have joines in DynamoDB?

A

No, this database is a NoSQL key-value/document DB

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

Is DynamoDB encrypted by default for data at rest?

A

Yes

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

Is DynamoDB a schemaless database?

A

Yes unlike SQL thereis schemes, DynamoDSB is not.

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

Can I use my own customer managed key?

A

Yes you can use CMK

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

What does one read capacity unit represent?

A

It represents on strong consistent read or two eventual consistent reads, per 4K read. If you read over 4K then dynamoDB will consume one or more read unity.

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

What is a table in DynamoDB?

A

It a collection of items

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

What is an item in DynamoDB?

A

It is a uniquely identifiable collection of attributes.

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

What is an attribute in DynamoDB

A

Each items is composed of one or more attributes with atribute been a PersonID, LastName, FirstName.

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

Is a primary key on an attribute?

A

No, th eprimary key is on the item, this is a unique idenifier.

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

Can I create a backup of a DynamoDB table?

A

Yes, in the console, API or CLI.

You can restore from the backup.

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

When restoring from a DynamoDB backup, can I restore to the same table?

A

Yes, enter same table name for the restore

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

When restoring from a DynamoDB backup, can I restore to a different table?

A

Enter a different table name

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

With DynamoDB can I reserve storage capacity?

A

No as with storage you pay for only what you use as you use it.

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

I have a consistent known number of read/write capacity units I use 24/7/365, what can I do to save on cost?

A

I can purchase reserved capacity for both read and write, this can be for 1 - 3 years.

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

When you delete a table, are backups automatically deleted?

A

No.

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

Are DynamoDB tables encrypted at rest by default?

A

Yes, but you have the option to switch off encryption.

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

What is the default read and write capacity units?

A

5 x 5

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

Is DynamoDB handled at a database with a collection of tables or individual tables?

A

Individual tables, for example, when you want to copy all tables belong to your app, you have to do it per table. All configs are per table.

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

When you perform a write to DynamoDB, is the data written to another AZ?

A

Yes, in fact, it is written to a min of 3AZ.

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

When I preform a eventual consistant read on DynamoDB, am i geeteting the last write to the DB table?

A

No, reading again may give you different result.

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

When I preform a strong consistant read on DynamoDB, am i geeteting the last write to the DB table?

A

Yes you are geteting the most recent write to the DB table.

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

I ahve a laptop dev environmet and I wnat to develop again DynamoDB, what options do i have?

A

You have the ability to use the offline dev version of dynamodb

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

What is a DynamoDB table?

A

It is a collection of items

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

What is a DynamoDB item?

A

It is a colection of attributes.

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

Is DynamoDB a columer DB?

A

No is is a key-value and document DB.

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

What is the DynamoDB partation/has key?

A

This is the ley used on a table to distrubute the date and and is used to get access to the data.

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

What is a DynamoDB range key?

A

This key is used for searching, you can have ==, >, =, >=, “begines width”, “between”

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

When I prefrom a write to DynamoDB, is all the writes to the three AZ’s synchrous?

A

No, they are eventual consistant

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

When I preforma a write to DynamoDB, how long will it take for the data to becomes consistant?

A

about 1sec.

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

What size is a read/write capacity unit?

A

4K

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

How is DynamoDB priced?

A

It is based on through put, this is with capacity units.

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

What dose a read capacity unit represent?

A

It is a single read of a 4K bloock of data using strong consistancy.
Or, two consistant reads.

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

If I have a 8K block of data, how may capacity units will it take to read that data using strong consistancy?

A

2, as there will be 8K and this is tow 4K rreads.

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

I have fluctation read and write on my DynamoDB table, what cna I do to ensure I pay the minium?

A

Enable autoscaling and configure min and max. Or enables on-demand and pay for what you use, these is a small permium cost.

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

I need to ensure that alll the data is weote to DB using ACID trancation, as DynamoDB is a No-SQL DB, dose this means thta i have to use RDS?

A

No, DynamoDB supports ACID transactions.

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

Is an attribute a single value or a key value pair?

A

It is a key value pair.

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

I have an web application that uses DyanamoDB, this application serves customers in both the usa and ireland, I wnat to ensure that both sets of locations get service, I need a single db, what options do I have?

A

You can use DynamoDB global table to create a table in a second region.

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

I am currrently using provisioned capacaity unity, I have spily workloads, what are my options?

A

you can switch to on-demand where you only pay for what you use, but you also pay a surge charge. Or you can swithc to auto scaling.

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

What is strong consistancy?

A

When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation. The response might include some stale data. If you repeat your read request after a short time, the response should return the latest data.

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

What is evantual strong?

A

When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. A strongly consistent read might not be available if there is a network delay or outage. Consistent reads are not supported on global secondary indexes (GSI).

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

Where will DyanamoDB store data?

A

In partations.

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

Where are partations stored?

A

They are stored on SSD and replicated across multipal AZ’s in the same region.

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

How will DynamoDB know where to find you data when you ask for it?

A

It used the partation key (hash) to locate the partation where the data is stored. You can alos use partatuion key and a sort key, data is stored in a partation and ordered by the sort key.

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

What application types is DyanamoDB good for?

A

Web-scale workloaded like,

  • gaming
  • media sharing
  • IoT
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

I need ot have DyanamoDB backed up, how can I have this preformaned?

A

Ypu can enable point in time backups of the table. You cna also take an on-demand backup of the database.

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

I need to take a backup of the database for long term retention of a year, will point in time backup work for me, if not what other options do i have?

A

you can use point in time backups as you only get 35 days retention time. You cna use ondamand backupps. to storage a backup for long periods.

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

I have a dynamodb table with items, can I add a global table?

A

No the global table can only be added while these is no items in the table.

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

My ORG has a policy for encryption at rest, what DynamoDB options do I have?

A

Enable encryption on the DynamoDB table and use one of the following encryption keys methods,
- AWS owned CMK
AWS managed CMK Key is stored in your account and manged by KMS.

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

I need to make changes across 3 DynamoDB tables and have ACID transactions, what options do I have?

A

DynamoDB has transactions, you can group Put, Delete or Updates into a single group to be executed in all or nothing ACID transaction.

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

I require a database using query and index but not joins, what are my best options?

A

As you do not need joins, DynamoDB has what you need.

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

I required joins and need a fixed schema, what is my best option is it DynamoDB?

A

Do not use DynamoDB as it is not designed for joins, RDS may be a better option.

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

What is the use case for DynamoDB?

A
Highly available, scalable, no joints required, suited for  -mobile apps
-gaming
-digital
shopping cart
- web session managment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

I need complex joints in my relational data, is DynamoDB a good option?

A

No, joins or relationship data is not somethingDynamoDB dose very well, RDS is a better option here.

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

I want to store blob data in DynamoDB, why is this not a good idea?

A

You pay for each 4K read, blob data tends to be large, S3 is a better option here for blob data.

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

Is DynamoDB a good option for applications already wrote?

A

No, RDS is a better option.

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

By default is DynamoDB strongly consistent where you get back the last write?

A

No, by default DynamoDB is eventually consistent.

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

Is Dynamo DB global or regional service?

A

DynamoDB is a regional service unless you configure replication your data stays in that region.

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

What is a DynamoDB Item?

A

It is much like a traditional DB

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

I wnat to configure Dynao

DB nodes so I have my masters and slaves in a single region, how can I configure this?

A

You can, DynamoDB is 100% service with no nodes, its has capacity units you can use to govern read/write capacity.

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

What is the only mandatory requirement in an item (table)?

A

It is the primary key, the rest of the data has no structure (schema)

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

What is the max size of an item?

A

400KB

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

How much data can I write with 1 write capacity unit?

A

1KB

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

How much data can I read with a 1 read capacity unit?

A

4KB

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

I have an item (table) with 25 attributes (fields), and the item is 12KB in size, I read an attribute that is 30 bytes in size, how many capacity units do I use?

A

You are reading the 30 bytes, but Dynamo only allows you to read a complete item, in our case, the item is 12KB in size so you will have read 12KB and as each capacity unit for reading is 4KB you will have used 3 capacity units.

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

I do a search and return 3 12KB tables, how may read capacities do I use?

A

9, you use 9 because each item is 3 capacity units

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

I do a search and return 3 10byte tables, how may read capacities do I use?

A

3, each item is 10 bytes and you can only consume a whole read capacity unit so you will consume 3 1KB capacity units.

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

Do filers reduce the items with regard to capacity units read?

A

No, thye only filters the results, you will still use the read capacity units.

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

Should I use queries or scans?

A

You should use query as scenes are expensive as it reads every item in the database.

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

Can I have duplicate primary keys in a table?

A

No, primary keys have to be unique.

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

For DynamoDB, what is the only mandatory requirement for a table?

A

To have a primary key.

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

What is the max size of an item?

A

400KB

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

What is contained in a Table?

A

Items

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

What is contained in an Item

A

Attributes, primary key and sort keys.

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

What are a partition and a primary key and a hash key?

A

They are the same thing, they are used for and where to store the data in the partitions.

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

Can I have two items in a table with the same primary key?

A

No, it has to be unique.

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

What are you billed for in DynamoDB?

A

The sum of all the dat in the database and ale R/W throughput.

81
Q

What is R/W capacity?

A

When you read item dat by query or by scan you will consume a read unit for each 4K block of data. When you write tan item or attribute, each 1K block of dat is written is a write unit.

82
Q

What are the two modes of capacity?

A

On-demand

Provisioned

83
Q

If I have a table with an item and that item has 10 bytes as a string primary key, if I read it how many capacity units will I consume?

A

one because of even tho you only read 10bytes, you can not consume a partial capacity unit.

84
Q

I require a DynamoDB with 100GB of data, what will the read/write capacity be?

A

10,000 Write

30000 Read

85
Q

If I have 20GB of data, how many partitions do I have?

A

Two

86
Q

If I have one partition and I add a 1K write capacity units, how many partitions do I have?

A

two, one will be added for each 1K write capacity

87
Q

If I have one partition and I add a 3K read capacity units, how many partitions do I have?

A

two, one will be added for each 3K write capacity

88
Q

When I add a partition to my DynamoDB, can I remove it if not used?

A

No

89
Q

Where I am using provisioned capacity units and I grow the data, what happens to my read and write capacity for each partition?

A

It is reduced as the overall r/r capacity is split between all partition for my data.

90
Q

What is the table capacity unit buffer?

A

Where I am using provisioned capacity units and I grow the data, what happens to my read and write capacity for each partition?

91
Q

I have a DynamoDB in production, I wnat to create a local secondary index, what is the process for doing this?

A

You cna only create a secondry index at the table creation time.

92
Q

I have a DynamoDB table in production, I see issues from the developers needing to be able to query on another attribute in the database, how can I solve this?

A

You will have to create a global secondary index.

93
Q

When creating a secondary index, why are you projecting attributes?

A

When you perform a read with this secondary index, you can only read any projected attribute.

94
Q

I wnat to query no primary key value, what is my most efficient option?

A

Create a global secondary index.

95
Q

What is the consistency model for DynamoDB

A

It is the eventual consistent. and immediate consistency, you get to choose based on the operation.

96
Q

How much of capacity does an eventually consistent operation use?

A

Where I am using provisioned capacity units and I grow the data, what happens to my read and write capacity for each partition?

97
Q

Can I perform a backup of the DynamoDB,?

A

Yes

98
Q

Where is the data stored for a backup of dynamodb?

A

In s3

99
Q

When doing a backup of DynamoDB table, what will be stored?

A

The data, and table configuration, you will be able to restore the Table 100%.

100
Q

I have a requirement to be able to recover from a point in time during normal operation of my DynamoDB table, what functionality do I need to enable?

A

You need to enable Point-in-time recovery

101
Q

My organization mandate that we need to need to have all data encrypted at rest and in transit, what do I need to do for DynamoDB

A

For DynamoDB, encryption is not enabled by default for data at rest, you can enable encryption. Data in transit used HTTPs with TLS, so it is encrypted.

102
Q

When enabling data at rest encryption for DynamoDB, , what options do I have for keys?

A

You cna use server-side encryption using AWS CMK or KMS customer master key.

103
Q

I need to perform an atomic operation in DynamoDB, is this possible/?

A

Yes, DynamoDB has Transactions.

104
Q

I wnat to add monitoring of my DynamoDB table, how cna I do this?

A

DynamoDB emits metrics to CloudWatch.

105
Q

Can I have reserved capacity on DynamoDB?

A

You can purchase reserved capacity

106
Q

I am concerned about DynamoDB to spend and I wnat to place a cap on, I understand this may affect performance, what can I do?

A

Make sure I am using provisioned capacity units, as the capacity will be spread over all partitioned data.

107
Q

What is a DynamoDB stream?

A

They are streams of timed ordered and partitioned changelog

108
Q

How can you access DynamoDB streams?

A

You cna use Lambda, Kinesis Client Library, API

109
Q

What is a DynamoDB trigger?

A

This is where an item changes in the DynamoDB and a trigger fires and lambda is called.

110
Q

When you wnat to enable triggers for DynamoDB, what else do you need to enable?

A

Streams, streams are required to be enabled, you also defined in streams the type of data you wnat send to the trigger, like now and the old item or just new.

111
Q

I wnat to have a DynamoDB item expire automatically, what is my best option?

A

Use TTL, TTL enables you to have items expire automatically based on dat time.

112
Q

What is a GlobalTable?

A

It is a master/master replication.

113
Q

I have a table full of dat and I wnat to create a global table, how cna I do this?

A

You can, tables have to be empty

114
Q

I wnat to create a distributed version of DynamoDB table across multiple regions, I wnat to be able to read and write in both regions, what options do I have?

A

You can create your DynamoDB table in region 1 and then create a global table in a second and third region. This has to be done when there is no data in the table.

115
Q

I need to be able to monitor what is happening in my DynamoDB form an R/W capacity, what options do I have?

A

DynamoDB is integrated with ClopudWatch.

116
Q

I am creating a mobile application and I wnat direct access to an online database, I have identified I would like to use DynamoDB, is it possible and how could I configure this?

A

Yes, you can use web federation with cogneto and then use the filed graned access control policies on the DynamoDB table to allow or deny GetItem, PutItem, etc.

117
Q

What are triggers used for in DynamoDB?

A

You use triggers to enable code to be called with the DynamoDB table is updated. You have to set up streams to enable this and make a stream config for new, old, new + old items to be sent as part of the trigger.

118
Q

I am concerned about the recovery of my DynamoDB in the event of database corruption, what options do I have and how cna I configure it?

A

DynamoDB has a backup feature that stores the table for up to 35 days, in S3 stores in the region, both the table and logs are backed up so you can recover to any point.

119
Q

How cna I set up a schedule to backup my DynamoDB?

A

DynamoDB has no scheduled task for DB backup, you have to create a chron job.

120
Q

When creating DynnamoDB in multi-regions, is it master/slave or master/master.

A

Master/Master

121
Q

In DynamoDB what are the sizing values of a partition table?

A

10GB
1K Write
3K Read

122
Q

Can I have duplicate primary keys?

A

No, it has to be unique.

123
Q

What is the max size of an item?

A

400KB

124
Q

What is a multipart primary key and how is it used?

A

A primary key cna have a sort key, both can be used to select an item form DynamoDB table.

125
Q

How many times is data replicated across the regions for data durability?

A

It is not, data is only replicated to 3 separate facilities within the same region.

126
Q

How many times is data replicated in the same region for DynamoDB table?

A

three, data is sync replicated to three separate facilities in the same region.

127
Q

We have to add 10M new customer to our DynamoDB, what do I need to configure to increase capacity?

A

I do now need to do anything, DynamoDB scales horizontally

128
Q

Explain the consistency model for accessing a DynamoDB table?

A

These are two models for reading data, eventual and strong. Eventual means you may get a copy of old data, strong means you will get the latest data. Eventual used half the read capacity unity that would have been used for strong consistency.

129
Q

Can you perform strong consistent ready on the secondry index?

A

Query operations cannot perform strongly consistent reads on Global Secondary Indexes

130
Q

What is DybamoDB FGAC?

A

This is the filed graned access control, this is a policy attached to a table to enable you to control access, this policy can be used with cognate (web identity) or AWS IAM.

131
Q

Is data in transit encrypted?

A

Yes.

132
Q

What encryption algorithm is used for encrypting DynamoDB?

A

AES256

133
Q

Which of the following are use cases for Amazon DynamoDB? Choose 3 answers

  • Storing BLOB data.
  • Managing web sessions
  • Storing JSON documents
  • Storing metadata for Amazon S3 objects
  • Running relational joins and complex updates.
  • Storing large amounts of infrequently accessed data.
A
  • Storing BLOB data. (NO)
  • Managing web sessions (YES)
  • Storing JSON documents (YES)
  • Storing metadata for Amazon S3 objects (YES)
  • Running relational joins and complex updates.(NO)
  • Storing large amounts of infrequently accessed data. (NO)
134
Q

if you use more read capacity they you have allocated what will happen to the requests?

A

You will be throttled, but your request will be serviced and you will not receive an error.

135
Q

What is the read and write capacity unite size?

A
Read = 4K
Write = 1K
136
Q

What is the difference between sort and filter on capacity unity?

A

The sort will reduce the data returned and also the data that is touched and as such the number of read capacity units used. The filter just filters after the dat is returned and does not save on read capacity units.

137
Q

If I have a write contention issue with DynamoDB, what is the best way to solve it?

A

Use DynamoDB Autoscaling. Possible other option is to use SQS.

138
Q

When you read an attribute in an item, what are you paying for?

A

You pay for all the attributes in the item. In other words, you pay for the whole item, not just the attribute you want.

139
Q

What am I paying for in DynamoDB?

A
  • Paying for storage

- Read/Write capacity

140
Q

If I write 1byte of data to DynamoDB, how much of a capacity unit will I use?

A

You will use a 1KB capacity unit and be changed for the 1KB unit.

141
Q

If I read 1byte of data from DynamoDB, how much of a capacity unit will I use?

A

You will use a 4KB capacity unit and be changed for the 4KB unit.

142
Q

If I read 16KB of data form DynbamoDB, what am I charged for?

A

You are charged for 4 x 4KB read capacity units

143
Q

If I read 2KB of data form DynbamoDB, what am I charged for?

A

You will have used 1/2 of a 4K read capacity unit but you will be charged for the whole capacity unit

144
Q

How can I ensure I keep cost at a min when querying DynamoDB?

A

Use the sort key to only return the items you need. This way you only pay for the returned items.

145
Q

If I am adding a filter to my query, will this reduce the cost?

A

No, the filter is applied after the results are returned and you pay for every item in the results before the filter.

146
Q

Do I use the sort key to filter to reduce cost and why?

A

The sort key, soft key limits the returned items, the filter is applied after the results are returned.

147
Q

What do I pay for when using scans?

A

Every item returned, there is no sort key and only filters and as we know filters are applied after the data is returned so you end up paying for every item.

148
Q

What do I pay for when using scans + filters?

A

Every item returned, there is no sort key and only filters and as we know filters are applied after the data is returned so you end up paying for every item.

149
Q

Why do I have to be very careful when using scan from a cost perspective in DynamoDB?

A

Because scan is going to go through every item in the table and return it even if you have the filter you will be paying for every item in the table.

150
Q

Should I be using scans or queries?

A

Queries as they only return the items you filter by the sort key.

151
Q

If I have one table and one partition and I now got to 15GB of storage in my table what will happen?

A

Each partition can only hold 10GB, another partition is created for the table.

152
Q

If I allocate 10K write capacity unity, what will this cause my partitions to do?

A

Spread to 10 partitions, 1 (1K) partition for each of the IK writes.

153
Q

If I have 6K read capacity units, how many partition tables will I have?

A

You will have 2, Each partition gives you 3K read capacity units.

154
Q

Can I create a local secondary index after the table is created?

A

No, but you can create a global secondary index.

155
Q

I wnat to query based on another attribute, how should I do this, with a scan, keep cost low?

A

Create a local or global secondary index and use it sort key

156
Q

Explain how the global secondary index shares the read and write capacity units off the table?

A

The global secondary index does not share the read and write capacity of the table, it gets an allocation of its own.

157
Q

What is the primary key mead up of?

A

The primary key and the sort key

158
Q

I need a no-SQL DB like DynamoDB, I also need it to write and read consistent, is DynamoDB a good selection?

A

Could be? DynamoDB is eventually consistent but with the option for constant, an eventually consistent read uses half the write capacity compared to a consistent read that will use the full read capacity unit

159
Q

I write data to DynamoDB and read it straight away, am I guaranteed to get the data I just wrote?

A

No, unless you opt to use a consistent read and this will use a full read capacity unit, other than that you an eventually consistent read.

160
Q

I wnat to back up DynamoDB, what is my option and how does it work?

A

You can backup to s3 and restore from S3

161
Q

When I do a table backup, where is it stored and is the metadata for the table such as the config also stored?

A

In s3 and yes metadata (config) is also stored and can be restored when needed.

162
Q

Does DynamoDB support point in time backup, explain?

A

Yes, for a table you can enable point in time backups

163
Q

When using table point in time recovery, what is the retention period?

A

35Days

164
Q

My org has a encrypt data at rest policy, what option do I have with DynamoDB?

A

You can select to encrypt the DynamoDB table using AWS owned CMK or your own CMK.

165
Q

DynamoDB is a no-sol database, I need to ensure I select a database with transactions, is DynamoDB a good option?

A

Yes, DynamoDB has transaction capabilities.

166
Q

I know I am consistently using a number of reads and write capacity units and will be over the next 3 years, how can I lower my cost?

A

DynamoDB allows you to reserve read and write capacity units.

167
Q

What are the 3 capacity modes available to DynamoDB?

A
  • On-Demand
  • Provisioned
  • Autoscaled
168
Q

I have a workload where I need I always want max performance with no upper limit, how would I achieve this?

A

Use on-demand, where you have no upper performance limits.

169
Q

I have a workload where I need I want to set max performance, how would I achieve this?

A

Use provisioned capacity, this is where you set the exact read and write capacity units.

170
Q

I have a workload where I wnat min cost and have the DynamoDB scale up and down with the workload, I achieve this?

A

Use auto-scaling where you get to set the min and max.

171
Q

Should I be worried about hot partitions in DynamoDB, explain?

A

No, with adaptive capacity partition can borrow capacity form other partitions when available and needed.

172
Q

When using streams what options can you chose form?

A
  • Only keys in stream
  • Entire item in the stream
  • Old items in the stream before it was modified
  • only and new items in the stream
173
Q

Explain what triggers do?

A

Triggers connect streams to a lambda function, so as you get updates in the DynamoDB table you can take action in the Lambda.

174
Q

I have a DunamoDB table for keeping stock, I wnat an alarm to be triggered when the stock falls below a min level, how can I do this?

A
  • Enable streams
  • Ensure the table has an attribute keeping track of the stock count
  • Create a trigger and lambda to check the stock level
  • Use SNS and the SNS SDK to send a notification.
175
Q

I wnat to have an item in my DynamoDB deleted after a time period, how cna I do this?

A

Use TTL, you can use TTL to delete a DynamoDB item after a period when it expires.

176
Q

I wnat to have items deleted in a DynamoDB table and also have an email sent to the operation system, how cna I do this?

A

You can use TTL to expire items, and use streams and triggers to trigger a lambda and have the Lambda use SNS SDK to send an email to topic subscribed users.

177
Q

I wnat to create a backup of my table in a separate region got DR, would I use streams for this?

A

No streams are for use with triggers, to have a table in another region, you use global tables.

178
Q

How can I have 3 DynamoDB tables, one in each region, us-east-1, us-west-1 and eu-west-1 and be able to write to all table and replicate the data between all tables?

A

DynamoDB can use the global table in the regions and any writes are async to all other tables.

179
Q

I am creating a Global table, what do have have to enable?

A
  • Streams
180
Q

I have added data to my DynamoDB table and I wnat to now add a new global table region, how cna I do this?

A

You can, once data is added to the table you can not add global table regions.

181
Q

I have a mobile application and I wnat to restrict access to the user’s own item in a DynamopDB table, is this possible?

A

Yes, IAM can be used with DynamoDB and has fine graned access to restrict the mobile user to only access the item in a table. This is done by using policy and a condition.

182
Q

I have a mobile application and I wnat to restrict access to the user’s own attribute in an item in a DynamopDB table, is this possible?

A

Yes, IAM can be used with DynamoDB and has fine graned access to restrict the mobile user to only access the attribute in an item in a table. This is done by using policy and a condition.

183
Q

I wnat to improve my read performance for DynamoDB to my users, I am thinking of a cache, I wnat it to be transparent, how and I do this?

A

Use DAX.

184
Q

What is DAX?

A

It is an in-memory cache for DynamoDB.

185
Q

I wnat DynamoDB to autoscaled my read-write capacity, is this possible?

A

Yes 100%, you can opt to have the read and write capacity scaled as required,

186
Q

Can auto-scaling be applied to a secondary index?

A

Yes 100%, just like the primary index.

187
Q

What is projection-expression?

A

It is when you only wnat certain attributes from the table, not the whole table.

188
Q

What are the two scaling models in DynamoDB

A
  • On-demand: You just consume what you need.

- Provisioned: You select the number of reading and write capacity unity. You also can set autoscaling.

189
Q

Is provisioned and on-demand capacity for DynamoDB the same cost?

A

on-demand is more expensive

190
Q

What is DynamoDB Accelerator (DAX)?

A

It is an in-memory cache for DynamoDB, improves performance by 10x read improvement.

191
Q

How do I configure DAX for write acceleration?

A

You can’t, it is for reads not writes, DAX is an in-memory cache and improves reads by 10x.

192
Q

Is DAX a SaaS or a cluster of nodes?

A

It is a cluster of nodes, you get to select the node size. (type) and the number of nodes.

193
Q

When using DAX am I connecting to DynamoDB or to DAX?

A

You are connecting to DAX and DAX is connecting to DynamnoDB, DAX has a DAX client you use to connect to DAX from your code.

194
Q

I wnat strong consistent reads and I am using DAX, is there an issue?

A

Yes, DAX will not help as the read is strongly consistent and will have to go to the DynamoDB for the requests.

195
Q

I have a write-intensive DynamoDB workload, how cna DAX help?

A

No, DAX is for read caching only.

196
Q

My application only requires millisecond response time, is DAX worth including in my solution?

A

No, DAS is good when you wnat microsecond response time.

197
Q

What is the global table?

A

A global table is two tables one in each region that is replicated.

198
Q

When using DynamoDB streams, how do I configure a lambda function to receive a stream changes?

A
  • Enable streams

- Create a trigger