A stateless server does not retain client or application state locally between requests. It stores shared state remotely in databases, filesystems, object stores, or other storage systems, allowing requests to move between server instances. section 17.3 section 16.4
Statelessness supports scaling and fault tolerance. A load balancer can distribute synchronous requests across identical EC2 instances, while a message queue can decouple asynchronous work. Auto Scaling can then add or remove instances without making local server storage part of the design. section 17.3 section 17.4
Common AWS storage choices for externalized state include:
- Amazon S3 stores objects such as images, documents, executables, and generated reports; applications access them through HTTP(S), the CLI, SDKs, or the Management Console. section 7.9 section 7.5
- Amazon RDS and EFS can support a WordPress deployment, while DynamoDB and S3 can support a URL screenshot service. section 17.3
- Keeping state off EC2 improves recovery options across virtual-machine and Availability Zone failures, but storage choices still involve performance, recovery, and cost trade-offs. section 13.3.1 section 7.9
Simple S3 Gallery
A web application uploads profile pictures or gallery images to an S3 bucket and later downloads them for display. The application can also generate PDF reports in S3 or share objects between applications. A Node.js implementation uses the AWS SDK for JavaScript; the demonstrated examples were tested with Node.js 14. section 7.5
Shows how decoupling lets a load balancer or queue front a dynamically sized fleet of virtual machines. section 17.3













