AWS Certified Solutions Architect Associate SAA-C03 Practice Question
A company is decomposing a monolithic web application into microservices on AWS. The engineering team wants each new microservice to scale out easily when traffic spikes, without requiring complex session-handling logic. Which design approach BEST satisfies this requirement?
Store user session data in the microservice's in-memory cache for fast access.
Design each microservice to be stateless and persist required data in a shared store such as Amazon DynamoDB.
Write the microservice to read and write all application data to the local file system.
Enable sticky sessions on the Application Load Balancer so each user is routed to the same instance.
Designing a microservice to be stateless allows any instance of the service to process any incoming request. All state information (for example, user sessions or shopping-cart data) is stored in an external, shared data store such as Amazon DynamoDB or Amazon ElastiCache. Because instances do not rely on locally held state, Auto Scaling groups or container orchestrators can freely add or remove instances, and an Application Load Balancer can route requests to any healthy instance. Approaches that keep state on the instance (sticky sessions, local file storage, or in-memory caches within the service) couple requests to specific instances and hinder horizontal scaling.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a microservices architecture?
Open an interactive chat with Bash
What does it mean for a workload to be stateless?
Open an interactive chat with Bash
How does horizontal scaling work in a microservices architecture?