# Stateful Service

> Deploy stateful applications using StatefulSets with stable network identities

- **Category**: Cloud
- **Subcategory**: Behavioral
- **Canonical URL**: https://designpattern.fyi/patterns/k8s_stateful_service/

---

## Description
The Stateful Service pattern uses StatefulSets to deploy applications that require stable network identities and persistent storage. StatefulSets provide ordered pod creation, unique network identities, and stable persistent storage bindings. This is essential for databases, key-value stores, and other stateful applications.


## Use Cases
Use when deploying stateful applications that need stable identities or when applications require persistent storage and ordered deployment.





## Trade-offs


### Advantages

- Stable network identities

- Ordered pod creation and scaling

- Persistent storage bindings

- Suitable for databases and stateful apps




### Considerations & Drawbacks

- More complex than stateless services

- Slower scaling operations

- Limited to specific use cases







---
**Reference**: [Original Source](https://github.com/k8spatterns/examples/tree/master/behavioral/StatefulService)

