You are creating a DynamoDB table to store all movies that have been released since 1938. Your application will allow users to search by movie title and see the details of that film. Given the sample below showing the movie data that you will be importing, what is the best set of keys to apply to this table?

Advertisement

{
“title”: “The Avengers”,
“year”: 2012,
“cast”: [“Mark Ruffalo”, “Robert Downey, Jr.”],
“genres”: [“Action”]
}

  • The primary key should be a partition key of the title field.
  • The primary key should be the title field and the partition key should be the genres field.
  • The primary key should be a composite key comprised of a partition key on the title field and a sort key on the year field.
  • The primary key should be created as a completely unique value, such a sequential numerical list of movie IDs. The partition key should be title field for fast lookup.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend