--- title: Lessons Learned from Building a Database Operator weight: 10 tags: - platform - db --- Another talk as part of the Data On Kubernetes Day. ## Baseline ### Hosting Models * Managed: Atlas * Semi: Cloud manager * Self-hosted: Enterprise and community operator ### MongoDB on K8s * Cluster Architecture * Control Plane: Operator * Data Plane: MongoDB Server + Agent (Sidecar Proxy) * Enterprise Operator * OpsManager CR: Deploys 3-node operator DB and OpsManager * MongoDB CR: The MongoDB clusters (Compromised of agents) * Advanced use case: Data Platform with MongoDB on demand * Control Plane on one cluster (or on VMs/Bare-metal), data plane in tenant clusters * Result: MongoDB CR can not relate to OpsManager CR directly ## Pitfalls * Storage: Agnostic, Topology aware, configurable and resizable (can't be done with Statefulset) * Networking: Cluster-internal (Pod to Pod/Service), External (Split horizon over multicluster)