nerdexam
Amazon

DVA-C02 · Question #380

A developer is designing a fault-tolerant environment where client sessions will be saved. How can the developer ensure that no sessions are lost if an Amazon EC2 instance fails?

The correct answer is C. Use Amazon DynamoDB to perform scalable session handling.. To survive EC2 instance failures, session state must be stored in an external, fault-tolerant data store rather than in instance memory. DynamoDB provides a managed, highly available key-value store ideal for session data.

Submitted by yasin.bd· Mar 5, 2026Development with AWS Services

Question

A developer is designing a fault-tolerant environment where client sessions will be saved. How can the developer ensure that no sessions are lost if an Amazon EC2 instance fails?

Options

  • AUse sticky sessions with an Elastic Load Balancer target group.
  • BUse Amazon SQS to save session data.
  • CUse Amazon DynamoDB to perform scalable session handling.
  • DUse Elastic Load Balancer connection draining to stop sending requests to failing instances.

How the community answered

(41 responses)
  • A
    2% (1)
  • B
    12% (5)
  • C
    78% (32)
  • D
    7% (3)

Why each option

To survive EC2 instance failures, session state must be stored in an external, fault-tolerant data store rather than in instance memory. DynamoDB provides a managed, highly available key-value store ideal for session data.

AUse sticky sessions with an Elastic Load Balancer target group.

Sticky sessions route a client to the same EC2 instance, so if that instance fails, the session stored in memory is lost along with it.

BUse Amazon SQS to save session data.

Amazon SQS is a message queuing service designed for decoupling components, not for storing and retrieving key-value session data.

CUse Amazon DynamoDB to perform scalable session handling.Correct

Amazon DynamoDB is a fully managed, highly available NoSQL database that stores session data outside the EC2 instance. If an instance fails, any other healthy instance can retrieve the session from DynamoDB, ensuring no session data is lost.

DUse Elastic Load Balancer connection draining to stop sending requests to failing instances.

Connection draining gracefully stops new requests to a failing instance but does not persist or recover session data stored in instance memory.

Concept tested: External session state management with DynamoDB

Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-session-handling.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice