> Markdown version of [/videos/74-databases-on-kubernetes-why-you-should-care?t=425](https://www.wearedevelopers.com/videos/74-databases-on-kubernetes-why-you-should-care?t=425). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Databases on Kubernetes: Why you should care Still afraid to run stateful applications in containers? Discover how Kubernetes Operators bring the hands-off convenience of a managed DBaaS straight into your own cluster. - **Speakers:** Denis Wilson Souza Rosa, Steffen Schneider - **Event:** WeAreDevelopers LIVE - **Published:** November 30, 2020 - **Duration:** 45:49 - **URL:** https://www.wearedevelopers.com/videos/74-databases-on-kubernetes-why-you-should-care ## Summary While early conventional wisdom strictly warned against running stateful applications in containers, advancements in Docker performance and Kubernetes orchestration have made containerized databases the industry standard. Transitioning from bare metal to Kubernetes enables teams to separate compute from storage and leverage robust orchestration ecosystems. However, naive deployments using standard Kubernetes primitives often fail during node crashes because standard instances lack the context needed to recover distributed state, manage replication, and re-establish clustered inter-communication automatically. The real power of running databases on Kubernetes lies in extending the API using Custom Resource Definitions (CRDs) and the Operator pattern. By codifying operational knowledge directly into software, database-specific operators function as an automated reliability layer, constantly monitoring events and cluster states alongside etcd. This enforces the declarative YAML setup as an unshakeable single source of truth—automatically reverting unauthorized manual UI changes, executing zero-downtime version upgrades, and triggering complex data rebalancing if a node suddenly dies. Additionally, modular architectures allow engineering teams to independently scale specific database components, effectively segregating hardware needs for heavy data reads versus compute-heavy querying and indexing. Operating databases via Kubernetes operators brings the hands-off convenience of a managed Database-as-a-Service (DBaaS) straight into your own cluster, offering unparalleled flexibility and a significantly lower Total Cost of Ownership (TCO) for large-scale operations. When architecting these stateful workloads, choosing local persistent storage over remote persistent storage can yield a 4x performance increase without compromising safety, as modern distributed databases natively handle data replication. With container-related performance overheads shrinking to a negligible 2–4% decrease compared to bare metal, minor CPU and memory provisioning buffers are all it takes to confidently manage deeply resilient, cloud-native databases at scale. **Keywords:** kubernetes operators, custom resource definitions, stateful container configurations, distributed database architecture, database reliability engineering, automated node recovery, etcd state management, declarative infrastructure configuration, local persistent storage performance, remote persistent storage latency, data replication and rebalancing, docker container overhead, database as a service (DBaaS), zero-downtime cluster upgrades, pod anti-affinity setup, couchbase kubernetes deployment ## Chapters 1. **Shifting mindsets on running databases in containers** (00:17) — Developers shifted from avoiding stateful deployments to successfully running databases at scale. 1. **Challenges of deploying stateful databases on native Kubernetes** (05:35) — Standard deployment methods struggle with managing node failures, replication, and state recovery. 1. **Managing database configuration with custom resource definitions** (07:05) — Creating domain-specific resource types enables developers to manage cluster configurations without external tools. 1. **Addressing pod availability and state recovery in replicated nodes** (11:53) — Even when failed stateful pods return online, native scheduling lacks mechanisms to recover replicated data. 1. **Automating database recovery and management using Kubernetes operators** (15:56) — Software operators listen to cluster events to coordinate node recovery, service upgrades, and scaling logic. 1. **Deploying and validating configuration state using admission controllers** (20:41) — Applying an admission controller ensures manual edits synchronize correctly with defined configuration manifests. 1. **Demonstrating automated cluster recovery during intentional node failures** (27:47) — The automation logic responds to missing nodes by seamlessly provisioning replacements and rebalancing data. 1. **Scaling clustered resources and independently tuning running database services** (30:32) — Adjusting hardware allocations and unbundling internal components allows clusters to support specific traffic demands. 1. **Comparing managed database services against native Kubernetes deployments** (37:21) — Hosting databases on clusters delivers better lifecycle flexibility and economics than restrictive managed configurations. 1. **Optimizing persistent storage performance for containerized stateful applications** (40:48) — Local persistent storage outperforms remote volume mounting when running self-replicating database engines. 1. **Measuring container performance overhead and assessing operational benchmarks** (43:04) — Accounting for minor containerization overhead through intentional resource allocation guarantees steady database performance. ## Related Moments - [Modern improvements driving database adoption in Kubernetes](https://www.wearedevelopers.com/videos/255-databases-on-kubernetes) (from "Databases on Kubernetes") - [Deploying mission-critical databases within container infrastructures](https://www.wearedevelopers.com/videos/382-kubernetes-and-microservices-with-multi-model-databases) (from "Kubernetes and Microservices with Multi-Model Databases") - [Evolution of stateful applications in container environments](https://www.wearedevelopers.com/videos/255-databases-on-kubernetes) (from "Databases on Kubernetes") - [Managing heterogeneous deployment lifecycles via Kubernetes operators](https://www.wearedevelopers.com/videos/382-kubernetes-and-microservices-with-multi-model-databases) (from "Kubernetes and Microservices with Multi-Model Databases") - [Comparing managed database services against self-hosted Kubernetes operators](https://www.wearedevelopers.com/videos/255-databases-on-kubernetes) (from "Databases on Kubernetes") - [Extending Kubernetes functionality with custom resource definitions](https://www.wearedevelopers.com/videos/255-databases-on-kubernetes) (from "Databases on Kubernetes") ## Related Articles - [Learning Kubernetes made easy with KubeCampus](https://www.wearedevelopers.com/magazine/348-learning-kubernetes-made-easy-with-kubecampus) - [Making Data Warehouses Fast: A Developer’s Story](https://www.wearedevelopers.com/magazine/107-making-data-warehouses-fast-a-developer-s-story) - [Building AI Solutions with Rust and Docker](https://www.wearedevelopers.com/magazine/494-building-ai-solutions-with-rust-and-docker) - [Why Event-Driven Architecture Isn’t About Speed (and When You Actually Need It)](https://www.wearedevelopers.com/magazine/745-why-event-driven-architecture-isn-t-about-speed-and-when-you-actually-need-it) ## Related Jobs - [Lead Cloud DevSecOps Engineer - Kubernetes](https://www.wearedevelopers.com/jobs/ext/1659167-lead-cloud-devsecops-engineer-kubernetes) at **BWI GmbH** - [Platform Engineer (DevOps)](https://www.wearedevelopers.com/jobs/48264-platform-engineer-devops) at **WDW Consulting GmbH** - [Principal Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1465908-principal-software-engineer-database-infrastructure) at **GitHub** - [Devops Engineer](https://www.wearedevelopers.com/jobs/ext/1940926-devops-engineer) at **Bitpanda** - [Staff Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1470125-staff-software-engineer-database-infrastructure) at **GitHub** - [Data Scientist](https://www.wearedevelopers.com/jobs/ext/1351648-data-scientist) at **Almedia**