liveBook · Manning

Stateless system

As explained in Akka in Action, Second Edition

An architectural property in which a server does not retain application state between requests.

A stateless system keeps application state out of web-server memory, allowing requests to reach multiple servers behind a load balancer. Persistent state and business logic move into database operations. section 1.4.1

Statelessness improves deployment flexibility but changes the system’s failure and consistency boundaries:

  • Multiple front-end servers can serve requests without synchronizing feature-rich in-memory objects. section 1.4.1
  • Database calls can fail because of insertion errors, server crashes, or network problems. section 1.4.1
  • Concurrent updates, duplicate records, and multi-table operations require explicit database coordination. section 1.4.1

Starting a conversation

An in-memory Conversation object can add a Message directly. In a stateless design, the same action becomes database work, potentially inserting rows into both Conversation and Message tables. section 1.4.1

Figure 1.4 Load balancer/failover
CH01_F04_Abraham2

Use the load-balancer diagram to visualize why server-local application state must be removed or externalized. section 1.4.1

How Akka in Action, Second Edition covers it

How deep it goes
Explains the architectural shift and its database failure and consistency costs, but stops short of implementation details.
Examples
Uses multi-server web deployment, Conversation and Message persistence, DAOs, and database failure scenarios.
What it assumes
Assumes familiarity with web servers and in-memory objects, while introducing load balancing and database-backed state through a concrete migration.
What you can do after
Evaluate how removing server-local state shifts synchronization, failure handling, and business logic into database operations.
How it connects
Connects statelessness with load balancing, databases, data access objects, concurrency, and consistency.

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 Akka in Action, Second Edition. The section links point to the parts of the book it draws on.