Explore the essential concepts of NoSQL databases with this DynamoDB basics quiz, designed to assess your understanding of key features, data modeling, and operations. Perfect for beginners aiming to strengthen their foundation in scalable, non-relational database management.
Which of the following best describes DynamoDB as a type of database system?
Explanation: DynamoDB is considered a NoSQL database, meaning it stores and retrieves data using non-relational methods, typically key-value or document-based structures. Relational databases rely on tables with fixed columns and rows, which is not the case for DynamoDB. Object-oriented databases and flat file systems don't provide the same flexible, scalable structure or native support for distributed data that NoSQL databases offer.
What is the primary building block for storing data in DynamoDB?
Explanation: A table is the primary structure where all data in DynamoDB is stored, organized into items and attributes. A schema in traditional databases strictly defines the structure, but DynamoDB tables are schema-less except for primary keys. Clusters refer to groups of servers and are not a direct component of DynamoDB data storage. Views are virtual tables and do not exist as a first-class construct in DynamoDB.
Why is a primary key required when creating a table in DynamoDB?
Explanation: A primary key ensures that each item in a DynamoDB table can be uniquely identified, which is critical for efficient data retrieval. While it is important, it doesn't directly handle data validation, assign storage location, or provide encryption. Those roles are managed by other elements or features.
When designing a DynamoDB table, which two types of primary keys can you choose from?
Explanation: DynamoDB supports Simple (Partition) Keys and Composite (Partition + Sort) Keys for uniquely identifying items. Options like Global Key and Local Key are not applicable and may confuse with indexes. Index Key and Partition Key is incorrect because 'Index Key' is not a valid key type. File Key and Path Key do not exist in this context.
Which option best describes the default consistency model provided when reading data from DynamoDB?
Explanation: By default, DynamoDB provides eventual consistency on read operations, meaning data might take a short time to fully propagate across all storage locations. Strong consistency can be requested but is not the default. Transactional consistency relates to multiple operations and is not a read default. Immediate consistency is not a recognized term in this context.
In DynamoDB, what is true about the attributes of items stored in the same table?
Explanation: DynamoDB tables allow each item to have its own unique set of attributes, except for the required primary key attributes. This flexibility means items are not required to have the same attributes or a fixed format. While attribute data types exist, the schema is not enforced for all items, making pre-defining types optional.
If you need to fetch a single item by its primary key in DynamoDB, which operation should you use?
Explanation: GetItem is specifically designed to retrieve a single item from a table using its primary key. Query is used when searching by partition key with optional conditions on the sort key. Scan reads every item, making it less efficient for single-item access. FetchAll is not an operation in DynamoDB.
What is a key benefit of using a secondary index in DynamoDB?
Explanation: Secondary indexes let you create alternate query access patterns on your data, different from the primary key. They are not used for backups, do not increase encryption, and do not necessarily lower storage costs. The primary use case is to expand query flexibility.
What should you be cautious about when naming attributes in DynamoDB tables?
Explanation: Using reserved words (such as keywords that are part of DynamoDB's query language) as attribute names can cause conflicts and errors. Duplicate types, null values, and uppercase naming are not restrictions, although good naming practices are encouraged. Only reserved words pose a direct technical issue.
What happens if your read or write requests exceed the provisioned throughput on a DynamoDB table?
Explanation: When provisioned throughput is exceeded, requests may be throttled, temporarily slowing or blocking access to ensure table stability. This does not result in permanent data loss, automatic resizing, or partial result returns. Throttling is a safeguard for predictable performance.