SlideShare a Scribd company logo
Online upgrade using
logical replication
Florin Irion
8 December 2020
#postgresbuild2020
Whoami?
florin.irion@enterprisedb.com
@irionr
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.3
Agenda
• PostgreSQL releases
• Upgrade options
• What is Pglogical
• Major upgrades
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.4
Why
Upgrade? ● Security
● Features
● Dba/management
● Performance
● SQL standard
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.5
Release
Cadence
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.6
EOL
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.7
About
Minor
Updates
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.8
About
Major
Upgrades
● Logical dump/restore
● Trigger-based replication (not anymore) - e.g.
Londiste
● pg_upgrade
● Native logical streaming replication
○ publisher/subscriber
○ Pglogical extension
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.9
About
Major
Upgrades
● Logical dump/restore
● Trigger-based replication (not anymore) - e.g.
Londiste
● pg_upgrade
● Native logical streaming replication
○ publisher/subscriber
○ Pglogical extension
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.10
Pglogical
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.11
Pglogical
vs
Logical
Replication
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.12
Upgrading
with
pglogical
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.13
What are we
missing by
using
PostgreSQL 9.5?
https://why-upgrade.depesz.com/
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.14
Missing
Features
● Parallel Aggregates
● Parallel sequential scans
● Declarative partitioning
● SCRAM Authentication
● Just In Time (JIT) compilation
● Parallel creation of index
● Stored Procedures
● Reindex concurrently
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.15
Nomenclature
and
conventions
● Node -- Postgresql database instance
● Provider -- sending node
● Subscriber -- receiver node
● Replication Set -- rule
● Subscription -- one subscriber makes to the
provider.
● pg95 pg13 -- my hostnames
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.16
Requirements
● Primary key
● Table schema
● Table definition
● Constraints
● Global objects
● UNLOGGED and TEMPORARY
● DDL
○ replicate_ddl_command()
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.17
Installation
PostgreSQL 9.5: yum install postgresql95-pglogical
PostgreSQL 13: yum install postgresql13-pglogical
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.18
Configuration Postgresql.conf
shared_preload_libraries = 'pglogical'
wal_level = 'logical'
max_worker_processes = 10
max_wal_senders = 10
max_replication_slots = 10
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.19
Pg_hba.conf
Local replication pglogical md5
Local dbname pglogical md5
Host replication pglogical pg13_ip_add/0 md5
Host dbname pglogical pg13_ip_add/0 md5
Authentication
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.20
Create
extension
and nodes
CREATE EXTENSION pglogical;
SELECT pglogical.create_node (
node_name: = 'provider1',
dsn: = 'host = pg95 port = 5432 dbname = db'
);
CREATE EXTENSION pglogical;
SELECT pglogical.create_node (
node_name: = 'subscriber1',
dsn: = 'host = pg13 port = 5432 dbname = db'
);
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.21
Add tables
and
sequences
SELECT pglogical.replication_set_add_all_tables (
set_name := 'default',
schema_names := ARRAY ['public']
);
SELECT pglogical.replication_set_add_all_sequences
(
set_name : = 'default',
schema_names : = ARRAY ['public']
);
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.22
Create
subscription
SELECT pglogical.create_subscription(
subscription_name := 'my_subscription',
provider_dsn := 'host = pg95
port = 5432
dbname = db',
);
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.23
pglogical.create_subscription(
subscription_name name,
provider_dsn text,
replication_sets text[],
synchronize_structure boolean,
synchronize_data boolean,
forward_origins text[],
apply_delay interval
);
Create
subscription
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.24
Check SELECT subscription_name, status
FROM pglogical.show_subscription_status();
subscription_name | status
------------------------+-------------
my_subscription | replicating
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.25
Repeat
CREATE EXTENSION pglogical;
SELECT pglogical.create_node (...'provider'...);
SELECT pglogical.create_node (...'subscriber'...);
SELECT pglogical.create_subscription(...);
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.26
Testing and
application
testing
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.27
Cutover/
Switch
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.28
Post-switch
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.29
Conclusions
• Pglogical is my preferred major upgrade method
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.30
Conclusions
• Start simple and test everything
TEST! TEST! TEST!
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.31
Conclusions
• Pglogical 3
● Replication slot failover support
● REPLICA IDENTITY FULL
● DDL
● Performance
● Kafka and Rabbitmq
● Partitions
● Conflict detection
● Conflict resolution
● No SUPERUSER
● Statistics
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.32
Conclusions
• Kubernetes and Cloud Native friendly
Thank you!
Questions?
@irionr
www.enterprisedb.com/contact

More Related Content

What's hot

Webinar: Managing Postgres at Scale
Webinar: Managing Postgres at ScaleWebinar: Managing Postgres at Scale
Webinar: Managing Postgres at Scale
EDB
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
EDB
 
PostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate InnovationPostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate Innovation
EDB
 
Automating a PostgreSQL High Availability Architecture with Ansible
Automating a PostgreSQL High Availability Architecture with AnsibleAutomating a PostgreSQL High Availability Architecture with Ansible
Automating a PostgreSQL High Availability Architecture with Ansible
EDB
 
EDB Failover Manager - Features and Demo
EDB Failover Manager - Features and DemoEDB Failover Manager - Features and Demo
EDB Failover Manager - Features and Demo
EDB
 
A Peek in the Elephant's Trunk
A Peek in the Elephant's TrunkA Peek in the Elephant's Trunk
A Peek in the Elephant's Trunk
EDB
 
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
Ontico
 
Apache Ignite: In-Memory Hammer for Your Data Science Toolkit
Apache Ignite: In-Memory Hammer for Your Data Science ToolkitApache Ignite: In-Memory Hammer for Your Data Science Toolkit
Apache Ignite: In-Memory Hammer for Your Data Science Toolkit
Denis Magda
 
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoTApache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
Denis Magda
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
Evans Ye
 
Json and Jsonpath in Postgres 12
Json and Jsonpath in Postgres 12Json and Jsonpath in Postgres 12
Json and Jsonpath in Postgres 12
EDB
 
Whats New in Postgres 12
Whats New in Postgres 12Whats New in Postgres 12
Whats New in Postgres 12
EDB
 
Automating Postgres Deployments on AWS and VMware, with Terraform and Ansible
Automating Postgres Deployments on AWS and VMware, with Terraform and AnsibleAutomating Postgres Deployments on AWS and VMware, with Terraform and Ansible
Automating Postgres Deployments on AWS and VMware, with Terraform and Ansible
EDB
 
New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13
EDB
 
How to Monitor Postgres Like a Pro!
How to Monitor Postgres Like a Pro!How to Monitor Postgres Like a Pro!
How to Monitor Postgres Like a Pro!
EDB
 
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQLHow-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
YugabyteDB
 
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
EDB
 
PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!
EDB
 
Building Effective Apache Geode Applications with Spring Data GemFire
Building Effective Apache Geode Applications with Spring Data GemFireBuilding Effective Apache Geode Applications with Spring Data GemFire
Building Effective Apache Geode Applications with Spring Data GemFire
John Blum
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on Linux
EDB
 

What's hot (20)

Webinar: Managing Postgres at Scale
Webinar: Managing Postgres at ScaleWebinar: Managing Postgres at Scale
Webinar: Managing Postgres at Scale
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
 
PostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate InnovationPostgreSQL to Accelerate Innovation
PostgreSQL to Accelerate Innovation
 
Automating a PostgreSQL High Availability Architecture with Ansible
Automating a PostgreSQL High Availability Architecture with AnsibleAutomating a PostgreSQL High Availability Architecture with Ansible
Automating a PostgreSQL High Availability Architecture with Ansible
 
EDB Failover Manager - Features and Demo
EDB Failover Manager - Features and DemoEDB Failover Manager - Features and Demo
EDB Failover Manager - Features and Demo
 
A Peek in the Elephant's Trunk
A Peek in the Elephant's TrunkA Peek in the Elephant's Trunk
A Peek in the Elephant's Trunk
 
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
The Future of Postgres Sharding / Bruce Momjian (PostgreSQL)
 
Apache Ignite: In-Memory Hammer for Your Data Science Toolkit
Apache Ignite: In-Memory Hammer for Your Data Science ToolkitApache Ignite: In-Memory Hammer for Your Data Science Toolkit
Apache Ignite: In-Memory Hammer for Your Data Science Toolkit
 
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoTApache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
 
Json and Jsonpath in Postgres 12
Json and Jsonpath in Postgres 12Json and Jsonpath in Postgres 12
Json and Jsonpath in Postgres 12
 
Whats New in Postgres 12
Whats New in Postgres 12Whats New in Postgres 12
Whats New in Postgres 12
 
Automating Postgres Deployments on AWS and VMware, with Terraform and Ansible
Automating Postgres Deployments on AWS and VMware, with Terraform and AnsibleAutomating Postgres Deployments on AWS and VMware, with Terraform and Ansible
Automating Postgres Deployments on AWS and VMware, with Terraform and Ansible
 
New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13New and Improved Features in PostgreSQL 13
New and Improved Features in PostgreSQL 13
 
How to Monitor Postgres Like a Pro!
How to Monitor Postgres Like a Pro!How to Monitor Postgres Like a Pro!
How to Monitor Postgres Like a Pro!
 
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQLHow-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
How-To: Zero Downtime Migrations from Oracle to a Cloud-Native PostgreSQL
 
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
Introducing Data Redaction - an enabler to data security in EDB Postgres Adva...
 
PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!
 
Building Effective Apache Geode Applications with Spring Data GemFire
Building Effective Apache Geode Applications with Spring Data GemFireBuilding Effective Apache Geode Applications with Spring Data GemFire
Building Effective Apache Geode Applications with Spring Data GemFire
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on Linux
 

Similar to Online Upgrade Using Logical Replication

Improve PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateImprove PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGate
Bobby Curtis
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryCodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
Márton Kodok
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_TutorialVibhor Kumar
 
EDB: Power to Postgres
EDB: Power to PostgresEDB: Power to Postgres
EDB: Power to Postgres
Ashnikbiz
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
Stephane Carrez
 
PGday_korea_2021_leeuijin
PGday_korea_2021_leeuijinPGday_korea_2021_leeuijin
PGday_korea_2021_leeuijin
의진 이
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
EDB
 
Guob consolidation implementation11gr2
Guob consolidation implementation11gr2Guob consolidation implementation11gr2
Guob consolidation implementation11gr2Rodrigo Almeida
 
Enterprise-class security with PostgreSQL - 2
Enterprise-class security with PostgreSQL - 2Enterprise-class security with PostgreSQL - 2
Enterprise-class security with PostgreSQL - 2
Ashnikbiz
 
CISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentCISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 Development
Brad Rippe
 
Sprint 45 review
Sprint 45 reviewSprint 45 review
Sprint 45 review
ManageIQ
 
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
PivotalOpenSourceHub
 
When it all GOes right
When it all GOes rightWhen it all GOes right
When it all GOes right
Pavlo Golub
 
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
Equnix Business Solutions
 
2-day-dba-oracle.pptx
2-day-dba-oracle.pptx2-day-dba-oracle.pptx
2-day-dba-oracle.pptx
Rocky572078
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuery
Márton Kodok
 
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Milomir Vojvodic
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Morgan Tocker
 

Similar to Online Upgrade Using Logical Replication (20)

Improve PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateImprove PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGate
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
 
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQueryCodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
CodeCamp Iasi - Creating serverless data analytics system on GCP using BigQuery
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
 
PGEncryption_Tutorial
PGEncryption_TutorialPGEncryption_Tutorial
PGEncryption_Tutorial
 
EDB: Power to Postgres
EDB: Power to PostgresEDB: Power to Postgres
EDB: Power to Postgres
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
 
PGday_korea_2021_leeuijin
PGday_korea_2021_leeuijinPGday_korea_2021_leeuijin
PGday_korea_2021_leeuijin
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
Guob consolidation implementation11gr2
Guob consolidation implementation11gr2Guob consolidation implementation11gr2
Guob consolidation implementation11gr2
 
Enterprise-class security with PostgreSQL - 2
Enterprise-class security with PostgreSQL - 2Enterprise-class security with PostgreSQL - 2
Enterprise-class security with PostgreSQL - 2
 
CISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 DevelopmentCISOA Conference 2020 Banner 9 Development
CISOA Conference 2020 Banner 9 Development
 
Sprint 45 review
Sprint 45 reviewSprint 45 review
Sprint 45 review
 
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
#GeodeSummit - Large Scale Fraud Detection using GemFire Integrated with Gree...
 
When it all GOes right
When it all GOes rightWhen it all GOes right
When it all GOes right
 
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
PGConf.ASIA 2019 Bali - How did PostgreSQL Write Load Balancing of Queries Us...
 
2-day-dba-oracle.pptx
2-day-dba-oracle.pptx2-day-dba-oracle.pptx
2-day-dba-oracle.pptx
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuery
 
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 

More from EDB

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 

More from EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

