.NET Architecture & System Design Interview Question #17

What is a stateful application?

Architecture Fundamentals, Scalability, Availability & Performance Junior Beginner

Quick Interview Answer

A stateful application keeps information that affects later interactions within a particular process, server, or session. Examples can include in-memory sessions, long-lived connections, or local workflow state.

Detailed Explanation

A stateful application keeps information that affects later interactions within a particular process, server, or session. Examples can include in-memory sessions, long-lived connections, or local workflow state.

Stateful systems can still scale, but routing, replication, partitioning, recovery, and failover become more complex. State should be introduced deliberately and stored according to its durability and consistency requirements.

Code Example

Client -> App A
          [session state]

If next request goes to App B,
state must be replicated, externalized,
or routing must preserve affinity.