DynamoDB Quiz - MCQ Questions and Answers

DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services (AWS) that offers high performance and scalability. It is commonly used for applications requiring low-latency data access at any scale. This quiz will test your knowledge of DynamoDB concepts, key features, and common use cases.

Let’s begin with these multiple-choice questions (MCQs) to test your knowledge of DynamoDB.

1. What type of database is DynamoDB?

a) Relational database
b) NoSQL database
c) Object-oriented database
d) In-memory database

Answer:

b) NoSQL database

Explanation:

DynamoDB is a NoSQL database that provides key-value and document data structures, offering scalability and low-latency performance.

2. Which company provides DynamoDB as a service?

a) Microsoft
b) Amazon Web Services (AWS)
c) Google
d) IBM

Answer:

b) Amazon Web Services (AWS)

Explanation:

DynamoDB is a managed NoSQL database service provided by Amazon Web Services (AWS).

3. What is the primary key used for in DynamoDB?

a) To store large files
b) To uniquely identify each item in a table
c) To enforce referential integrity
d) To join two tables together

Answer:

b) To uniquely identify each item in a table

Explanation:

In DynamoDB, the primary key is used to uniquely identify each item in a table. It can be a partition key or a combination of partition and sort keys.

4. What are the two types of primary keys in DynamoDB?

a) Simple key and complex key
b) Partition key and sort key
c) Foreign key and composite key
d) Private key and public key

Answer:

b) Partition key and sort key

Explanation:

DynamoDB uses two types of primary keys: the partition key (simple primary key) and the composite primary key, which is a combination of the partition key and sort key.

5. How does DynamoDB achieve high availability?

a) By storing data in a single region
b) By replicating data across multiple regions and availability zones
c) By using a single instance
d) By caching data on the client-side

Answer:

b) By replicating data across multiple regions and availability zones

Explanation:

DynamoDB achieves high availability by replicating data across multiple availability zones in the same region, and optionally across multiple regions.

6. What type of consistency model does DynamoDB provide by default?

a) Strongly consistent reads
b) Eventually consistent reads
c) Immediate consistency
d) Eventual consistency only for writes

Answer:

b) Eventually consistent reads

Explanation:

DynamoDB provides eventually consistent reads by default. However, it also offers an option for strongly consistent reads if required.

7. What is the maximum size of an item in DynamoDB?

a) 400 KB
b) 1 MB
c) 10 MB
d) 5 MB

Answer:

a) 400 KB

Explanation:

The maximum size of an individual item in DynamoDB, including all attributes, is 400 KB.

8. What does provisioned throughput in DynamoDB refer to?

a) The number of tables that can be created
b) The read and write capacity units that can be allocated to a table
c) The disk storage used for the table
d) The amount of traffic a table can handle

Answer:

b) The read and write capacity units that can be allocated to a table

Explanation:

Provisioned throughput in DynamoDB refers to the read and write capacity units that can be allocated to a table to handle specific amounts of traffic.

9. What is DynamoDB Auto Scaling used for?

a) To increase database size automatically
b) To automatically adjust read/write capacity based on demand
c) To reduce the number of tables
d) To automatically manage data replication

Answer:

b) To automatically adjust read/write capacity based on demand

Explanation:

DynamoDB Auto Scaling automatically adjusts a table's provisioned read and write capacity based on the actual workload, ensuring performance while controlling costs.

10. What does a Global Secondary Index (GSI) in DynamoDB allow you to do?

a) Modify the primary key of a table
b) Query data using an alternative key
c) Automatically back up your data
d) Archive old data

Answer:

b) Query data using an alternative key

Explanation:

A Global Secondary Index (GSI) allows you to query data using an alternative partition and/or sort key different from the primary key of the base table.

11. What is a Local Secondary Index (LSI) in DynamoDB?

a) An index that has the same partition key as the base table but a different sort key
b) An index used for global queries
c) An index for performing batch writes
d) An index for archiving items

Answer:

a) An index that has the same partition key as the base table but a different sort key

Explanation:

A Local Secondary Index (LSI) in DynamoDB has the same partition key as the base table but allows you to query data with a different sort key.

12. What is DynamoDB Streams used for?

a) Streaming video content
b) Capturing changes made to items in a DynamoDB table
c) Scaling DynamoDB automatically
d) Creating secondary indexes

Answer:

b) Capturing changes made to items in a DynamoDB table

Explanation:

DynamoDB Streams captures a time-ordered sequence of changes made to items in a table, enabling features like replication or triggering real-time events.

13. How does DynamoDB handle transactions?

a) DynamoDB does not support transactions
b) DynamoDB supports ACID transactions across multiple items and tables
c) DynamoDB supports transactions but only on a single item
d) DynamoDB handles transactions by replicating data across tables

Answer:

b) DynamoDB supports ACID transactions across multiple items and tables

Explanation:

DynamoDB supports ACID transactions, allowing multiple items across different tables to be read or written atomically in a single transaction.

14. What is the default limit on the number of tables that can be created in DynamoDB?

a) 256
b) 500
c) 256 per region
d) Unlimited

Answer:

c) 256 per region

Explanation:

The default limit is 256 tables per region in DynamoDB, but this limit can be increased by submitting a request to AWS Support.

15. What is a "provisioned mode" table in DynamoDB?

a) A table where read/write capacity is automatically managed
b) A table where read/write capacity is manually set by the user
c) A table used only for archiving data
d) A table with automatic backups enabled

Answer:

b) A table where read/write capacity is manually set by the user

Explanation:

In provisioned mode, the user manually sets the read and write capacity units for the table. If the workload changes, these limits need to be adjusted accordingly.

16. What does "on-demand mode" mean in DynamoDB?

a) The table scales automatically to handle workloads
b) The table can only be used for a short time
c) The table is available in certain regions only
d) The table supports only one type of query

Answer:

a) The table scales automatically to handle workloads

Explanation:

In on-demand mode, DynamoDB automatically scales to handle varying workloads, charging based on the actual data read and written, rather than pre-configured capacity.

17. What is DynamoDB Accelerator (DAX)?

a) A cache for accelerating reads from DynamoDB tables
b) A tool for writing queries
c) A way to reduce the size of tables
d) A system for backing up tables

Answer:

a) A cache for accelerating reads from DynamoDB tables

Explanation:

DynamoDB Accelerator (DAX) is a caching service that improves the performance of read-heavy applications by caching the results of queries and scans in memory.

18. What is the default backup retention period for DynamoDB continuous backups?

a) 24 hours
b) 7 days
c) 35 days
d) 365 days

Answer:

c) 35 days

Explanation:

DynamoDB continuous backups, using point-in-time recovery, retain backups for up to 35 days, allowing you to recover from accidental data loss within this period.

19. What is "TTL" in DynamoDB?

a) Time To Log
b) Time To Live
c) Temporary Table Log
d) Table Transaction Limit

Answer:

b) Time To Live

Explanation:

Time To Live (TTL) is a feature in DynamoDB that automatically deletes expired items from a table based on a timestamp attribute.

20. How does DynamoDB charge users for on-demand tables?

a) Based on the provisioned capacity
b) Based on the actual read and write requests
c) Based on the number of indexes
d) Based on the number of partitions

Answer:

b) Based on the actual read and write requests

Explanation:

In on-demand mode, DynamoDB charges based on the actual number of read and write requests made to the table, rather than a pre-configured capacity.

These questions cover the basic features, configurations, and use cases of DynamoDB. Understanding these concepts will help you effectively use DynamoDB in scalable, low-latency applications.

Comments