Online Upgrade Using Logical Replication

  • 1. Online upgrade using logical replication Florin Irion 8 December 2020 #postgresbuild2020
  • 3. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.3 Agenda • PostgreSQL releases • Upgrade options • What is Pglogical • Major upgrades
  • 4. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.4 Why Upgrade? ● Security ● Features ● Dba/management ● Performance ● SQL standard
  • 5. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.5 Release Cadence
  • 6. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.6 EOL
  • 7. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.7 About Minor Updates
  • 8. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.8 About Major Upgrades ● Logical dump/restore ● Trigger-based replication (not anymore) - e.g. Londiste ● pg_upgrade ● Native logical streaming replication ○ publisher/subscriber ○ Pglogical extension
  • 9. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.9 About Major Upgrades ● Logical dump/restore ● Trigger-based replication (not anymore) - e.g. Londiste ● pg_upgrade ● Native logical streaming replication ○ publisher/subscriber ○ Pglogical extension
  • 10. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.10 Pglogical
  • 11. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.11 Pglogical vs Logical Replication
  • 12. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.12 Upgrading with pglogical
  • 13. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.13 What are we missing by using PostgreSQL 9.5? https://why-upgrade.depesz.com/
  • 14. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.14 Missing Features ● Parallel Aggregates ● Parallel sequential scans ● Declarative partitioning ● SCRAM Authentication ● Just In Time (JIT) compilation ● Parallel creation of index ● Stored Procedures ● Reindex concurrently
  • 15. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.15 Nomenclature and conventions ● Node -- Postgresql database instance ● Provider -- sending node ● Subscriber -- receiver node ● Replication Set -- rule ● Subscription -- one subscriber makes to the provider. ● pg95 pg13 -- my hostnames
  • 16. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.16 Requirements ● Primary key ● Table schema ● Table definition ● Constraints ● Global objects ● UNLOGGED and TEMPORARY ● DDL ○ replicate_ddl_command()
  • 17. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.17 Installation PostgreSQL 9.5: yum install postgresql95-pglogical PostgreSQL 13: yum install postgresql13-pglogical
  • 18. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.18 Configuration Postgresql.conf shared_preload_libraries = 'pglogical' wal_level = 'logical' max_worker_processes = 10 max_wal_senders = 10 max_replication_slots = 10
  • 19. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.19 Pg_hba.conf Local replication pglogical md5 Local dbname pglogical md5 Host replication pglogical pg13_ip_add/0 md5 Host dbname pglogical pg13_ip_add/0 md5 Authentication
  • 20. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.20 Create extension and nodes CREATE EXTENSION pglogical; SELECT pglogical.create_node ( node_name: = 'provider1', dsn: = 'host = pg95 port = 5432 dbname = db' ); CREATE EXTENSION pglogical; SELECT pglogical.create_node ( node_name: = 'subscriber1', dsn: = 'host = pg13 port = 5432 dbname = db' );
  • 21. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.21 Add tables and sequences SELECT pglogical.replication_set_add_all_tables ( set_name := 'default', schema_names := ARRAY ['public'] ); SELECT pglogical.replication_set_add_all_sequences ( set_name : = 'default', schema_names : = ARRAY ['public'] );
  • 22. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.22 Create subscription SELECT pglogical.create_subscription( subscription_name := 'my_subscription', provider_dsn := 'host = pg95 port = 5432 dbname = db', );
  • 23. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.23 pglogical.create_subscription( subscription_name name, provider_dsn text, replication_sets text[], synchronize_structure boolean, synchronize_data boolean, forward_origins text[], apply_delay interval ); Create subscription
  • 24. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.24 Check SELECT subscription_name, status FROM pglogical.show_subscription_status(); subscription_name | status ------------------------+------------- my_subscription | replicating
  • 25. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.25 Repeat CREATE EXTENSION pglogical; SELECT pglogical.create_node (...'provider'...); SELECT pglogical.create_node (...'subscriber'...); SELECT pglogical.create_subscription(...);
  • 26. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.26 Testing and application testing
  • 27. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.27 Cutover/ Switch
  • 28. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.28 Post-switch
  • 29. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.29 Conclusions • Pglogical is my preferred major upgrade method
  • 30. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.30 Conclusions • Start simple and test everything TEST! TEST! TEST!
  • 31. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.31 Conclusions • Pglogical 3 ● Replication slot failover support ● REPLICA IDENTITY FULL ● DDL ● Performance ● Kafka and Rabbitmq ● Partitions ● Conflict detection ● Conflict resolution ● No SUPERUSER ● Statistics
  • 32. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.32 Conclusions • Kubernetes and Cloud Native friendly