DynamoDB Basics: NoSQL Fundamentals Quiz Quiz

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.

  1. Core NoSQL Concept

    Which of the following best describes DynamoDB as a type of database system?

    1. Object-Oriented Database
    2. Flat File System
    3. NoSQL Database
    4. Relational Database

    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.

  2. Table Structure

    What is the primary building block for storing data in DynamoDB?

    1. View
    2. Table
    3. Cluster
    4. Schema

    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.

  3. Primary Key Purpose

    Why is a primary key required when creating a table in DynamoDB?

    1. It enforces strict data validation
    2. It uniquely identifies each item
    3. It assigns storage location
    4. It provides encryption

    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.

  4. Primary Key Types

    When designing a DynamoDB table, which two types of primary keys can you choose from?

    1. Index Key and Partition Key
    2. Global Key and Local Key
    3. Composite Key and Simple Key
    4. File Key and Path Key

    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.

  5. Data Consistency

    Which option best describes the default consistency model provided when reading data from DynamoDB?

    1. Immediate consistency
    2. Transactional consistency
    3. Eventual consistency
    4. Strong consistency

    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.

  6. Attributes and Schema Flexibility

    In DynamoDB, what is true about the attributes of items stored in the same table?

    1. Each item can have different attributes
    2. All items must have the same attributes
    3. Items require pre-defined data types
    4. Attributes must follow a fixed format

    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.

  7. Data Retrieval

    If you need to fetch a single item by its primary key in DynamoDB, which operation should you use?

    1. Scan
    2. Query
    3. GetItem
    4. FetchAll

    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.

  8. Secondary Indexes

    What is a key benefit of using a secondary index in DynamoDB?

    1. To reduce data storage costs
    2. To provide additional query patterns
    3. To back up tables
    4. To increase encryption

    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.

  9. Reserved Words

    What should you be cautious about when naming attributes in DynamoDB tables?

    1. Defining null values
    2. Naming with only uppercase letters
    3. Using duplicate types
    4. Using reserved words

    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.

  10. Provisioned Capacity

    What happens if your read or write requests exceed the provisioned throughput on a DynamoDB table?

    1. The table automatically resizes
    2. Requests may be throttled
    3. All queries return only partial results
    4. Data is permanently deleted

    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.