Software → System Design
Stateful
Describes a component or protocol that remembers information from previous interactions.
Motivation
Stateful systems solve the problem of remembering information between interactions.
Where it fits
State appears in programming, web applications, distributed systems, and operations. It affects scaling, failover, caching, sessions, and storage.
Mental model
A stateful service changes future behavior based on past interactions or stored data.
Subconcepts
Stateful Service
A stateful service stores or depends on remembered information, such as session data, local files, queues, caches, or database-backed workflow state.
Stateful Component
A stateful component changes behavior based on internal data it has accumulated over time, which makes lifecycle, synchronization, and recovery important.
Common mistakes
- Scaling stateful services like stateless ones.
- Storing session state in places that make failover difficult.
- Forgetting to define ownership of state.