State
What is State?
State: The data or condition of a system at a given point in time. In frontend development, UI state drives what is displayed. In distributed systems, stateful services store session data between requests; stateless services do not. State is the data a system holds at a given moment: the items in a shopping basket, whether a user is logged in, which tab is open, or what is stored in the database.
Frequently asked questions about State
How is State used in practice?
In front-end development, the interface is drawn from state. Change the state and the interface follows, which is how frameworks like React and Vue work. Bugs often come from state that is duplicated and gets out of sync.
What should you keep in mind with State?
On servers, the important distinction is stateful versus stateless. A stateless web server keeps nothing between requests, so any server can answer any request, which makes scaling easy. Store sessions, files and caches in shared services such as a database, Redis or object storage, rather than on one server's disk or memory.
At a glance
| Category | Core glossary |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |