SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
POSTGRESQL HIGH AVAILABILITY
IN A CONTAINERIZED WORLD
Jignesh Shah
Chief Architect
About @jkshah
ü  appOrbit
•  Focus is on data management of applications running in Containers
ü  VMware
•  Lead and manage Postgres and Data Management teams at VMware for various products
embedding PostgreSQL running in virtualized embedded instances
ü  Sun Microsystems
•  Team Member of first published SpecJAppServer 2004 benchmark with PostgreSQL
•  Performance of PostgreSQL on Solaris/Sun Servers
ü  Working with PostgreSQL community since 2005
•  http://jkshah.blogspot.com/2005/04/profiling-postgresql-using-dtrace-on_22.html
ü  Working with Container technologies (Solaris Zones) since 2004
•  http://jkshah.blogspot.com/2004/08/db2-working-under-solaris-10-zones_30.html
About
ü  OnDemand Dev/Test Environment Management
•  Multi-tiered, multi-serviced application deployment with initial data
•  Onprem & multi-cloud
•  Snap, Restore, Clone across all tiers
ü  Data Services for Applications
•  DBaaS for your applications
•  Oracle, PostgreSQL, MySQL
ü  Test Data Management
•  Live data templates, data pipeline workflows
•  Data subsets, data masking workflows
Enterprise Requirements
DB Server
Typical Enterprise Application
Web Server
Web Server App Server
App Server
Cache ServerCache Server
Typical Micro services Application
Web ServerWebapp Server
Gateway
App Server
MicroService 1
DB 2
App Server
MicroService 2
DB 3
App Server
MicroService N
Simplified Requirements of DB Service
ü Easy, convenient Database service
ü High Availability
ü High Durability
Data Center
DNS Name
High Availability Requirements
ü Requirements
•  Recovery Time Objective (RTO) - Availability
•  What does 99.99% availability really mean?
•  Recovery Point Objective (RPO) - Durability
•  Zero data lost?
•  HA vs. DR requirements
Availability %	 Downtime / Year	 Downtime / Month *	 Downtime / week	
"Two Nines" - 99% 	 3.65 Days	 7.2 Hours	 1.69 Hours	
"Three Nines" - 99.9% 	 8.76 Hours	 43.2 Minutes	 10.1 Minutes	
"Four Nines" - 99.99% 	 52.56 Minutes	 4.32 Minutes	 1.01 Minutes	
"Five Nines" - 99.999% 	 5.26 Minutes	 25.9 Seconds	 6.06 Seconds	
* Using a 30 day month
Causes of Downtime
ü  Blame it on Murphy’s Law
•  Anything that can go wrong, will go wrong
ü  Planned Downtime
•  Software upgrade (OS patches, SQL Server cumulative updates)
•  Hardware/BIOS upgrade
ü  Unplanned Downtime
•  Datacenter failure (natural disasters, fire)
•  Server failure (failed CPU, bad network card)
•  I/O subsystem failure (disk failure, controller failure)
•  Software/Data corruption (application bugs, OS binary corruptions)
•  User Error (shutdown a SQL service, dropped a table)
Distilled HA Requirements
ü  Design to handle failures
ü  Easy to deploy
ü  Convenient to access
ü  Self healing/handling of failures
ü  Graceful handling
Design
Shared Storage based HA
ü Leverage Hardware snapshots
ü Automated failover - OS Clustering
ü DR (across region) using block level
replication of snapshots
ü Newer designs using distributed shared
storage
DNS Name
Disadvantages of Shared Storage HA
ü Expensive
ü Mostly DR
ü No offloading
•  Though possible using storage clones
ü No load balancing
ü No fast failover
•  PostgreSQL server start required
DNS Name
PostgreSQL Replication
ü  Single master, multi-slave
•  Cascading slave also possible
•  Mechanism based on WAL (Write-Ahead Logs)
ü  Multiple modes and multiple recovery ways
•  Warm standby
•  Asynchronous hot standby
•  Synchronous hot standby
ü  Fast failover (pg_ctl promote)
ü  Load Balancing for read only operations
•  Good for read scale
ü  Node failover, reconnection possible
Synchronous PostgreSQL Replication
ü No SPOF Shared Storage
ü Faster failover
ü High durability
ü Best within single datacenter only
DNS Name
Asynchronous PostgreSQL Replication
ü Better performance
ü Across datacenters
ü Cascading replication
ü Tradeoff: Lose transactions
DNS Name
PostgreSQL Replication - Issues
ü  No automated Failover
ü  Complex setup
•  Reusing failed master as slave
(pg_rewind)
•  Provisioning new slave with full copy
ü  Manual DNS updates for failover
ü  Application reconnection required after a
failover
ü  Separation logic required for Read-Write
and Read-Only connections in
application
Photo Credit: dundanim/ Shutterstock.com
Easy to deploy
Using Linux Containers
What are Containers?
ü OS Level virtualization where kernel allows for multiple isolated user-
space instances
Operating
System
Bare Metal
Server
OS
Bare Metal
Server
Hypervisor
OS
Operating
System
Bare Metal
Server
C C C C C OS
Bare Metal
Server
Hypervisor
OS
C C C C
Advantages of Containers
ü Lower footprint
ü Very Quick Startup and Shutdown
ü Density
ü Nesting
Disadvantages of Containers
ü Same Kernel version
ü Cannot run other OS natively
ü Security (to be improved)
ü Not a complete solution for enterprise needs
Docker
ü Quick Guide to use a docker based container
# docker run --name mycontainer –e
POSTGRES_PASSWORD=mysecretpassword -d postgres
# docker exec -ti mycontainer psql -U postgres
# docker stop mycontainer
# docker rm mycontainer
# docker rmi postgres
Container Volumes – Must for DB
ü Persists beyond the life of a Docker container
•  VOLUME command in Dockerfile or
•  Using –v using docker run command
•  Automatically created if not already present during docker run
•  Not part of docker push/pull operations
•  Can select a non-local directory using --volume-driver
•  Third party components required to get multi-host support (NFS, etc )
ü Different options using –v
•  -v /hostsrc/data:/opt/data:ro # for read only volumes (default rw)
•  -v /hostsrc/data:/opt/data:Z # Z – private volume, z – shared volume
•  -v /etc/nginx.conf:/etc/nginx.conf # for mounting a single file only
PostgreSQL Container as a DB server
ü Maybe you want a database server standalone
•  Not all database clients will be in the same host
•  Need to limit memory usage
•  Need different layout of how files are distributed
ü Use the –p option to make the port available even to non containers
clients
ü Use –m to limit memory usage by the DB server (by default it can see
and use all)
•  Note this does not set shared buffers automatically with the library image
docker run --name mycontainer -m 4g -e POSTGRES_PASSWORD=mysecretpassword 
-v /hostpath/pgdata:/var/lib/postgresql/data -p 5432:5432 -d postgres
Best Practices for PostgreSQL image
ü For production install customize the docker image
•  Allocate proper memory limits - example 8GB
•  All pagecache usage shows up as docker container memory usage
•  Bump up shared buffers and other parameters as required
•  Hint: use PostgreSQL 9.3 or later otherwise have to privileged containers
•  http://jkshah.blogspot.com/2015/09/is-it-privilege-to-run-container-in.html
•  Support multiple volumes in your image
•  PITR archives
•  Full Backup directory
•  PostgreSQL Extensions
•  Setup replication support
•  Out of box replication setup
•  Monitoring Tool
•  Your favorite monitoring agent
Some Trends in Container World
ü Binaries and data often separated
•  One lives in Container image and other in Volumes
ü No longer pg_xlog deployed on separate volumes
•  Underlying storage technologies leads to inconsistent point in time restore
causing DB to be unusable
ü  No new table spaces
•  Hard to get easy replication setups done on the fly
•  Could lead to lost data if new tablespaces are not on volumes
ü  Replications setup with automation rather than manually by Admins
Some Trends in Container World
ü Adoption of Micro services
•  Leading to lots of smaller databases for each micro service
ü Faster Updates
•  Schema changes sometimes need to be backward compatible
ü Repeatable Deployments
•  Need to redeploy at a moment’s notice
Kubernetes
ü Production grade container orchestrator
ü Horizontal scaling
•  Setup rules to scale read replicas
ü ConfigMap
•  postgresql.conf
•  pg_hba.conf
ü Secrets
•  Username passwords
•  Certificates
ü Persistent Storage features evolving
•  Plugins for storage drivers
Convenient to access
Kubernetes Services
ü External Services (Virtual or Elastic IP)
•  Services are accessible from all nodes
•  Shared Storage plugins makes your Stateful containers also HA
•  Powerful Combination along with PostgreSQL Replication
•  can spin up fast slaves for multi-TB databases
•  Load balanced over multiple pods
ü For PostgreSQL typical two services
•  master – one node only
•  readreplicas - all read replicas
Consul
•  Service Discovery
•  Failure Detection
•  Multi Data Center
•  DNS Query Interface
{
"service": {
"name": ”mypostgresql",
"tags": ["master"],
"address": "127.0.0.1",
"port": 5432,
"enableTagOverride": false,
}
}
nslookup master.mypostgresql.service.domain
nslookup mypostgresql.service.domain
PostgreSQL Enhancement (Ports)
ü  SRV Record of NameServer
•  https://en.wikipedia.org/wiki/SRV_record
•  IP:Port
ü  PostgreSQL LIBPQ Client Enhancement
•  Support Service Discovery using SRV Records
•  servicename is passed
•  libpq looks up the SRV Record from nameserver
•  Connects port provided by SRV record
Self healing
Modern HA Projects
ü  Patroni / Governor
•  https://github.com/zalando/patroni (Python)
•  Docker container
•  Etcd
•  HAProxy
ü  Stolon
•  https://github.com/sorintlab/stolon (Golang)
•  Docker
•  Etcd /Consul
•  Custom Proxy
Governor
https://github.com/compose/governor/blob/master/postgres-ha.pdf
Stolon
The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your
computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.
https://github.com/sorintlab/stolon/blob/master/doc/architecture_small.png
Basic Architecture
ü  Distributed state management store
•  Etcd, Consul, Zookeeper
ü  Controller – Peer or Central
•  Detect failure
•  Shutdown failed master
•  Elect /Self Elect new master
•  Promote new master
•  Repurpose failed master as slave (PG Rewind)
Limitations
ü  Selection of wrong replicas (lag)
ü  Multi-data center topology
ü  Edge cases
ü  Not completely human free
Deployment of PostgreSQL “Cluster”
ü  Can be made self healing
ü  Integrate with pg_rewind to reuse master as slave
ü  Integrate with shared storage to leverage snapshot create new slaves
Virtual IPs
Applications
Instance 1
Instance 2
Instance 3
Shared
Storage
Deploying Multiple Database Clusters
Applications
Production Grade Orchestrator
ü  Can even add rules to spin up new slaves as for read load
Operations
Applications
Across Geography / Data centers
ü  Uniform DNS name for your database
ü  Cloud-agnostic naming
ü  Certificates created using DNS names you own
ü  No Single Point of Failures
ü  Geography based deployments
Operations
Applications
Graceful
Handling Connections
ü  “Fatal: Database is coming up” - breaks port health checker
ü  Application does not reopen connections – retries not baked in
ü  Session variables lost during switch – rerun environment
Summary
Painpoints for Master-Slave PostgreSQL
ü  Architected to handle failures
ü  Easy to deploy - Single Node
ü  Easy to deploy - Setting up Replicated Node
ü  Convenient to access – Get to current master
ü  Convenient to access – Load Balance readonly Nodes
ü  Convenient to access – DNS single endpoints
ü  Self Managing – Automated Failover
ü  Self Managing – Automated provisioning/reprovisioning
ü  Graceful - Connection Pooling – handling disconnects
Containerized PostgreSQL HAArchitecture
DNS - Consul
Load Balancers – Kubernetes Proxy
Connection pooling: HA Proxy/pgbouncer
Compute Scheduler – Kubernetes
Self/Automated Failover – Patroni/Stolon/Governor
Config /State Management – ETCD, Consul, Zookeeper
Database - PostgreSQL
Instance Format – Docker Containers
Storage – Distributed Storage/Shared Nothing Storage
Your Feedback is Important!
ü  We’d like to understand your use of Postgres for HA / DR.
ü  If interested,
ü  Twitter: @jkshah
ü  Email: jignesh@apporbit.com
Thanks.
Questions?
Follow me on twitter: @jkshah
Blog: http://jkshah.blogspot.com Full copies of your applications
at the push of a button
We are
HIRING !!!

Weitere ähnliche Inhalte

Was ist angesagt?

Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Vietnam Open Infrastructure User Group
 
Getting started with MariaDB with Docker
Getting started with MariaDB with DockerGetting started with MariaDB with Docker
Getting started with MariaDB with DockerMariaDB plc
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google CloudPgDay.Seoul
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerizationBalint Pato
 
Oracle RAC features on Exadata
Oracle RAC features on ExadataOracle RAC features on Exadata
Oracle RAC features on ExadataAnil Nair
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기I Goo Lee
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsAnil Nair
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBMariaDB plc
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Ceph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking ToolCeph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking ToolCeph Community
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기Brian Hong
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfDaniloQueirozMota
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기Amazon Web Services Korea
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationFrancisco Gonçalves
 

Was ist angesagt? (20)

Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
 
Getting started with MariaDB with Docker
Getting started with MariaDB with DockerGetting started with MariaDB with Docker
Getting started with MariaDB with Docker
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Oracle RAC features on Exadata
Oracle RAC features on ExadataOracle RAC features on Exadata
Oracle RAC features on Exadata
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Autoscaling in Kubernetes
Autoscaling in KubernetesAutoscaling in Kubernetes
Autoscaling in Kubernetes
 
Ceph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking ToolCeph Tech Talk -- Ceph Benchmarking Tool
Ceph Tech Talk -- Ceph Benchmarking Tool
 
쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기쿠키런 1년, 서버개발 분투기
쿠키런 1년, 서버개발 분투기
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기
AWS Summit Seoul 2023 | 실시간 CDC 데이터 처리! Modern Transactional Data Lake 구축하기
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 

Andere mochten auch

PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux ContainersJignesh Shah
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and BenchmarksJignesh Shah
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 
asyncio stack for web-development
asyncio stack for web-developmentasyncio stack for web-development
asyncio stack for web-developmentMisha Behersky
 
PostgreSQL Conference: East 08
PostgreSQL Conference: East 08PostgreSQL Conference: East 08
PostgreSQL Conference: East 08Joshua Drake
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyAlexander Kukushkin
 
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"Yandex
 
OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewJignesh Shah
 
SFPUG - DVDStore Performance Benchmark and PostgreSQL
SFPUG - DVDStore Performance Benchmark and PostgreSQLSFPUG - DVDStore Performance Benchmark and PostgreSQL
SFPUG - DVDStore Performance Benchmark and PostgreSQLJignesh Shah
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Grant McAlister
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningUmair Shahid
 
Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile GamesTakuya Ueda
 
Dev smart-contract ethereum
Dev smart-contract ethereumDev smart-contract ethereum
Dev smart-contract ethereumMehdi Amari
 
Best Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual EnvironmentsBest Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual EnvironmentsJignesh Shah
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALEPostgreSQL Experts, Inc.
 
How to customize your linkedin public profile url
How to customize your linkedin public profile urlHow to customize your linkedin public profile url
How to customize your linkedin public profile urlMichael Yublosky
 

Andere mochten auch (20)

PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux Containers
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
OSGI in Java EE servers:Sneak peak
OSGI in Java EE servers:Sneak peakOSGI in Java EE servers:Sneak peak
OSGI in Java EE servers:Sneak peak
 
asyncio stack for web-development
asyncio stack for web-developmentasyncio stack for web-development
asyncio stack for web-development
 
aiohttp intro
aiohttp introaiohttp intro
aiohttp intro
 
PostgreSQL Conference: East 08
PostgreSQL Conference: East 08PostgreSQL Conference: East 08
PostgreSQL Conference: East 08
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"
Виталий Харисов "История создания БЭМ. Кратко, сбивчиво и неполно"
 
OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark Review
 
SFPUG - DVDStore Performance Benchmark and PostgreSQL
SFPUG - DVDStore Performance Benchmark and PostgreSQLSFPUG - DVDStore Performance Benchmark and PostgreSQL
SFPUG - DVDStore Performance Benchmark and PostgreSQL
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuning
 
Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile Games
 
Dev smart-contract ethereum
Dev smart-contract ethereumDev smart-contract ethereum
Dev smart-contract ethereum
 
Best Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual EnvironmentsBest Practices of running PostgreSQL in Virtual Environments
Best Practices of running PostgreSQL in Virtual Environments
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
How to customize your linkedin public profile url
How to customize your linkedin public profile urlHow to customize your linkedin public profile url
How to customize your linkedin public profile url
 

Ähnlich wie PostgreSQL High Availability in a Containerized World

Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresqlbotsplash.com
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkHarold Giménez
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkBryan Ollendyke
 
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VMJames Serra
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPivotalOpenSourceHub
 
Sanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansSanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansPeter Clapham
 
Docking postgres
Docking postgresDocking postgres
Docking postgresrycamor
 
NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5UniFabric
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsLetsConnect
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesJonathan Katz
 
Dr and ha solutions with sql server azure
Dr and ha solutions with sql server azureDr and ha solutions with sql server azure
Dr and ha solutions with sql server azureMSDEVMTL
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!SolarWinds
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukLohika_Odessa_TechTalks
 

Ähnlich wie PostgreSQL High Availability in a Containerized World (20)

Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the Trunk
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 
Implement SQL Server on an Azure VM
Implement SQL Server on an Azure VMImplement SQL Server on an Azure VM
Implement SQL Server on an Azure VM
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh Shah
 
Sanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansSanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticians
 
Flexible compute
Flexible computeFlexible compute
Flexible compute
 
Azure Databases with IaaS
Azure Databases with IaaSAzure Databases with IaaS
Azure Databases with IaaS
 
Azure DBA with IaaS
Azure DBA with IaaSAzure DBA with IaaS
Azure DBA with IaaS
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
 
Docking postgres
Docking postgresDocking postgres
Docking postgres
 
NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
 
Dr and ha solutions with sql server azure
Dr and ha solutions with sql server azureDr and ha solutions with sql server azure
Dr and ha solutions with sql server azure
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys Serdiuk
 

Mehr von Jignesh Shah

Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataJignesh Shah
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper lookJignesh Shah
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseJignesh Shah
 
Tuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentTuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentJignesh Shah
 
Best Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisBest Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisJignesh Shah
 
My experience with embedding PostgreSQL
 My experience with embedding PostgreSQL My experience with embedding PostgreSQL
My experience with embedding PostgreSQLJignesh Shah
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
 
Introduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System AdministratorsIntroduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System AdministratorsJignesh Shah
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsJignesh Shah
 

Mehr von Jignesh Shah (9)

Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper look
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL Universe
 
Tuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentTuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris Environment
 
Best Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisBest Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on Solaris
 
My experience with embedding PostgreSQL
 My experience with embedding PostgreSQL My experience with embedding PostgreSQL
My experience with embedding PostgreSQL
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
 
Introduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System AdministratorsIntroduction to PostgreSQL for System Administrators
Introduction to PostgreSQL for System Administrators
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 

Kürzlich hochgeladen

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

