> Markdown version of [/videos/255-databases-on-kubernetes](https://www.wearedevelopers.com/videos/255-databases-on-kubernetes). 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 Running stateful applications in containers used to be heavily discouraged. Discover how Kubernetes operators changed the game by acting as automated DBAs for self-healing, zero-downtime database deployments. - **Speakers:** Denis Souza Rosa - **Event:** WeAreDevelopers LIVE - **Published:** September 30, 2021 - **Duration:** 48:45 - **URL:** https://www.wearedevelopers.com/videos/255-databases-on-kubernetes ## Summary Historically, running stateful applications like databases in containers was strongly discouraged due to container volatility. However, mature production-grade images, near bare-metal Docker performance, and decoupled storage architectures have completely shifted industry consensus. The defining catalyst for this transition has been Kubernetes operators, which enable organizations to run distributed databases like Couchbase with an automated, database-as-a-service (DBaaS) experience securely inside their own infrastructure. Leveraging Custom Resource Definitions (CRDs) and an event-based architectural model, Kubernetes operators function as automated DBAs. They act as "the holy grail for stateful applications" by actively listening for cluster events and administering domain-specific logic to self-heal the system. If a database node unexpectedly fails, the operator seamlessly provisions a replacement instance and triggers data rebalancing with zero downtime or manual intervention. Furthermore, operators can perform live version upgrades and enable granular hardware tuning, allowing infrastructure teams to independently scale and optimize indexers, query services, and data nodes based on specific read/write throughput requirements. Effectively scaling databases on Kubernetes also demands strategic storage provisioning. While remote persistent storage handles general use cases securely, local persistent storage circumvents network latency and is highly recommended for IO-bound workloads exactly when the database engine intrinsically handles cross-node data replication. To further mask complex YAML manifests and Kubernetes learning curves from the broader engineering team, organizations can deploy a Service Broker. This component exposes pre-configured, self-serve database plans via a simplified internal API, empowering developers to dynamically spin up compliant, right-sized database clusters on demand. **Keywords:** kubernetes operators, stateful applications, database containerization, custom resource definitions, automated data rebalancing, local persistent storage, kubernetes service broker, couchbase cluster management, distributed database scaling, automated database recovery, zero-downtime database upgrades, database-as-a-service abstraction, cross-datacenter replication, event-based cluster monitoring, containerized storage provisioning ## Chapters 1. **Evolution of stateful applications in container environments** (00:02) — Overcoming stateless design limitations enabled modern databases to run effectively inside containers. 1. **Modern improvements driving database adoption in Kubernetes** (02:51) — Performance gains, official vendor images, and separated storage pipelines make containerized databases production-ready. 1. **Extending Kubernetes functionality with custom resource definitions** (04:50) — Custom declarative objects combined with event-based controllers allow continuous supervision of database applications. 1. **Automating database administration via declarative operator patterns** (10:02) — Database-specific operational knowledge encoded in controller applications removes the need for manual administrative interventions. 1. **Deploying a distributed Couchbase cluster via operators** (13:33) — A declarative setup provisions multiple database nodes and replica configurations while connecting securely to external applications. 1. **Reconciling cluster configuration against unauthorized manual changes** (19:26) — Operators treat declarative manifests as the ultimate source of truth by aggressively reverting unauthorized dashboard modifications. 1. **Automating server recovery and cluster data rebalancing** (20:43) — Simulated node failures trigger automated health checks that transparently replace servers and redistribute existing shard data. 1. **Scaling out database compute capacity horizontally during production** (23:55) — Modifying the desired instance count automatically provisions fresh nodes and reallocates workloads without application downtime. 1. **Executing live version upgrades and workload topology tuning** (25:41) — Operators perform rolling deployment updates and allow varied node roles to independently support read or write heavy traffic. 1. **Evaluating data storage modalities for clustered persistent applications** (31:09) — Local persistent disks minimize latency penalties when utilizing database architectures equipped with native replication topologies. 1. **Simplifying database provisioning operations with Kubernetes service brokers** (34:19) — Internal platform catalogs expose preconfigured deployment tiers that abstract complex declarative definitions away from standard developers. 1. **Comparing managed database services against self-hosted Kubernetes operators** (39:50) — Managed cloud solutions reduce operational complexity while self-hosted operator deployments preserve maximum infrastructure customization flexibility. 1. **Exploring cluster scalability limits and data replication topologies** (43:30) — Operator configurations and cross-datacenter replication protect data integrity amidst scaling operational demands. ## Related Moments - [Automating database recovery and management using Kubernetes operators](https://www.wearedevelopers.com/videos/74-databases-on-kubernetes-why-you-should-care) (from "Databases on Kubernetes: Why you should care") - [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") - [Overview of Kubernetes operators and custom resource definitions](https://www.wearedevelopers.com/videos/487-debug-a-kubernetes-operator) (from "Debug a Kubernetes Operator") - [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") - [Challenges of deploying stateful databases on native Kubernetes](https://www.wearedevelopers.com/videos/74-databases-on-kubernetes-why-you-should-care) (from "Databases on Kubernetes: Why you should care") - [Shifting mindsets on running databases in containers](https://www.wearedevelopers.com/videos/74-databases-on-kubernetes-why-you-should-care) (from "Databases on Kubernetes: Why you should care") ## 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) - [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) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) ## Related Jobs - [Devops Engineer](https://www.wearedevelopers.com/jobs/ext/1940926-devops-engineer) at **Bitpanda** - [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** - [Staff Software Engineer](https://www.wearedevelopers.com/jobs/ext/1425755-staff-software-engineer) at **GitHub** - [Principal Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1465908-principal-software-engineer-database-infrastructure) at **GitHub** - [Data Scientist](https://www.wearedevelopers.com/jobs/ext/1351648-data-scientist) at **Almedia**