NOTE

1.12 Distributed-System Service State

State consists of program context or data. Requests to a stateful service may need the same node; these notes use this distinction to compare stateful and stateless services.

Distributed SystemsCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is State?

  • State refers to a program’s contextual information or data.
  • Stateful: a user’s successive requests are related and must be sent to a particular node for correct processing.
  • Stateless: a user’s successive requests are related, but any node can process them correctly.

2. Stateful Services vs Stateless Services

Stateful service Stateless service
Advantage State does not need to be stored in external storage; local access has higher availability and performance Good scalability; nodes can be added or removed freely
Disadvantage Poor scalability; nodes cannot be added or removed freely State needs to be stored in external storage; availability and performance are poorer

3. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub