DynamoDB Flashcards

This deck aims to help retain concepts related to the DynamoDB service. (97 cards)

1
Q

What AWS service provides a serverless, NoSQL database ideal for modern application development, with no cold starts, version upgrades, maintenance windows, patching, or downtime?

A

Amazon DynamoDB

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

What is the value of a Write Capacity Unit (WCU) in AWS DynamoDB?

A

One WCU allows for one write per second for an item up to 1KB (rounds to nearest whole)

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

What is the value of a Read Capacity Unit (RCU) in AWS DynamoDB?

A

One RCU allows for one strongly consistent read operation per second, or two eventually consistent read operations per second for an item up to 4KB (rounds to nearest whole)

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

Which DynamoDB feature allows multiple application workers to scan segments of a table or secondary index in parallel?

A

Parallel Scan

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

What actions can be taken to improve application performance when interacting with a DynamoDB table?

A
  • Use queries instead of scans
  • Use parallel scans (if have to)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the following AWS CLI command do for DynamoDB?

aws dynamodb create-table \ --table-name Customers \ --attribute-definitions \ AttributeName=ID,AttributeType=N \ AttributeName=Name,AttributeType=S \ --key-schema \ AttributeName=ID,KeyType=HASH \ AttributeName=Name,KeyType=RANGE \ --provisioned-throughput \ ReadCapacityUnits=10,WriteCapacityUnits=5

A

Creates a Customers table with ID (number) as the partition key and Name (string) as the sort key, along with provisioned throughput of 10 RCUs and 5 WCUs

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

What DynamoDB feature allows you to retrieve only specific attributes of an item?

A

Projection Expression

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

Which DynamoDB feature can prevent the creation of an item if it already exists or inhibit updates based on a specific condition?

A

Conditional Expressions

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

What parameter should be included in an AWS DynamoDB query to indicate the total read capacity consumed?

A

ReturnConsumedCapacity: TOTAL

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

What property ensures that the most up-to-date data is returned when retrieving an item from AWS DynamoDB?

A

ConsistentRead = true during the GetItem operation

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

What AWS DynamoDB operation retrieves attributes of one or more items from one or more tables and allows multiple Partition Key values in a single request?

A

BatchGetItem

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

When querying AWS DynamoDB with Conditional Expressions, what parameters are required?”

A
  • key condition expression (a string determining items to read)
  • partition key name and value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What AWS DynamoDB feature can be used to create backups of your tables?

A

On-demand Backup

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

Which AWS DynamoDB operation allows grouping multiple actions into a single all-or-nothing transaction?

A

TransactWriteItems

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

Given the requirements of reading 60 items per second (6KB each) and writing 80 items per second (1.5KB each), how do you calculate the required RCUs and WCUs for AWS DynamoDB table?

A

To calculate RCU:
1. Item size / RCU value = 6 KB / 4 KB = 1.5 round to nearest whole = 2 RCU per item
2. Reads per second * RCU per item = 60*2 = 120 RCU

To calculate WCU:
1. Item size / WCU value = 1.5 KB / 1 KB = 1.5 round to nearest whole = 2 WCU per item
2. Writes per second * WCU per item = 80 * 2 = 160 WCU

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

How does DynamoDB Accelerator (DAX) handle strongly consistent reads with AWS DynamoDB?

A

For strongly consistent read requests, the DAX cluster passes all requests to DynamoDB without caching

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

What is an efficient way to delete all data from DynamoDB table with minimal costs?

A

Delete the table and then re-create it using the DeleteTable operation

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

How can you prevent write throttling when using a Global Secondary Index (GSI) in Amazon DynamoDB?

A

Ensure the provisioned write capacity of the GSI is equal to or greater than that of the base table, as updates write to both the table and the GSI

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

Which AWS service is a fully managed, serverless NoSQL database designed for applications requiring fast, predictable performance at any scale?

A

Amazon DynamoDB

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

What data types does Amazon DynamoDB support?

A
  • Scalar Type
  • Document Type
  • Set Type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can Amazon DynamoDB be accessed?

