Skip to Content

DVA-C02: How to Choose the Best Data Store for Storing Movie Information

Learn how to compare different data store options for storing movie information, such as Amazon DynamoDB and Amazon RDS. Find out which solution best meets your use cases and requirements.

Table of Contents

Question

A developer wants to store information about movies. Each movie has a title, release year, and genre. The movie information also can include additional properties about the cast and production crew. This additional information is inconsistent across movies. For example, one movie might have an assistant director, and another movie might have an animal trainer.

The developer needs to implement a solution to support the following use cases:

  • For a given title and release year, get all details about the movie that has that title and release year.
  • For a given title, get all details about all movies that have that title.
  • For a given genre, get all details about all movies in that genre.

Which data store configuration will meet these requirements?

A. Create an Amazon DynamoDB table. Configure the table with a primary key that consists of the title as the partition key and the release year as the sort key. Create a global secondary index that uses the genre as the partition key and the title as the sort key.

B. Create an Amazon DynamoDB table. Configure the table with a primary key that consists of the genre as the partition key and the release year as the sort key. Create a global secondary index that uses the title as the partition key.

C. On an Amazon RDS DB instance, create a table that contains columns for title, release year, and genre. Configure the title as the primary key.

D. On an Amazon RDS DB instance, create a table where the primary key is the title and all other data is encoded into JSON format as one additional column.

Answer

A. Create an Amazon DynamoDB table. Configure the table with a primary key that consists of the title as the partition key and the release year as the sort key. Create a global secondary index that uses the genre as the partition key and the title as the sort key.

Explanation

The correct answer is A. Create an Amazon DynamoDB table. Configure the table with a primary key that consists of the title as the partition key and the release year as the sort key. Create a global secondary index that uses the genre as the partition key and the title as the sort key.

Here is an explanation of why this solution will meet the requirements:

  • The problem is that the developer wants to store information about movies, which have a fixed set of attributes (title, release year, and genre) and a variable set of additional properties (cast and crew details). The developer also needs to support three use cases for querying the movie information based on different attributes.
  • To solve this problem, a data store configuration that can handle both structured and semi-structured data, and that can support flexible and efficient queries, is needed. DynamoDB is a NoSQL database service that can store and retrieve any amount of data with consistent performance and scalability. It also supports JSON documents as a native data type, which means that it can store semi-structured data without requiring a predefined schema.
  • The solution that meets these requirements is to create a DynamoDB table with a primary key that consists of the title as the partition key and the release year as the sort key. This way, each movie can be uniquely identified by its title and release year, and DynamoDB can distribute the data across multiple partitions based on the title. The additional properties of each movie can be stored as JSON documents in other attributes of the table.
  • To support the use cases for querying the movie information based on different attributes, a global secondary index (GSI) is needed. A GSI is an index that has a different partition key and sort key than the base table, and that can project some or all of the attributes from the base table. A GSI can be used to query data using alternative keys, without affecting the performance of the base table.
  • The GSI that meets these requirements is one that uses the genre as the partition key and the title as the sort key. This way, DynamoDB can query all movies in a given genre by using the genre as the hash key, and optionally filter or sort them by title by using the title as the range key. The GSI can project all attributes from the base table, so that all details about each movie can be retrieved from the index.
  • This solution will meet the requirements because it will allow the developer to store information about movies in a flexible and scalable way, and to query them based on different attributes with high performance and low latency.

Therefore, option A is the correct solution that will meet the requirements. Option B is incorrect because it will not support querying movies by title and release year, which is one of the use cases. Option C is incorrect because it will not support storing additional properties about movies, which are inconsistent across movies. Option D is incorrect because it will not support querying movies by genre or release year, which are two of the use cases.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers