Which deployment approach for a stateful service such as a database cluster?
AdvancedScenarioDeployment Strategies and GitOps
Answer
Situation read → State changes the rules.
What I'd do →
- Use operators (Zalando/CloudNativePG) and StatefulSets with
updateStrategypartitions, upgrading replicas first then failing over the primary. - Take a verified backup/snapshot before the upgrade.
- Test upgrade and rollback in staging with production-like data.
Why → Data format changes may not be reversible, so backups are the real rollback.
Interview tip → Say that rollback for stateful workloads means restore.