SlideShare a Scribd company logo
1 of 24
Plaza Semanggi 9 Fl, Unit 9
Jl. Jend Sudirman Kav 50, Jakarta - 12930
+6221-22866662 | info@equnix.asia
I N D O N E S I A
High Availability and Disaster Recovery
in RDBMS/PostgreSQL
By: Julyanto SUTANDANG
This document is owned by Equnix Business Solutions PTE LTD. This document
contains confidential information, which is protected by law. No part of this
publication could be photocopied, reproduced or translated into another language
without permitted or the express written consent of Equnix Business Solutions PTE
LTD.
Data and information regarding the proposal and its offer is for limited use and
are not disclosed. The information contained in this document is subject to change at
any time without prior notice.
All rights reserved, © Copyright 2019 - Equnix Business Solutions, PTE Ltd
Copyright Notice
Service Availability
No Uptime Level
Guarantee
Max Tolerable
Downtime
(in hours)
Supporting
Technology
1 95.00% 438 Cold Standby
2 98.00% 175 Warm Standby
3 99.00% 87,6 Hot Standby
4 99.90% 8,76 High Availability
5 99,999% ~0 Fault Tolerant
What is...
What is High Availability (HA)?
➢ A Constellation of System and effort for achieving Service Availability up to
99,99% (Max: 8,76 accumulated downtime in a year)
➢ HA is NOT LB (Load Balancing)
➢ HA is NOT DR (Disaster Recovery)
➢ It involves OS Level configuration and setup.
➢ HA mitigates: Hardware Failure, Facility outage
➢ HA NOT mitigate: Human failure,
➢ There are many technology to enable HA, some of them is overlapping OR
not actually intended for HA.
High Availability Constellation
HA - PostgreSQL
❖ HA not in-built/in-core in
PostgreSQL
❖ PostgreSQL has native
replication (binary and logical) to
support HA
❖ PostgreSQL has PROMOTION
mechanism from STANDBY into
MASTER.
❖ Split brain is the most avoidance
problem in HA of Database.
❖ Uses OS level Heartbeat:
➢ Pacemaker and Corosync
➢ Patroni
❖ Uses Virtual / Floating IP address,
for failover.
❖ Replication: Binary OR Logical
❖ Replication: Synchronous/Async
HA Constellation
❖ Master - Active
❖ Standby - Passive (Why
Passive?)
❖ Failover with downtime
less than 10 seconds
❖ Master-Standby has
private direct connection
❖ Each Host has Public
Access Network
1
2
3
HA - brigding OS into PostgreSQL
Create PostgreSQL Trigger Script (activate_standby.sh)
# vi /etc/init.d/activate_standby.sh
#!/bin/bash
case $1 in
start)
#touch /equnix/data/trigger_file
#sed -i “s/synchronous_standby_names/#synchronous_standby_names/g” /equnix/data/postgresql.conf
/etc/init.d/postgres.service reload
exit 0
;;
stop)
#sed -i “s/synchronous_standby_names/synchronous_standby_names/g” /equnix/data/postgresql.conf
/etc/init.d/postgres.service reload
;;
*)
exit 0;
esac;
HA - Master Recovery and Follow
What Will Happen Master Recovery?
❖ Master doesn’t failback (auto_failback = off)
❖ Master become new slave (slave already became master)
❖ Master follow new master (in such proper steps)
HA Constellation
Post Failover
❖ Master become Standby and follow new master (Standby)
Load Balancing - just for comparison
PostgreSQL supports
Load balancing, works
in certain condition
only.
OLTP require Scale Up
NOT Scale Out.
HA - Cycle Mode
Cycle Mode (3 or More Replicas)
Same Sites
HA - Cycle Mode
Master Down, Replica 1 Takeover become Master
Same Sites
HA - Cases
Tricky cases in HA Implementation:
1. Master Node down, Standby should
be able to notice and become Master less
than 10 secs. This is a normal operation
of HA.
2. Standby Node down, Master should
be able to notice and ensure the Standby
is shutdown and sends alert.
3. Public Network Master down, Master
can be configure to failover to standby
and shutdown itself gracefully.
4. Private Network down, Standby
ensure Master is down through another
connection and failover OR standby just
shut the replication off; Send Alert.
Disaster Recovery
Disaster Recovery Sites
Disaster Recovery Sites
What is...
What is Disaster Recovery (DR)?
➢ A Configuration of Sites and effort to
mitigate NATURAL DISASTER / Force
Majeure.
➢ Require 2 different sites, with minimum 70
KM or 80 KM (it depends)
➢ DR Swingover is definitely manual and
involving higher level of decision or policy
maker.
➢ There is Escalation Protocol should be
follow therefore, it is not technical decision.
What is...
What is Disaster Recovery (DR)?
➢ Swingover is done per site basis, NOT
per host or service basis.
➢ DR mitigates: Natural Disaster (Flood,
Fire, Earthquake, meteor (?) etc), and
other force majeure: Riots, Facility
shutdown, War, etc.
➢ DR NOT mitigate: Hardware Failure,
Human mistakes, facility outage, ...
Disaster Recovery
Disaster Recovery Configuration
Disaster Recovery
DC Site got disaster, manual Swingover by mgmt decision.
Who we are
As an IT Solutions Provider, we are committed to deliver services
Maintenance
Services
1. PostgreSQL
2. Linux OS
3. Open Source
Managed
Services
1. PostgreSQL
2. Linux OS
3. Open Source
System Optimization
Expertise (assessment,
consultation, advices,
solutions)
1. Any kind of IT
System which
require performance
fix and solutions
2. Network
3. Security
4. etc
High Performance
Software
Development
1. World class quality
2. High throughput
and high transactions
Hands-On Training
1. Linux Administration
(Basic and Advanced)
2. PostgreSQL
(Basic and Advanced)
3. High Performance
Transaction System
Our Proud Clients
Questions?

More Related Content

What's hot

Improve PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateImprove PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateBobby Curtis
 
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)NTT DATA Technology & Innovation
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Grant McAlister
 
MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較Shinya Sugiyama
 
Oracle - Checklist for performance issues
Oracle - Checklist for performance issuesOracle - Checklist for performance issues
Oracle - Checklist for performance issuesMarkus Flechtner
 
Webinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanWebinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanGabriele Bartolini
 
Dbts2013 特濃jpoug log_file_sync
Dbts2013 特濃jpoug log_file_syncDbts2013 特濃jpoug log_file_sync
Dbts2013 特濃jpoug log_file_syncKoji Shinkubo
 
MySQLメインの人がPostgreSQLのベンチマークをしてみた話
MySQLメインの人がPostgreSQLのベンチマークをしてみた話MySQLメインの人がPostgreSQLのベンチマークをしてみた話
MySQLメインの人がPostgreSQLのベンチマークをしてみた話hiroi10
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceMariaDB plc
 
DAT202_Getting started with Amazon Aurora
DAT202_Getting started with Amazon AuroraDAT202_Getting started with Amazon Aurora
DAT202_Getting started with Amazon AuroraAmazon Web Services
 
Introduction to Greenplum
Introduction to GreenplumIntroduction to Greenplum
Introduction to GreenplumDave Cramer
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsMydbops
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)Kenny Gryp
 
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!NTT DATA Technology & Innovation
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)Keisuke Takahashi
 
Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎Masayuki Ozawa
 
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)Hironobu Suzuki
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 

What's hot (20)

Improve PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateImprove PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGate
 
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)
PostgreSQL13でのレプリケーション関連の改善について(第14回PostgreSQLアンカンファレンス@オンライン)
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022
 
MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較
 
Oracle - Checklist for performance issues
Oracle - Checklist for performance issuesOracle - Checklist for performance issues
Oracle - Checklist for performance issues
 
Webinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with BarmanWebinar: PostgreSQL continuous backup and PITR with Barman
Webinar: PostgreSQL continuous backup and PITR with Barman
 
Dbts2013 特濃jpoug log_file_sync
Dbts2013 特濃jpoug log_file_syncDbts2013 特濃jpoug log_file_sync
Dbts2013 特濃jpoug log_file_sync
 
MySQLメインの人がPostgreSQLのベンチマークをしてみた話
MySQLメインの人がPostgreSQLのベンチマークをしてみた話MySQLメインの人がPostgreSQLのベンチマークをしてみた話
MySQLメインの人がPostgreSQLのベンチマークをしてみた話
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
 
DAT202_Getting started with Amazon Aurora
DAT202_Getting started with Amazon AuroraDAT202_Getting started with Amazon Aurora
DAT202_Getting started with Amazon Aurora
 
Introduction to Greenplum
Introduction to GreenplumIntroduction to Greenplum
Introduction to Greenplum
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
 
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)
pg_standbyの今後について(第19回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
Azure Database for PostgreSQL 入門 (PostgreSQL Conference Japan 2021)
 
Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎Sql server のバックアップとリストアの基礎
Sql server のバックアップとリストアの基礎
 
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 

Similar to High Availability and Disaster Recovery in PostgreSQL - EQUNIX

Data Compass Presentation
Data Compass PresentationData Compass Presentation
Data Compass PresentationSalvationDATA
 
Data Compass Introduction (Best Data Recovery Equipment)
Data Compass Introduction (Best Data Recovery Equipment)Data Compass Introduction (Best Data Recovery Equipment)
Data Compass Introduction (Best Data Recovery Equipment)Leon Xue
 
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky Haryadi
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky HaryadiPGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky Haryadi
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky HaryadiEqunix Business Solutions
 
Jonathan Frappier – Challenge 2 Design Solution
Jonathan Frappier – Challenge 2 Design SolutionJonathan Frappier – Challenge 2 Design Solution
Jonathan Frappier – Challenge 2 Design Solutiontovmug
 
Oracle presentations RAC dataguard active database
Oracle presentations RAC dataguard active databaseOracle presentations RAC dataguard active database
Oracle presentations RAC dataguard active databasemabessisindu
 
ETSI NFV#13 NFV resiliency presentation - ali kafel - stratus
ETSI NFV#13   NFV resiliency presentation - ali kafel - stratusETSI NFV#13   NFV resiliency presentation - ali kafel - stratus
ETSI NFV#13 NFV resiliency presentation - ali kafel - stratusAli Kafel
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesAlexander Penev
 
Comparing the TCO of HP NonStop with Oracle RAC
Comparing the TCO of HP NonStop with Oracle RACComparing the TCO of HP NonStop with Oracle RAC
Comparing the TCO of HP NonStop with Oracle RACThomas Burg
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replicationMasao Fujii
 
Oracle to PostgreSQL, Challenges to Opportunity.pdf
Oracle to PostgreSQL, Challenges to Opportunity.pdfOracle to PostgreSQL, Challenges to Opportunity.pdf
Oracle to PostgreSQL, Challenges to Opportunity.pdfEqunix Business Solutions
 
Business Track Session 1: The Power of udp
Business Track Session 1: The Power of udpBusiness Track Session 1: The Power of udp
Business Track Session 1: The Power of udparcserve data protection
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...VirtualTech Japan Inc.
 
Audax Group: CIO Perspectives - Managing The Copy Data Explosion
Audax Group: CIO Perspectives - Managing The Copy Data ExplosionAudax Group: CIO Perspectives - Managing The Copy Data Explosion
Audax Group: CIO Perspectives - Managing The Copy Data Explosionactifio
 
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios Server
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios ServerNagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios Server
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios ServerNagios
 
Appliance Launch Webcast
Appliance Launch WebcastAppliance Launch Webcast
Appliance Launch WebcastGina Tragos
 
Real-Time Query for Data Guard
Real-Time Query for Data Guard Real-Time Query for Data Guard
Real-Time Query for Data Guard Uwe Hesse
 

Similar to High Availability and Disaster Recovery in PostgreSQL - EQUNIX (20)

Data Compass Presentation
Data Compass PresentationData Compass Presentation
Data Compass Presentation
 
Data Compass Introduction (Best Data Recovery Equipment)
Data Compass Introduction (Best Data Recovery Equipment)Data Compass Introduction (Best Data Recovery Equipment)
Data Compass Introduction (Best Data Recovery Equipment)
 
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky Haryadi
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky HaryadiPGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky Haryadi
PGConf.ASIA 2019 - High Availability, 10 Seconds Failover - Lucky Haryadi
 
Jonathan Frappier – Challenge 2 Design Solution
Jonathan Frappier – Challenge 2 Design SolutionJonathan Frappier – Challenge 2 Design Solution
Jonathan Frappier – Challenge 2 Design Solution
 
dgintro (1).ppt
dgintro (1).pptdgintro (1).ppt
dgintro (1).ppt
 
Oracle presentations RAC dataguard active database
Oracle presentations RAC dataguard active databaseOracle presentations RAC dataguard active database
Oracle presentations RAC dataguard active database
 
ETSI NFV#13 NFV resiliency presentation - ali kafel - stratus
ETSI NFV#13   NFV resiliency presentation - ali kafel - stratusETSI NFV#13   NFV resiliency presentation - ali kafel - stratus
ETSI NFV#13 NFV resiliency presentation - ali kafel - stratus
 
TRT - Plate Spin Presentation
TRT - Plate Spin PresentationTRT - Plate Spin Presentation
TRT - Plate Spin Presentation
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 
Comparing the TCO of HP NonStop with Oracle RAC
Comparing the TCO of HP NonStop with Oracle RACComparing the TCO of HP NonStop with Oracle RAC
Comparing the TCO of HP NonStop with Oracle RAC
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
Oracle to PostgreSQL, Challenges to Opportunity.pdf
Oracle to PostgreSQL, Challenges to Opportunity.pdfOracle to PostgreSQL, Challenges to Opportunity.pdf
Oracle to PostgreSQL, Challenges to Opportunity.pdf
 
Business Track Session 1: The Power of udp
Business Track Session 1: The Power of udpBusiness Track Session 1: The Power of udp
Business Track Session 1: The Power of udp
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
 
CS_10_DR_CFD
CS_10_DR_CFDCS_10_DR_CFD
CS_10_DR_CFD
 
Audax Group: CIO Perspectives - Managing The Copy Data Explosion
Audax Group: CIO Perspectives - Managing The Copy Data ExplosionAudax Group: CIO Perspectives - Managing The Copy Data Explosion
Audax Group: CIO Perspectives - Managing The Copy Data Explosion
 
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios Server
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios ServerNagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios Server
Nagios Conference 2013 - Spenser Reinhardt - Securing Your Nagios Server
 
Appliance Launch Webcast
Appliance Launch WebcastAppliance Launch Webcast
Appliance Launch Webcast
 
Real-Time Query for Data Guard
Real-Time Query for Data Guard Real-Time Query for Data Guard
Real-Time Query for Data Guard
 
Commercial track 1_The Power of UDP
Commercial track 1_The Power of UDPCommercial track 1_The Power of UDP
Commercial track 1_The Power of UDP
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

High Availability and Disaster Recovery in PostgreSQL - EQUNIX

  • 1. Plaza Semanggi 9 Fl, Unit 9 Jl. Jend Sudirman Kav 50, Jakarta - 12930 +6221-22866662 | info@equnix.asia I N D O N E S I A High Availability and Disaster Recovery in RDBMS/PostgreSQL By: Julyanto SUTANDANG
  • 2. This document is owned by Equnix Business Solutions PTE LTD. This document contains confidential information, which is protected by law. No part of this publication could be photocopied, reproduced or translated into another language without permitted or the express written consent of Equnix Business Solutions PTE LTD. Data and information regarding the proposal and its offer is for limited use and are not disclosed. The information contained in this document is subject to change at any time without prior notice. All rights reserved, © Copyright 2019 - Equnix Business Solutions, PTE Ltd Copyright Notice
  • 3. Service Availability No Uptime Level Guarantee Max Tolerable Downtime (in hours) Supporting Technology 1 95.00% 438 Cold Standby 2 98.00% 175 Warm Standby 3 99.00% 87,6 Hot Standby 4 99.90% 8,76 High Availability 5 99,999% ~0 Fault Tolerant
  • 4. What is... What is High Availability (HA)? ➢ A Constellation of System and effort for achieving Service Availability up to 99,99% (Max: 8,76 accumulated downtime in a year) ➢ HA is NOT LB (Load Balancing) ➢ HA is NOT DR (Disaster Recovery) ➢ It involves OS Level configuration and setup. ➢ HA mitigates: Hardware Failure, Facility outage ➢ HA NOT mitigate: Human failure, ➢ There are many technology to enable HA, some of them is overlapping OR not actually intended for HA.
  • 6. HA - PostgreSQL ❖ HA not in-built/in-core in PostgreSQL ❖ PostgreSQL has native replication (binary and logical) to support HA ❖ PostgreSQL has PROMOTION mechanism from STANDBY into MASTER. ❖ Split brain is the most avoidance problem in HA of Database. ❖ Uses OS level Heartbeat: ➢ Pacemaker and Corosync ➢ Patroni ❖ Uses Virtual / Floating IP address, for failover. ❖ Replication: Binary OR Logical ❖ Replication: Synchronous/Async
  • 7. HA Constellation ❖ Master - Active ❖ Standby - Passive (Why Passive?) ❖ Failover with downtime less than 10 seconds ❖ Master-Standby has private direct connection ❖ Each Host has Public Access Network 1 2 3
  • 8. HA - brigding OS into PostgreSQL Create PostgreSQL Trigger Script (activate_standby.sh) # vi /etc/init.d/activate_standby.sh #!/bin/bash case $1 in start) #touch /equnix/data/trigger_file #sed -i “s/synchronous_standby_names/#synchronous_standby_names/g” /equnix/data/postgresql.conf /etc/init.d/postgres.service reload exit 0 ;; stop) #sed -i “s/synchronous_standby_names/synchronous_standby_names/g” /equnix/data/postgresql.conf /etc/init.d/postgres.service reload ;; *) exit 0; esac;
  • 9. HA - Master Recovery and Follow What Will Happen Master Recovery? ❖ Master doesn’t failback (auto_failback = off) ❖ Master become new slave (slave already became master) ❖ Master follow new master (in such proper steps)
  • 10. HA Constellation Post Failover ❖ Master become Standby and follow new master (Standby)
  • 11. Load Balancing - just for comparison PostgreSQL supports Load balancing, works in certain condition only. OLTP require Scale Up NOT Scale Out.
  • 12. HA - Cycle Mode Cycle Mode (3 or More Replicas) Same Sites
  • 13. HA - Cycle Mode Master Down, Replica 1 Takeover become Master Same Sites
  • 14. HA - Cases Tricky cases in HA Implementation: 1. Master Node down, Standby should be able to notice and become Master less than 10 secs. This is a normal operation of HA. 2. Standby Node down, Master should be able to notice and ensure the Standby is shutdown and sends alert. 3. Public Network Master down, Master can be configure to failover to standby and shutdown itself gracefully. 4. Private Network down, Standby ensure Master is down through another connection and failover OR standby just shut the replication off; Send Alert.
  • 18. What is... What is Disaster Recovery (DR)? ➢ A Configuration of Sites and effort to mitigate NATURAL DISASTER / Force Majeure. ➢ Require 2 different sites, with minimum 70 KM or 80 KM (it depends) ➢ DR Swingover is definitely manual and involving higher level of decision or policy maker. ➢ There is Escalation Protocol should be follow therefore, it is not technical decision.
  • 19. What is... What is Disaster Recovery (DR)? ➢ Swingover is done per site basis, NOT per host or service basis. ➢ DR mitigates: Natural Disaster (Flood, Fire, Earthquake, meteor (?) etc), and other force majeure: Riots, Facility shutdown, War, etc. ➢ DR NOT mitigate: Hardware Failure, Human mistakes, facility outage, ...
  • 21. Disaster Recovery DC Site got disaster, manual Swingover by mgmt decision.
  • 22. Who we are As an IT Solutions Provider, we are committed to deliver services Maintenance Services 1. PostgreSQL 2. Linux OS 3. Open Source Managed Services 1. PostgreSQL 2. Linux OS 3. Open Source System Optimization Expertise (assessment, consultation, advices, solutions) 1. Any kind of IT System which require performance fix and solutions 2. Network 3. Security 4. etc High Performance Software Development 1. World class quality 2. High throughput and high transactions Hands-On Training 1. Linux Administration (Basic and Advanced) 2. PostgreSQL (Basic and Advanced) 3. High Performance Transaction System