liveBook · Manning

Stateless system

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A stateless server is a server that does not retain client or application state locally between requests, storing such state in external systems instead.

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

Figure 17.5 Decoupling allows you to scale the number of virtual machines dynamically.

Shows how decoupling lets a load balancer or queue front a dynamically sized fleet of virtual machines. section 17.3

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains the definition, AWS storage choices, scaling patterns, application examples, and availability trade-offs without detailing session-state implementation.
Examples
Demonstrates image galleries, profile pictures, generated reports, WordPress, and URL screenshot processing.
What it assumes
Assumes basic web-application and AWS-service familiarity while introducing external storage through concrete S3 examples.
What you can do after
Build it from scratch by moving application data to AWS storage and placing identical instances behind a load balancer or queue.
How it connects
Connects stateless servers with Amazon S3, RDS, EFS, DynamoDB, EC2, load balancers, SQS, Auto Scaling, and CloudWatch.

Also explained in

Compare how 14 books explain stateless system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.