Kubernetes(K8s) is the orchestrator tool for containers. It has 3 features below. • Declarative config • Auto-healing • Immutable Database is not Immutable.
Node Node Master Slave Replicate • The database usually has a state that is not easy to maintain by Kubernetes. <Disadvantage for DB> • Necessary to startup in turn. • Must never lose their data. • Handle the database as pets.
VTgate app app app SQL SQL SQL • Vitess that used on YouTube is the CNCF incubating project. • Vitess provides MySQL sharding in K8s. • VTgate and VTtablet can scale by K8s. • When terminating a component abnormally, Kubernetes repair it automatically.
a distributed architecture. • When doesn’t a node reply – Network partition? – Process failure? – Node failure? • If the disk resource attached, harder to determine. FailOver?
don’t know the status, it’s okay. We act on the premise of failsafe.” “No need to share resources. Right?” “Both have long been known for database clustering.”
2or more Instances Redundancy 2 or more Shared Disk Log Shipping --- × Scaleout? Read Read/ Write Failover (Fencing) Availability Promotion (Election) --- • There are differences to build a DB cluster with some nodes.
shared storage <Worst Case> • Multiple writes to storage <Solution> • Fencing VIP Linux-HA Controller Controller • It's been used since before Linux but helpful.
Node Failure > 1. Forced node power off i. Definite processes stop ii. Unmount storage iii. Detach virtual IP 2. PostgreSQL starts to run on the standby node. • Failed node is isolated from resources = Fencing
Slaves are Read-Only. • Data synchronization by WAL transmission <Worst Case> • 2 or more Masters <Solution> • Leader Election • Redundancy built into PostgreSQL = Streaming Replication Master Slave Slave
The other is still a slave. • Always one master • The former master joins as a slave. <Master in unknown state> 1. The remaining one slave is elected as the leader 2. The leader is promoted as a master. • Algorithms such as Paxos and Raft are used. Master Slave
operates as one DB. • Dispatches queries to relevant nodes. • Basically no availability. • Problems with the transaction. • For rather scalability than availability. Coordinator
Description ⅰ HA • Use Rook/Ceph as Shared Storage. ⅱ • Use LINSTOR/DRBD as Shared Storage. ⅲ Replication • Use Streaming Replication, without Shared Storage. ⅳ Operator • Building and Operating Replication automatically. • We can see following four patterns.
sentinel sentinel • Builds Streaming Replication on top of Kubernetes. • 3 types of processes have different roles • Without Shared- Resources < Disadvantage > • Not builtin Read Off- loading
Kubernetes Native are already available. You can see some operators for DBA task automation. However, it is not over yet. Cloud Native Storage + + = ???
Logging Storage Logging Storage Logging CPU Memory Cache(SSD) Page Cache(SSD) Log AWS Aurora(PostgreSQL) Azure Hyperscale • Both divide RDBMS functions and are extended by each cloud.
by Kubernetes STaaS by Kubernetes What we got for DBaaS • HA • Streaming Replication • DB Operator Also for STaaS • Simple Redundancy • Distributed Storage • Interoperable IF(CSI) • Kubernetes will be "The Platform for Platforms."