AWS Certified Developer – Associate (DVA-C02)Development with AWS ServicesMedium

A developer is building a new microservice that needs to store persistent user session data for a web application. The data is accessed frequently by a primary key and occasionally by a secondary attribute. The application requires high availability, low-latency access, and the ability to scale to millions of users. Which AWS service is best suited for storing this session data?

  1. AAmazon RDS for PostgreSQL
  2. BAmazon EFS
  3. CAmazon S3
  4. DAmazon DynamoDB
Show answer & explanation

Correct answer: D. Amazon DynamoDB

Amazon DynamoDB is a fully managed NoSQL database service that provides single-digit millisecond performance at any scale. It's ideal for session data due to its low-latency, high availability, and ability to handle high-volume, key-value access patterns, including secondary indexes.

Why the other options are wrong

  • A. Amazon RDS for PostgreSQL is a relational database, which can be used, but DynamoDB is generally better suited for the scale and low-latency key-value access required for session data in a high-traffic web application.
  • B. Amazon EFS is a scalable file storage service, not suitable for structured application data like session information.
  • C. Amazon S3 is object storage, not designed for structured, high-frequency, low-latency data access like session data.

DynamoDB for Session Data

Amazon DynamoDB is an ideal choice for storing user session data due to its high performance, scalability, low latency, and managed nature.

  • Supports high-volume, low-latency key-value access.
  • Automatically scales to handle millions of users and requests.
  • Provides high availability and durability.
  • Supports secondary indexes for flexible query patterns.

Memory trick: When 'Dynamic' sessions need 'DB' storage, 'DynamoDB' is the clear choice.

More Development with AWS Services questions