A

As public service, DynamoDB can be accessed:
- From public internet endpoints
- From VPC with Internet Gateway / Gateway Endpoint

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

What are the main benefits of Amazon DynamoDB?

A
  • Fully managed (no infrastructure to manage)
  • No cold starts
  • No version upgrades
  • No maintenance windows or downtime
  • No patching
  • Automatic scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What scaling modes does Amazon DynamoDB support?

A
  • Provisioned capacity (manual or auto-scaling)
  • On-demand capacity (set and forget)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the resiliency posture of Amazon DynamoDB?

A
  • Highly available and durable across multiple Availability Zones
  • Optional global replication for multi-region resiliency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the typical response latency of Amazon DynamoDB?
Single-digit millisecond latency (SSD-backed storage)
26
What additional features does Amazon DynamoDB provide?
- Backups - Point-in-time recovery - Encryption at rest
27
What are the pricing components of Amazon DynamoDB?
- Read Capacity Units (RCU) - Write Capacity Units (WCU) - Storage and optional feature charges - Reserved capacity
28
What is the logical grouping of data called in Amazon DynamoDB?
Table
29
What is a single object within a DynamoDB table called?
Item
30
What is the maximum number of items allowed in a DynamoDB table?
There is no limit
31
What is the size limit for an item in Amazon DynamoDB?
Maximum 400 KB (includes primary key, sort key, attribute names, and values)
32
What does an Amazon DynamoDB item consist of?
- Primary key (Simple or Composite) - Attributes
33
What primary key types are available in Amazon DynamoDB?
- Simple primary key: partition key - Composite primary key: partition key + sort key, the PK + SK combination must be unique within the table
34
Does Amazon DynamoDB require a fixed schema for items?
No, the table does not enforce an attribute schema, items can contain different sets of attributes
35
What capacity modes can a DynamoDB table be configured with?
- On-demand capacity - Provisioned capacity
36
In Amazon DynamoDB, what does "capacity" refer to?
Provisioned throughput (read/write performance), not storage
37
What two capacity units are present in Amazon DynamoDB?
- Write Capacity Unit (WCU): 1 WCU = one write per second for an item up to 1 KB - Read Capacity Unit (RCU): 1 RCU = one strongly consistent read per second for an item up to 4 KB (or two eventually consistent reads)
38
What backup options are available for Amazon DynamoDB?
- On-demand backups - Point-in-time Recovery (PITR)
39
What are the main features of Amazon DynamoDB on-demand backups?
- Full-table backups retained until manually deleted - Restore data and table configuration in same region or cross-region - Restore with or without indexes - Encryption settings can be adjusted during restore
40
What are the main features of Amazon DynamoDB Point-in-time Recovery (PITR)?
- Can be enabled per table (disabled by default) - Continuous backups retaining 35 days of change history - Restores to a new table with 1-second granularity
41
What indicate Amazon DynamoDB is the appropriate choice?
When the requirements are: - NoSQL - Key-value storage
41
What indicates that Amazon DynamoDB is NOT a suitable choice?
When the requirements are: - SQL - Relational database
41
How can Amazon DynamoDB be accessed?
No SQL queries, uses API operations: - CLI - API - SDK
42
Which Amazon DynamoDB capacity option is designed for unknown or unpredictable workloads with minimal administration overhead?
On-demand capacity
43
Which Amazon DynamoDB capacity option is typically more expensive for steady workloads?
On-demand capacity often costs more for steady/continuous workloads and can be several times higher than provisioned
44
Which Amazon DynamoDB capacity option is configured per-table using capacity units?
Provisioned capacity, every operation consumes at least 1 capacity unit
45
What happens to a request when an Amazon DynamoDB table lacks sufficient capacity?
The request is throttled `ProvisionedThroughputExceeded`
46
What two operation types can be performed on an item in Amazon DynamoDB?
Query and Scan
47
Which DynamoDB operation accepts a partition key and optionally a sort key or sort-key range?
Query, key-based and most efficient operation
48
Which DynamoDB operation reads items sequentially across a table, consuming capacity for every item and offering full selection flexibility?
Scan, table-wide read - least efficient, but most flexible operation
49
Which Amazon DynamoDB operation supports applying arbitrary filters to items?
Scan
50
Which DynamoDB read operation checks only one replica and costs half the read capacity?
Eventually consistent read, reads from a single replica, may return stale data and uses half the RCU
50
Which architecture is used by Amazon DynamoDB storage nodes?
Leader–follower architecture, data is replicated across storage nodes in multiple AZs
50
What architectural guideline improves DynamoDB performance and cost when designing items?
Keep items small and retrieve only required attributes
51
Which DynamoDB read operation reads from the leader replica and returns the latest data?
Strongly consistent read, queries the leader replica and returns up-to-date data
52
Given 10 writes per second and an average item size of 2.5 KB, how many Write Capacity Units (WCU) are required for an Amazon DynamoDB table?
1. ceil average item size (2.5 KB) divided by 1 WCU (1 KB) - ceil(2.5 / 1) = 3 2. Multiply required WCU per item (3) by writes per second (10) - 3 × 10 = 30 30 WCU is required to fulfill the requirement Note: Transactional writes consume 2× WCU
53
Given 10 reads per second and an average item size of 2.5 KB, how many Read Capacity Units (RCU) are required for an Amazon DynamoDB table?
1. ceil average item size (2.5 KB) divided by 1 RCU (4 KB) - ceil(2.5 / 4) = 1 2. Multiply required RCU per item (1) by reads per second (10) - 1 × 10 = 10 10 RCU is required to fulfill the requirement for strongly consistent reads 5 RCU is required for eventually consistent reads (10 / 2)
54
What is the most efficient operation within Amazon DynamoDB?
Query
55
What data is required for a Query operation in Amazon DynamoDB?
Partition key (PK) and optionally a single or range of sort keys (SK)
56
What Amazon DynamoDB component allows creating an alternative view on a table using the same partition key (PK) but a different sort key (SK)?
Local Secondary Index (LSI)
57
What type of secondary index cannot be added after table creation in Amazon DynamoDB?
Local Secondary Index (LSI) - must be created at the same time as the table
57
What Amazon DynamoDB component allows creating an alternative view on a table using using a different partition key (PK) and sort key (SK)?
Global Secondary Index (GSI)
58
Which Amazon DynamoDB components support projections (selecting which attributes are retrieved) and influence index efficiency?
- Local Secondary Index (LSI) - Global Secondary Index (GSI)
59
What type of secondary index can be added after table creation in Amazon DynamoDB?
Global Secondary Index (GSI) - can be created or deleted at any time
60
What is the maximum number of Local Secondary Indexes (LSIs) that can be defined per table in Amazon DynamoDB?
Up to 5 LSIs per table
61
What is the maximum number of Global Secondary Indexes (GSIs) that can be defined per table in Amazon DynamoDB?
Up to 20 GSIs per table
62
Which secondary index type shares capacity with the base table in DynamoDB?
Local Secondary Index (LSI)
63
Which secondary index type has its own capacity in DynamoDB?
Global Secondary Index (GSI)
64
What projection options are available for secondary indexes in Amazon DynamoDB?
`ALL`, `KEYS_ONLY`, and `INCLUDE`
65
Which secondary index type in Amazon DynamoDB is always eventually consistent?
Global Secondary Index (GSI)
66
What is the rule of thumb when choosing a secondary index type in Amazon DynamoDB?
- Use Global Secondary Indexes (GSI) by default - Use Local Secondary Indexes (LSI) only when strong consistency is required
67
What are Amazon DynamoDB indexes designed for?
To support alternative access patterns
68
What feature of Amazon DynamoDB provides a time-ordered list of item change events with a 24-hour rolling window?
DynamoDB Streams
69
When DynamoDB Streams is enabled on a table, which change events are recorded?
Item creation, item update, and item deletion
70
When enabling DynamoDB Streams, which settings control what data appears in the stream?
View setting: - KEYS_ONLY - partition and sort key - NEW_IMAGE - item after change - OLD_IMAGE - item before change - NEW_AND_OLD_IMAGES - both items, before and after change
71
Which AWS service is commonly used with Amazon DynamoDB Streams to react to table data changes?
AWS Lambda
72
What Amazon DynamoDB feature provides multi-master, cross-region replication of tables?
DynamoDB Global Tables
72
What are common use cases for Amazon DynamoDB Streams?
Reporting and analytics, data aggregation, messaging and notifications
73
What conflict-resolution strategy do DynamoDB Global Tables use?
Last-writer-wins
74
What is the replication delay between regions when using Amazon DynamoDB Global Tables?
Sub-second replication (typically milliseconds)
75
Are strongly consistent reads available with DynamoDB Global Tables?
Strongly consistent reads ONLY within the same region as the write; cross-region reads are eventually consistent
76
How is Amazon DynamoDB Global Tables enabled?
1. Select the base table in one region 2. Add replica tables in other regions via the Global Tables configuration 3. Multi-master cross-region replication is established
77
What are use cases for implementing Amazon DynamoDB Global Tables?
- Global high-availability applications - Low-latency global data access - Global disaster recovery and business continuity
78
Which fully managed, highly available in-memory caching service for Amazon DynamoDB provides microsecond-level read latency for read-heavy applications?
Amazon DynamoDB Accelerator (DAX)
79
Is Amazon DynamoDB Accelerator (DAX) a public service like Amazon DynamoDB?
No, DAX is a private service that is deployed and operates within a VPC
79
What software must be installed on the application to interact with Amazon DynamoDB Accelerator (DAX)?
The DAX SDK, which provides seamless integration and reduced complexity when accessing the DAX cluster
80
Is Amazon DynamoDB Accelerator (DAX) highly available?
Yes, DAX can be deployed across multiple AZs within a VPC to ensure high availability and fault tolerance
81
What does an Amazon DynamoDB Accelerator (DAX) cluster consist of?
A primary node that handles read and write operations, and one or more read replica nodes that serve read requests
82
How is Amazon DynamoDB Accelerator (DAX) accessed in cluster mode?
Through a cluster endpoint that automatically load balances requests across nodes (simlar to RDS)
83
How fast is Amazon DynamoDB Accelerator (DAX)?
- On a cache hit, results are returned in microseconds - On a cache miss, results are returned in single-digit milliseconds and then cached for future reads
84
What caching strategy is used by Amazon DynamoDB Accelerator (DAX)?
Write-through caching strategy - data is written to the cache at the same time it’s written to Amazon DynamoDB
85
What two types of caching are supported by Amazon DynamoDB Accelerator (DAX)?
- Item Cache: Caches individual items retrieved by `GetItem` or `BatchGetItem` operations (using PK or PK + SK) - Query Cache: Caches collections of items retrieved by `Query` or `Scan` operations, along with the parameters used in those operations
86
What are the main benefits of Amazon DynamoDB Accelerator (DAX)?
- Faster reads (single-digit millisecond to microsecond latency) - Reduced costs (lower RCU and WCU consumption) - Supports both horizontal and vertical scaling (larger or more instances) - Deployed within a VPC (private service)
87
What Amazon DynamoDB feature allows defining a per-item timestamp for automatic item deletion?
DynamoDB TTL
88
How does the Amazon DynamoDB TTL feature work?
1. A per-partition process periodically compares the current time with the TTL attribute value 2. Items with a TTL value older than the current time are marked as expired (still queryable until deletion) 3. A background process scans expired items and removes them from tables and indexes; a delete event is sent to DynamoDB Streams if enabled
89
How much does it cost to use the Amazon DynamoDB TTL feature?
There is no additional charge for TTL, and it does not impact table performance
90
Can Amazon DynamoDB Streams capture TTL-based deletions?
Yes, TTL deletions can trigger Streams events, which are available for 24 hours window