QuestionQ79

VerifiedDevelop for Azure storage

A company develops a series of mobile games. Every game uses a single leaderboard service.

The requirements are:

  • Code must scale and support growth.
  • Each record must contain a playerId, gameId, score, and time played.
  • When a user reaches a new high score, the system must save that score by using the SaveScore function below.

Each game receives an ID based on the series title.

Question Image

You plan to store customer information in Azure Cosmos DB. The database already contains the following data:

Question Image

You develop the following code to save scores in the data store. Line numbers are provided only for reference.

Question Image

You develop the following code to query the database. Line numbers are provided only for reference.

Question Image

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Yes or No
StatementsYesNo
SaveScore will work with Cosmos DB.
SaveScore will update and replace a record if one already exists with the same playerId and gameId.
Leader board data for the game will be automatically partitioned using gameId.
SaveScore will store the values for the gameId and playerId parameters in the database.
Explanation

Azure Cosmos DB for Table supports applications written for the Azure Table Storage client surface. A table entity is uniquely identified by its PartitionKey and RowKey; Insert does not replace an existing entity, and partitioning follows the entity partition key rather than automatically following a method argument such as gameId. The score entity constructed from the supplied arguments stores the game and player identifiers.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!