Skip to Content
Beyond the Twelve-Factor App
book

Beyond the Twelve-Factor App

by Kevin Hoffman
April 2016
Intermediate to advanced
70 pages
1h 11m
English
O'Reilly Media, Inc.
Content preview from Beyond the Twelve-Factor App

Chapter 12. Stateless Processes

Factor 6, processes, discusses the stateless nature of the processes supporting cloud-native applications.

Applications should execute as a single, stateless process. As mentioned earlier in the book, I have a strong opinion about the use of administrative and secondary processes, and modern cloud-native applications should each consist of a single,1 stateless process.

This slightly contradicts the original 12 factor discussion of stateless processes, which is more relaxed in its requirement, allowing for applications to consist of multiple processes.

A Practical Definition of Stateless

One question that I field on a regular basis stems from confusion around the concept of statelessness. People wonder how they can build a process that maintains no state. After all, every application needs some kind of state, right? Even the simplest of application leaves some bit of data floating around, so how can you ever have a truly stateless process?

A stateless application makes no assumptions about the contents of memory prior to handling a request, nor does it make assumptions about memory contents after handling that request. The application can create and consume transient state in the middle of handling a request or processing a transaction, but that data should all be gone by the time the client has been given a response.

To put it as simply as possible, all long-lasting state must be external to the application, provided by backing services. So the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Applications with AI Agents

Building Applications with AI Agents

Michael Albada
AI Agents in Action

AI Agents in Action

Micheal Lanham
Developing Apps with GPT-4 and ChatGPT

Developing Apps with GPT-4 and ChatGPT

Olivier Caelen, Marie-Alice Blete
The DevOps Handbook

The DevOps Handbook

Gene Kim, Jez Humble, Patrick Debois, John Willis

Publisher Resources

ISBN: 9781492042631