Stateful Applications And Stateless Applications
So what do we mean by stateful or stateless applications, basically all applications have some degree of state that is – in some applications the state of the application does not really impact the user (we will discuss this in stateless application section). These applications are called stateless applications. While other applications (like databases, message queues, caches, etc.) have a much higher degree of state because they rely on storage. This state does impact the user, that is we can not handle requests in a database independently. This type of applications are called Stateful applications. To explain these points further:
Kubernetes StatefulSets: Running Stateful Applications in Containers
StatefulSets are Kubernetes components that are used specifically for deploying stateful applications. In Kubernetes on the basis on methods of deploying. There are two types of applications – Stateful applications and stateless applications. Therefore, There are two ways for deploying an application on Kubernetes – through Deployment (for deploying stateless applications) and through StatefulSets (for deploying stateful applications).
Applications that maintain any form of persistent state or data are called stateful applications. Most of the database applications that we build like MySQL and MongoDB are stateful applications. The basic point of difference between a stateful and a stateless application is the need of persistent storage. Stateful applications requires a persistent storage while stateless applications do not have a need to store data, therefore they don’t require any persistent storage.