DVA-C02 exam dumps

DVA-C02 practice question 237 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 237

Single answer

You are developing a serverless application using AWS Lambda, and you want to test the application in a development environment. The application stores data in an Amazon DynamoDB table. To test the application without incurring high costs and to ensure that your development environment closely mimics production, what is the best practice?

  1. A

    Use the AWS Lambda console to run test events and point to the production DynamoDB table.

  2. B

    Create a separate DynamoDB table for development and configure your Lambda function to use the development table.

  3. C

    Enable DynamoDB Streams on your production table and use the stream to test your application in the development environment.

  4. D

    Use the AWS SAM CLI to create a local development environment that includes a local version of DynamoDB.

Show answer and explanation

Correct answer: B

Explanation

The best practice for testing in a development environment is to isolate the environment from production to avoid impacting production data and incurring unexpected costs. Using a separate DynamoDB table for development ensures that testing is safe and does not interfere with live data while maintaining a close resemblance to the production setup.

  • A. Incorrect.

    This option is not a best practice as it involves using production resources in a development environment, which can lead to unintentional data modifications and higher costs.

  • B. Correct.

    This is the correct answer. Using a separate DynamoDB table for development ensures that production data is not affected, while allowing you to test in an environment that closely resembles production.

  • C. Incorrect.

    Using DynamoDB Streams in this way is not suitable for testing in a development environment because it introduces unnecessary complexity and still interacts with production resources.

  • D. Incorrect.

    While the AWS SAM CLI can be used for local testing, it is not ideal for testing interactions with actual DynamoDB tables. It is better suited for testing Lambda functions locally without involving AWS services directly.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam