DVA-C02 Exam QuestionsBrowse all questions from this exam

DVA-C02 Exam - Question 20


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?

Show Answer
Correct Answer: A

To meet the requirements of retrieving movie details based on title and release year, title alone, and genre, an Amazon DynamoDB table is ideal due to its schema flexibility and scalability. By configuring the primary key with the title as the partition key and the release year as the sort key, the developer can efficiently retrieve specific movies. Additionally, creating a global secondary index with the genre as the partition key and the title as the sort key allows for efficient retrieval of all movies in a specific genre. DynamoDB's NoSQL nature also accommodates inconsistent additional properties for cast and crew without affecting database structure.

Discussion

9 comments
Sign in to comment
BibayOption: A
May 6, 2023

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. This option is the best choice for the given requirements. By using DynamoDB, the developer can store the movie information in a flexible and scalable NoSQL database. The primary key can be set to the title and release year, allowing for efficient retrieval of information about a specific movie. The global secondary index can be created using the genre as the partition key, allowing for efficient retrieval of information about all movies in a specific genre. Additionally, the use of a NoSQL database like DynamoDB allows for the flexible storage of additional properties about the cast and crew, as each movie can have different properties without affecting the structure of the database.

UntamablesOption: A
Mar 21, 2023

The correct answer is A. Amazon DynamoDB is suited for storing inconsistent attributes data across items. Option B is wrong. This solution does not help get items with the condition of the combination, title and release year.

jayvarma
Aug 9, 2023

As the schema for each entry of data into the database is not the same all the time, We would require a NoSQL database. So, RDS DB instance is ruled out. The answer is between A and B. As we would need the partition key to be as unique as possible, we would like to have the title of the movie as the partition key. Because having the partition key as the genre will create a hot partition problem and our data stored in the DynamoDB will be skewed. So option A is the answer.

Tony88Option: A
Sep 3, 2023

Go with A. NoSQL is good when data attributes are inconsistent -> DynamoDB Primary key should be unique, go with title + release year.

shahs10Option: A
Mar 28, 2023

Option A because we have to search on the basis of title so it is better to partition by title. Also we have to search by genre so it is good option to make GSI using genre as partition key

KrokOption: A
Apr 5, 2023

It's A - I totally agree. It's a single appropriate solution. But in my opinion genre isn't a quite good option as GSI partition key - it isn't high distribution and we can get a hot partition.

leonardoliverosOption: A
Nov 16, 2023

If you create a primary key with title(pk) and release(sk) date you corvered two scenaries, and also you need a GSI by last scenary with genre so you should creating a GSI with genre (pk) and title (sk)

65703c1Option: A
May 21, 2024

A is the correct answer.

sid4510
Jul 3, 2024

A is mostly correct , but I do see one problem there because in one year there can be same title movies can come which invalidate our primary key having title as partition key and year as a. Sort. key