SAA-C03 ยท Containers and microservices
Stateless microservices
Stateless versus stateful workloads, moving session state to ElastiCache or DynamoDB, and multi-tier versus microservice architectures.
Key points
- Stateless: no state on local disk or memory, so any copy answers any request.
- Scale freely, replace failed copies without logging users out.
- State in shared multi-AZ stores: sessions in ElastiCache, MemoryDB or DynamoDB, profiles in DynamoDB, files in S3, secrets in Secrets Manager.
- Sticky sessions only hide local state.
- Multi-tier splits by layer; microservices by business capability, deployed and scaled separately.
Practice questions
What makes a web service stateless?
- It runs inside a container instead of on a virtual machine
- It keeps no request-to-request data in local memory or on local disk
- It sits behind an Application Load Balancer with stickiness enabled
- It stores its session data on an attached Amazon EBS volume
Show answer
Answer: B. It keeps no request-to-request data in local memory or on local disk
A stateless service does not depend on data kept locally between requests, so any running copy can serve the next request. Running in a container or behind a load balancer does not by itself remove local state.
Which services are suitable places to offload user session data so that web servers stay stateless?
- Amazon ElastiCache
- An instance store volume on each web server
- Amazon DynamoDB
- Amazon MemoryDB
- The EBS root volume of each web server
Show answer
Answer: A. Amazon ElastiCache, C. Amazon DynamoDB, D. Amazon MemoryDB
Amazon ElastiCache, Amazon DynamoDB and Amazon MemoryDB are shared stores that every server can reach, so sessions survive when a server goes away. An instance store volume and an EBS root volume belong to one instance, so the data is still local state.
Enabling sticky sessions on an Application Load Balancer turns a stateful web application into a stateless one.
Show answer
Answer: False
False. Stickiness only routes a user back to the same target, so the session still lives on that one server and is lost if it fails or is scaled in. Statelessness means moving the session to a shared store.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
