DVA-C02 exam dumps

DVA-C02 practice question 45 of 399

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

DVA-C02 Question 45

Select 4

You are designing a stateless web application hosted on Amazon ECS (Elastic Container Service) and need to ensure the application can scale horizontally while maintaining its stateless nature. Which of the following design choices should you implement?

  1. A

    Store user session data in Amazon ElastiCache.

  2. B

    Use a shared Amazon EFS file system to persist application state across ECS tasks.

  3. C

    Store application logs in Amazon S3 for centralized access and durability.

  4. D

    Use environment variables in the ECS task definition to pass configuration settings.

  5. E

    Save file uploads directly to Amazon S3 instead of local ephemeral storage.

Show answer and explanation

Correct answers: A, C, D, E

Explanation

Stateless applications do not retain information about previous requests or sessions. To maintain statelessness, all stateful data (e.g., sessions, logs, file uploads) should be externalized to services like Amazon S3, ElastiCache, or DynamoDB. This allows the application to scale horizontally, as no instance-specific information is required. Using environment variables for configuration ensures the application can run independently of specific instances.

  • A. Correct.

    Correct: Storing user session data in Amazon ElastiCache ensures the application remains stateless by offloading session management to an external service.

  • B. Incorrect.

    Incorrect: Using Amazon EFS to share file storage across ECS tasks would make the application stateful, violating the principles of statelessness.

  • C. Correct.

    Correct: Storing logs in Amazon S3 offloads stateful data like logs from the application, preserving its stateless nature.

  • D. Correct.

    Correct: Using environment variables in the ECS task definition provides configuration without embedding state directly in the application.

  • E. Correct.

    Correct: Saving file uploads to Amazon S3 ensures the application does not rely on local storage, maintaining its stateless design.

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