KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
-
Upload
kubeacademy -
Category
Technology
-
view
749 -
download
0
Transcript of KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
Why not multimasterDBs?
just moving the problem around
"eventual" consistencynetwork lagmaturity issuesfeature povertyapp compatibility
The 80% Solution1. Pool of async replicas2. Cheap/replacable nodes Containers
3. Watchdog service4. Autopromote one replica5. Other nodes remaster6. Update routing
Handyrepmastercontroller architecturebased on Python Fabric + SSHworked in productionworked with any Postgres configpluggable
www.handyrep.org
Handyrep: too generalDifficult to installDifficult to debugOver 100 configuration optionsScaled poorlyHR server was SPoF
Zalandono1 European online fashion15m customers150 databases24/7/365 operation
... needed automated,decentralized HA
Patroni controllerPython daemonRuns in each container as PID 1Controls Postgresstartup/shutdown/configProvides external REST APIEnforces opinionated config
Etcddistributed consensus HTTP datastoreRaft algoritmimplements CAgreat for config + metadata
not for data data
What's AtomicDB?WIP project
PostgreSQLPatroniAtomic HostKubernetesDynamic proxy (dev)Cockpit UI (dev)
The Proxy Problemdifferentiate master and readonlyconnectionsmaster service needs to followfailoverfailover logic too complex forkubernetes (1.1)
pgbouncer?current implementation inpgbouncermaster, read slaves separateservices/portsdepends on flannel LB
not good enough. Waiting for1.2/1.3!
More featurespg_rewind support (9.4+)configurable node imaging
WALEPITR
synchronous replicationnonfailover replicas
ResourcesThis Presentation: jberkus.github.io/full_auto_dbPatroni Project: github.com/zalando/patroniAtomicDB Project: github.com/jberkus/atomicdb