PostgreSQL High Availability in a Containerized World

  • 1. POSTGRESQL HIGH AVAILABILITY IN A CONTAINERIZED WORLD Jignesh Shah Chief Architect
  • 2. About @jkshah ü  appOrbit •  Focus is on data management of applications running in Containers ü  VMware •  Lead and manage Postgres and Data Management teams at VMware for various products embedding PostgreSQL running in virtualized embedded instances ü  Sun Microsystems •  Team Member of first published SpecJAppServer 2004 benchmark with PostgreSQL •  Performance of PostgreSQL on Solaris/Sun Servers ü  Working with PostgreSQL community since 2005 •  http://jkshah.blogspot.com/2005/04/profiling-postgresql-using-dtrace-on_22.html ü  Working with Container technologies (Solaris Zones) since 2004 •  http://jkshah.blogspot.com/2004/08/db2-working-under-solaris-10-zones_30.html
  • 3. About ü  OnDemand Dev/Test Environment Management •  Multi-tiered, multi-serviced application deployment with initial data •  Onprem & multi-cloud •  Snap, Restore, Clone across all tiers ü  Data Services for Applications •  DBaaS for your applications •  Oracle, PostgreSQL, MySQL ü  Test Data Management •  Live data templates, data pipeline workflows •  Data subsets, data masking workflows
  • 5. DB Server Typical Enterprise Application Web Server Web Server App Server App Server Cache ServerCache Server
  • 6. Typical Micro services Application Web ServerWebapp Server Gateway App Server MicroService 1 DB 2 App Server MicroService 2 DB 3 App Server MicroService N
  • 7. Simplified Requirements of DB Service ü Easy, convenient Database service ü High Availability ü High Durability Data Center DNS Name
  • 8. High Availability Requirements ü Requirements •  Recovery Time Objective (RTO) - Availability •  What does 99.99% availability really mean? •  Recovery Point Objective (RPO) - Durability •  Zero data lost? •  HA vs. DR requirements Availability % Downtime / Year Downtime / Month * Downtime / week "Two Nines" - 99% 3.65 Days 7.2 Hours 1.69 Hours "Three Nines" - 99.9% 8.76 Hours 43.2 Minutes 10.1 Minutes "Four Nines" - 99.99% 52.56 Minutes 4.32 Minutes 1.01 Minutes "Five Nines" - 99.999% 5.26 Minutes 25.9 Seconds 6.06 Seconds * Using a 30 day month
  • 9. Causes of Downtime ü  Blame it on Murphy’s Law •  Anything that can go wrong, will go wrong ü  Planned Downtime •  Software upgrade (OS patches, SQL Server cumulative updates) •  Hardware/BIOS upgrade ü  Unplanned Downtime •  Datacenter failure (natural disasters, fire) •  Server failure (failed CPU, bad network card) •  I/O subsystem failure (disk failure, controller failure) •  Software/Data corruption (application bugs, OS binary corruptions) •  User Error (shutdown a SQL service, dropped a table)
  • 10. Distilled HA Requirements ü  Design to handle failures ü  Easy to deploy ü  Convenient to access ü  Self healing/handling of failures ü  Graceful handling
  • 12. Shared Storage based HA ü Leverage Hardware snapshots ü Automated failover - OS Clustering ü DR (across region) using block level replication of snapshots ü Newer designs using distributed shared storage DNS Name
  • 13. Disadvantages of Shared Storage HA ü Expensive ü Mostly DR ü No offloading •  Though possible using storage clones ü No load balancing ü No fast failover •  PostgreSQL server start required DNS Name
  • 14. PostgreSQL Replication ü  Single master, multi-slave •  Cascading slave also possible •  Mechanism based on WAL (Write-Ahead Logs) ü  Multiple modes and multiple recovery ways •  Warm standby •  Asynchronous hot standby •  Synchronous hot standby ü  Fast failover (pg_ctl promote) ü  Load Balancing for read only operations •  Good for read scale ü  Node failover, reconnection possible
  • 15. Synchronous PostgreSQL Replication ü No SPOF Shared Storage ü Faster failover ü High durability ü Best within single datacenter only DNS Name
  • 16. Asynchronous PostgreSQL Replication ü Better performance ü Across datacenters ü Cascading replication ü Tradeoff: Lose transactions DNS Name
  • 17. PostgreSQL Replication - Issues ü  No automated Failover ü  Complex setup •  Reusing failed master as slave (pg_rewind) •  Provisioning new slave with full copy ü  Manual DNS updates for failover ü  Application reconnection required after a failover ü  Separation logic required for Read-Write and Read-Only connections in application Photo Credit: dundanim/ Shutterstock.com
  • 18. Easy to deploy Using Linux Containers
  • 19. What are Containers? ü OS Level virtualization where kernel allows for multiple isolated user- space instances Operating System Bare Metal Server OS Bare Metal Server Hypervisor OS Operating System Bare Metal Server C C C C C OS Bare Metal Server Hypervisor OS C C C C
  • 20. Advantages of Containers ü Lower footprint ü Very Quick Startup and Shutdown ü Density ü Nesting
  • 21. Disadvantages of Containers ü Same Kernel version ü Cannot run other OS natively ü Security (to be improved) ü Not a complete solution for enterprise needs
  • 22. Docker ü Quick Guide to use a docker based container # docker run --name mycontainer –e POSTGRES_PASSWORD=mysecretpassword -d postgres # docker exec -ti mycontainer psql -U postgres # docker stop mycontainer # docker rm mycontainer # docker rmi postgres
  • 23. Container Volumes – Must for DB ü Persists beyond the life of a Docker container •  VOLUME command in Dockerfile or •  Using –v using docker run command •  Automatically created if not already present during docker run •  Not part of docker push/pull operations •  Can select a non-local directory using --volume-driver •  Third party components required to get multi-host support (NFS, etc ) ü Different options using –v •  -v /hostsrc/data:/opt/data:ro # for read only volumes (default rw) •  -v /hostsrc/data:/opt/data:Z # Z – private volume, z – shared volume •  -v /etc/nginx.conf:/etc/nginx.conf # for mounting a single file only
  • 24. PostgreSQL Container as a DB server ü Maybe you want a database server standalone •  Not all database clients will be in the same host •  Need to limit memory usage •  Need different layout of how files are distributed ü Use the –p option to make the port available even to non containers clients ü Use –m to limit memory usage by the DB server (by default it can see and use all) •  Note this does not set shared buffers automatically with the library image docker run --name mycontainer -m 4g -e POSTGRES_PASSWORD=mysecretpassword -v /hostpath/pgdata:/var/lib/postgresql/data -p 5432:5432 -d postgres
  • 25. Best Practices for PostgreSQL image ü For production install customize the docker image •  Allocate proper memory limits - example 8GB •  All pagecache usage shows up as docker container memory usage •  Bump up shared buffers and other parameters as required •  Hint: use PostgreSQL 9.3 or later otherwise have to privileged containers •  http://jkshah.blogspot.com/2015/09/is-it-privilege-to-run-container-in.html •  Support multiple volumes in your image •  PITR archives •  Full Backup directory •  PostgreSQL Extensions •  Setup replication support •  Out of box replication setup •  Monitoring Tool •  Your favorite monitoring agent
  • 26. Some Trends in Container World ü Binaries and data often separated •  One lives in Container image and other in Volumes ü No longer pg_xlog deployed on separate volumes •  Underlying storage technologies leads to inconsistent point in time restore causing DB to be unusable ü  No new table spaces •  Hard to get easy replication setups done on the fly •  Could lead to lost data if new tablespaces are not on volumes ü  Replications setup with automation rather than manually by Admins
  • 27. Some Trends in Container World ü Adoption of Micro services •  Leading to lots of smaller databases for each micro service ü Faster Updates •  Schema changes sometimes need to be backward compatible ü Repeatable Deployments •  Need to redeploy at a moment’s notice
  • 28. Kubernetes ü Production grade container orchestrator ü Horizontal scaling •  Setup rules to scale read replicas ü ConfigMap •  postgresql.conf •  pg_hba.conf ü Secrets •  Username passwords •  Certificates ü Persistent Storage features evolving •  Plugins for storage drivers
  • 30. Kubernetes Services ü External Services (Virtual or Elastic IP) •  Services are accessible from all nodes •  Shared Storage plugins makes your Stateful containers also HA •  Powerful Combination along with PostgreSQL Replication •  can spin up fast slaves for multi-TB databases •  Load balanced over multiple pods ü For PostgreSQL typical two services •  master – one node only •  readreplicas - all read replicas
  • 31. Consul •  Service Discovery •  Failure Detection •  Multi Data Center •  DNS Query Interface { "service": { "name": ”mypostgresql", "tags": ["master"], "address": "127.0.0.1", "port": 5432, "enableTagOverride": false, } } nslookup master.mypostgresql.service.domain nslookup mypostgresql.service.domain
  • 32. PostgreSQL Enhancement (Ports) ü  SRV Record of NameServer •  https://en.wikipedia.org/wiki/SRV_record •  IP:Port ü  PostgreSQL LIBPQ Client Enhancement •  Support Service Discovery using SRV Records •  servicename is passed •  libpq looks up the SRV Record from nameserver •  Connects port provided by SRV record
  • 34. Modern HA Projects ü  Patroni / Governor •  https://github.com/zalando/patroni (Python) •  Docker container •  Etcd •  HAProxy ü  Stolon •  https://github.com/sorintlab/stolon (Golang) •  Docker •  Etcd /Consul •  Custom Proxy
  • 36. Stolon The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. https://github.com/sorintlab/stolon/blob/master/doc/architecture_small.png
  • 37. Basic Architecture ü  Distributed state management store •  Etcd, Consul, Zookeeper ü  Controller – Peer or Central •  Detect failure •  Shutdown failed master •  Elect /Self Elect new master •  Promote new master •  Repurpose failed master as slave (PG Rewind)
  • 38. Limitations ü  Selection of wrong replicas (lag) ü  Multi-data center topology ü  Edge cases ü  Not completely human free
  • 39. Deployment of PostgreSQL “Cluster” ü  Can be made self healing ü  Integrate with pg_rewind to reuse master as slave ü  Integrate with shared storage to leverage snapshot create new slaves Virtual IPs Applications Instance 1 Instance 2 Instance 3 Shared Storage
  • 40. Deploying Multiple Database Clusters Applications
  • 41. Production Grade Orchestrator ü  Can even add rules to spin up new slaves as for read load Operations Applications
  • 42. Across Geography / Data centers ü  Uniform DNS name for your database ü  Cloud-agnostic naming ü  Certificates created using DNS names you own ü  No Single Point of Failures ü  Geography based deployments Operations Applications
  • 44. Handling Connections ü  “Fatal: Database is coming up” - breaks port health checker ü  Application does not reopen connections – retries not baked in ü  Session variables lost during switch – rerun environment
  • 46. Painpoints for Master-Slave PostgreSQL ü  Architected to handle failures ü  Easy to deploy - Single Node ü  Easy to deploy - Setting up Replicated Node ü  Convenient to access – Get to current master ü  Convenient to access – Load Balance readonly Nodes ü  Convenient to access – DNS single endpoints ü  Self Managing – Automated Failover ü  Self Managing – Automated provisioning/reprovisioning ü  Graceful - Connection Pooling – handling disconnects
  • 47. Containerized PostgreSQL HAArchitecture DNS - Consul Load Balancers – Kubernetes Proxy Connection pooling: HA Proxy/pgbouncer Compute Scheduler – Kubernetes Self/Automated Failover – Patroni/Stolon/Governor Config /State Management – ETCD, Consul, Zookeeper Database - PostgreSQL Instance Format – Docker Containers Storage – Distributed Storage/Shared Nothing Storage
  • 48. Your Feedback is Important! ü  We’d like to understand your use of Postgres for HA / DR. ü  If interested, ü  Twitter: @jkshah ü  Email: jignesh@apporbit.com
  • 49. Thanks. Questions? Follow me on twitter: @jkshah Blog: http://jkshah.blogspot.com Full copies of your applications at the push of a button We are HIRING !!!