
State is the Enemy of Scale
Why the modern application server must be entirely ephemeral and how state acts as technical gravity.
The Weight of Memory
In computer science, "state" is the memory of past events. It is the information a system retains from one interaction to the next.
When an application is built with heavy stateful components—where the application server remembers user sessions, in-memory caches, and websocket connections—scaling becomes a nightmare. If Server A holds the state for User X, every request from User X must be routed to Server A.
If Server A goes down, User X's session is destroyed. If traffic spikes and you need to spin up Server B, Server B starts completely blank, unable to help User X until state is manually synchronized.
"Statelessness is the prerequisite for infinite, horizontal scale."
The Ephemeral Server
The modern architectural paradigm dictates that application servers must be entirely ephemeral.
An application server should be a pure function: it receives an input (the HTTP request), performs a transformation, and returns an output. It should not remember anything. If you unplug the server mid-request and plug it back in, the system should instantly route the request to another identical server without the user ever noticing.
This requires pushing state to the absolute edges of the architecture.
Where Does State Belong?
If the application server cannot hold state, where does it go?
- The Client: Push session data, UI state, and viewing preferences into the browser or mobile device. The client is inherently stateful; let it do the work.
- The Database: The database is the ultimate source of truth. It is designed to handle massive, concurrent state mutations safely.
- The Distributed Cache: If hitting the database for every request is too slow, state can be held in a distributed, highly available cache cluster (like Redis). The application server remains stateless, simply querying the cache cluster when necessary.
The Freedom of Statelessness
When your application layer is completely stateless, you achieve operational freedom.
You can use auto-scaling groups to spin up 1,000 servers in response to a sudden traffic spike, and instantly spin them down when the spike subsides. You can deploy new code in the middle of the day without worrying about dropping active user sessions.
State is a form of technical gravity. The less state your application servers hold, the lighter they become, and the faster your entire engineering organization can move.

Kai Cyrus
Founder, Builder, Investor