SlideShare a Scribd company logo
Die 10 besten
PostgreSQL-Replikati
onsstrategien für Ihr
Unternehmen
Borys Neselovskyi | Sales Engineer, EDB
23 March 2022
© Copyright EnterpriseDB Corporation, 2021. All rights reserved.
2
Agenda
• How physical and logical replication works in
PostgreSQL
• Differences between synchronous and
asynchronous replication
• Advantages, disadvantages and challenges in
multi-master replication
• Which replication strategy is more suitable to
different use cases.
1) Yes
2) No
POLL:
Do you currently have external
professional support for your
databases?
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Replication/HA options (10 solutions/variations)
● Shared disk failover
● File System (block device) replication
● WAL shipping: Archiving
● WAL shipping: Streaming replication
● WAL shipping with Synchronous commit
● Native logical replication
● Trigger based Primary-Standby replication
● SQL-based Replication Middleware
● Asynchronous multi-master Replication
● Synchronous multi-master Replication
Legend:
Native Postgres
External tooling
https://www.postgresql.org/docs/14/diffe
rent-replication-solutions.html
No products mentioned:
None forgotten
1) None
2) Native WAL archiving
3) Native WAL streaming
4) Native synchronous commit
5) Native logical replication
6) 3rd party replication solution: Replicated disks replication
7) 3rd party replication solution: Multi-master replication
POLL:
Which replication solution are you
currently using?
“
“If your data is important enough to
replicate, then you should also ensure
professional support for the databases.”
Michael Willer
EDB
“
“Your Data is important. That is why it is crucial to keep data
redundant and save. Configuration of High Availability
Landscapes can be very complex and should be well planned.
Therefore, you should make sure that you have competent and
well-trained personal and professional support for your
databases.”
How PostgreSQL works
postgres (main) postgres (clients)
checkpointer
background writer wal writer
autovacuum launcher
stats collector logical replication launcher
MEMORY
(shared buffers, wal buffers, work mem,
maintenance work mem, ..)
Data files
WAL files
“archive_command”
WAL files
not here
Shared disk & Disk replication
Network disk
(data,wal,...)
Postgres
processes
VM1
Postgres install
standby
VM2
Postgres
processes
VM2
Disk Replication
Network disk
Postgres install
standby
VM3
Postgres install
standby
VM4
File corruption is a major concern
“Cold standby”
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Evaluation
Good:
No overhead on primary
“Easy” to set up for the DBA
Can’t lose a transaction (RPO=0?)
Shared disk / Disk replication
Use case
Well, ….? It works
Bad:
- Any failover starts with the database going
into recovery before opening (RTO might be
high)
- Only one server actually accesses the data
- Disk replication has to be perfect (all
updates done in the correct order)
- Data corruption in one place
= data corruption everywhere
WAL Shipping: Archiving
Transaction commits
Transaction commits
Transaction commits
DB switches to new WAL file
archive_command is run
(copies file to shared disk)
Waiting for new WAL files
(checking local pg_wal, running
restore_command, ….)
restore_command picks up new file
(copies file to pg_wal)
New transactions are applied
1 2
3
4 5
2
1
3
4 5
Shared archive
disk
DB01 DB02
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Evaluation
Good:
Very low impact on primary server.
Standby can be used for read/only queries (that
don’t need up-to-date information).
WAL Shipping: Archiving
Use case
Easy way to get a copy of the database
Standby doesn’t have to be up-to-date to the
“minute”
Good solution when communication between
the databases isn’t possible due to network. Bad:
Risk of data loss
(checkpoints frequency can be increased -
within reason)
WAL Shipping: Streaming
Physical blocks
Primary database
wal sender
Standby database
wal receiver
Shared disk
W
AL archiving
W
AL restore
Transaction commits
1 2
1 2
Transferred and applied
Transaction commits
Transferred and applied
Asynchronous
DB01 DB02
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Evaluation
Good:
Minor impact on primary server
Standby is almost up-to-date (read/only queries)
RPO close to 0 (“almost” no data loss)
WAL Shipping: Streaming
Use case
Good for almost all Postgres workloads.
Standby is (almost) identical to the primary
database.
Bad:
Still a risk of data loss (though a lot smaller
than with WAL archiving)
Communication between servers is needed
WAL Shipping: Streaming (a.k.a. synchronous commit)
Physical blocks
Primary database
wal sender
Standby database
wal receiver
Shared disk
W
AL archiving
W
AL restore
Transaction commits
1 2
1 2
Transferred and applied
Transaction commits
Transferred and applied
Synchronous
DB01 DB02
2022 Copyright © EnterpriseDB Corporation All Rights Reserved
Synchronous Replication
Settings
Parameter synchronous_standby_names:
FIRST 1 (dtm)
FIRST 1 (dtm, ber)
ANY 2 (dtm, ber, lej)
Parameter synchronous_commit:
off/local/remote_write/on/remote_apply
FRA
DTM LEJ
BER
2022 Copyright © EnterpriseDB Corporation All Rights Reserved
Reduce data loss → synchronous replication
17
…
Shared Buffers
WAL buffers
…
…
Data Directory WAL
Data Directory
WAL
…
Shared Buffers
WAL
receiver
…
WAL
Sender
…
local
on on
remote_write
remote_apply
commit…
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Evaluation
Good:
As asynchronous streaming
RPO=0 (no data loss)
WAL Shipping: Synchronous commit
Use case
Same as asynchronous streaming
+ need the standby to be fully up-to-date
Bad:
If standby is unavailable - all commits hang
(adding more databases is a workaround, see
synchronous_server_names for information)
Native logical replication
logical
Primary database
Logical publisher
wal sender (decode)
(“START_REPLICATION”)
Primary database
Logical subscriber
logical replication
worker
Transaction commits
1 2
1 2
Transferred and applied
Transaction commits
Transferred and applied
(A)synchronous
DB01 DB02
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Evaluation
Good:
Replicating a select set of tables
Low impact on publishing server
Native logical replication
Use case
One or more or tables replicated.
Can span postgres versions and OS
(Major version upgrades)
Consolidate several data sources to one
(BI/Reporting server)
INSERT/UPDATE/DELETE/TRUNCATE
Bad:
No DDL replication
No conflict resolution
REPLICATION IDENTITY is required for updates.
(insert is fine without).
The final four…
● Trigger based Primary-Standby replication
● SQL-based Replication Middleware
● Asynchronous Multimaster Replication
● Synchronous Multimaster Replication
All are non-native
Trigger-based replication
Good:
Easy to understand and (sometimes) easy to set up.
01001
10101
10110
11011
01110
11011
01111
Triggers capture data changes
(Something) picks up the changes and
pushes them to the other database(s).
Bad:
Tends to be fragile
Tends to be slower than WAL-decoding solutions
“Something”
SQL-based replication
Good:
Easy to understand and (sometimes) easy to set up.
Can provide read-only routing as well
DB01 DB02
Proxy captures data changes
Replicates all updates to other servers
Bad:
Which SQL is an update?
Which isn’t?
SQL-proxy
Execute
and
reply R
e
p
l
i
c
a
t
e
S
Q
L
INSERT INTO ….
UPDATE …..
TRUNCATE …
CREATE TABLE
DROP TABLE
….
??????
SELECT myfunction();
??????
Multi-master, active/active, …
Good:
Highly available.
Applications can access and update any DB
Scalable (to a degree).
Bad:
Can be difficult to configure (get assistance)
Distributed systems are generally complex.
No distributed locks (SELECT FOR UPDATE, …)
Beware of conflicts!
(The chosen solution must have solid conflict
handling and avoidance)
Fully synchronous multi-master currently not
available, though some products have synchronous
features
1) None
2) Native WAL archiving
3) Native WAL streaming
4) Native synchronous commit
5) Native logical replication
6) 3rd party replication solution: Replicated disks replication
7) 3rd party replication solution: Multi-master replication
POLL:
Which replication solution would you
want to use?
2022 Copyright © EnterpriseDB Corporation All Rights Reserved
References
Demo script for replication
Script to demo the different types of
replication.
Replication Engine Potpourri
A comparison of several replication
solutions, strengths and weaknesses.
Defining High Availability
A walk-through of what High Availability
looks like for Postgres clusters.
Nominally Bidirectional
Blog post about a setup that you should
never do, and why it doesn’t work
Q&A
2021 Copyright © EnterpriseDB Corporation All Rights Reserved
Thank you for joining!
As a thank you for attending, we’ll be
running a prize draw for a €25 voucher!
Keep an eye on your inbox to see if you’re
the lucky winner.
Borys Neselovskyi
borys.neselovskyi@enterprisedb.com
linkedin.com/in/neselovskyi/
You can find more information at:
http://enterprisedb.com
info@enterprisedb.com

More Related Content

What's hot

Bare-metal performance for Big Data workloads on Docker containers
Bare-metal performance for Big Data workloads on Docker containersBare-metal performance for Big Data workloads on Docker containers
Bare-metal performance for Big Data workloads on Docker containers
BlueData, Inc.
 
Deploying Big-Data-as-a-Service (BDaaS) in the Enterprise
Deploying Big-Data-as-a-Service (BDaaS) in the EnterpriseDeploying Big-Data-as-a-Service (BDaaS) in the Enterprise
Deploying Big-Data-as-a-Service (BDaaS) in the Enterprise
Big-Data-as-a-Service (BDaaS) Meetup
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWS
EDB
 
Expert Guide to Migrating Legacy Databases to Postgres
Expert Guide to Migrating Legacy Databases to PostgresExpert Guide to Migrating Legacy Databases to Postgres
Expert Guide to Migrating Legacy Databases to Postgres
EDB
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
EDB
 
EDB Postgres with Containers
EDB Postgres with ContainersEDB Postgres with Containers
EDB Postgres with Containers
EDB
 
Data Grids with Oracle Coherence
Data Grids with Oracle CoherenceData Grids with Oracle Coherence
Data Grids with Oracle Coherence
Ben Stopford
 
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnikbiz
 
Oracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for ConsolidationOracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for Consolidation
Yudi Herdiana
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and Backups
EDB
 
Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014
Joelith
 
Enterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional DatabasesEnterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional Databases
Ashnikbiz
 
Migration DB2 to EDB - Project Experience
 Migration DB2 to EDB - Project Experience Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
EDB
 
Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for Postgres Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for Postgres
EDB
 
Best practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on KubernetesBest practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on Kubernetes
MariaDB plc
 
Overcoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQLOvercoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQL
EDB
 
Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017
Bob Ward
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
EDB
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for 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
 

What's hot (20)

Bare-metal performance for Big Data workloads on Docker containers
Bare-metal performance for Big Data workloads on Docker containersBare-metal performance for Big Data workloads on Docker containers
Bare-metal performance for Big Data workloads on Docker containers
 
Deploying Big-Data-as-a-Service (BDaaS) in the Enterprise
Deploying Big-Data-as-a-Service (BDaaS) in the EnterpriseDeploying Big-Data-as-a-Service (BDaaS) in the Enterprise
Deploying Big-Data-as-a-Service (BDaaS) in the Enterprise
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWS
 
Expert Guide to Migrating Legacy Databases to Postgres
Expert Guide to Migrating Legacy Databases to PostgresExpert Guide to Migrating Legacy Databases to Postgres
Expert Guide to Migrating Legacy Databases to Postgres
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
 
EDB Postgres with Containers
EDB Postgres with ContainersEDB Postgres with Containers
EDB Postgres with Containers
 
Data Grids with Oracle Coherence
Data Grids with Oracle CoherenceData Grids with Oracle Coherence
Data Grids with Oracle Coherence
 
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
 
Oracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for ConsolidationOracle Database 12c Multitenant for Consolidation
Oracle Database 12c Multitenant for Consolidation
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and Backups
 
Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014
 
Enterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional DatabasesEnterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional Databases
 
Migration DB2 to EDB - Project Experience
 Migration DB2 to EDB - Project Experience Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
 
Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for Postgres Beginner's Guide to High Availability for Postgres
Beginner's Guide to High Availability for Postgres
 
Best practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on KubernetesBest practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on Kubernetes
 
Overcoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQLOvercoming write availability challenges of PostgreSQL
Overcoming write availability challenges of PostgreSQL
 
Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017Keep your environment always on with sql server 2016 sql bits 2017
Keep your environment always on with sql server 2016 sql bits 2017
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
 
Public Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQLPublic Sector Virtual Town Hall: High Availability for PostgreSQL
Public Sector Virtual Town Hall: High Availability for PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 

Similar to Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen

Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Toronto-Oracle-Users-Group
 
SQL Server Cluster Presentation
SQL Server Cluster PresentationSQL Server Cluster Presentation
SQL Server Cluster Presentationwebhostingguy
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always ondilip nayak
 
Living with the Oracle Database Appliance
Living with the Oracle Database ApplianceLiving with the Oracle Database Appliance
Living with the Oracle Database Appliance
Simon Haslam
 
2007-05-23 Cecchet_PGCon2007.ppt
2007-05-23 Cecchet_PGCon2007.ppt2007-05-23 Cecchet_PGCon2007.ppt
2007-05-23 Cecchet_PGCon2007.ppt
nadirpervez2
 
OVH Lab - Enterprise Cloud Databases
OVH Lab - Enterprise Cloud DatabasesOVH Lab - Enterprise Cloud Databases
OVH Lab - Enterprise Cloud Databases
OVHcloud
 
How swift is your Swift - SD.pptx
How swift is your Swift - SD.pptxHow swift is your Swift - SD.pptx
How swift is your Swift - SD.pptx
OpenStack Foundation
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
LarryZaman
 
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
Continuent
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL Server
Rafał Hryniewski
 
Presentation on Large Scale Data Management
Presentation on Large Scale Data ManagementPresentation on Large Scale Data Management
Presentation on Large Scale Data Management
Chris Bunch
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
Hadoop User Group
 
Hadoop installation by santosh nage
Hadoop installation by santosh nageHadoop installation by santosh nage
Hadoop installation by santosh nage
Santosh Nage
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
Bob Ward
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features" Anar Godjaev
 
Knowledge share about scalable application architecture
Knowledge share about scalable application architectureKnowledge share about scalable application architecture
Knowledge share about scalable application architecture
AHM Pervej Kabir
 
Oracle Database 12c : Multitenant
Oracle Database 12c : MultitenantOracle Database 12c : Multitenant
Oracle Database 12c : Multitenant
Digicomp Academy Suisse Romande SA
 
Clustering van IT-componenten
Clustering van IT-componentenClustering van IT-componenten
Clustering van IT-componenten
Richard Claassens CIPPE
 
High availability solutions bakostech
High availability solutions bakostechHigh availability solutions bakostech
High availability solutions bakostech
Viktoria Bakos
 

Similar to Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen (20)

Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
 
SQL Server Cluster Presentation
SQL Server Cluster PresentationSQL Server Cluster Presentation
SQL Server Cluster Presentation
 
Sql 2012 always on
Sql 2012 always onSql 2012 always on
Sql 2012 always on
 
Living with the Oracle Database Appliance
Living with the Oracle Database ApplianceLiving with the Oracle Database Appliance
Living with the Oracle Database Appliance
 
2007-05-23 Cecchet_PGCon2007.ppt
2007-05-23 Cecchet_PGCon2007.ppt2007-05-23 Cecchet_PGCon2007.ppt
2007-05-23 Cecchet_PGCon2007.ppt
 
OVH Lab - Enterprise Cloud Databases
OVH Lab - Enterprise Cloud DatabasesOVH Lab - Enterprise Cloud Databases
OVH Lab - Enterprise Cloud Databases
 
How swift is your Swift - SD.pptx
How swift is your Swift - SD.pptxHow swift is your Swift - SD.pptx
How swift is your Swift - SD.pptx
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
 
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
New VMware Continuent 5.0 - A powerful and cost-efficient Oracle GoldenGate a...
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL Server
 
Presentation on Large Scale Data Management
Presentation on Large Scale Data ManagementPresentation on Large Scale Data Management
Presentation on Large Scale Data Management
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Hadoop installation by santosh nage
Hadoop installation by santosh nageHadoop installation by santosh nage
Hadoop installation by santosh nage
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
 
Knowledge share about scalable application architecture
Knowledge share about scalable application architectureKnowledge share about scalable application architecture
Knowledge share about scalable application architecture
 
Oracle Database 12c : Multitenant
Oracle Database 12c : MultitenantOracle Database 12c : Multitenant
Oracle Database 12c : Multitenant
 
Clustering van IT-componenten
Clustering van IT-componentenClustering van IT-componenten
Clustering van IT-componenten
 
High availability solutions bakostech
High availability solutions bakostechHigh availability solutions bakostech
High availability solutions bakostech
 

More from 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
 
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
 
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
 
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
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City ProjectEDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City Project
EDB
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from OracleMigrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
EDB
 

More from EDB (20)

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
 
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
 
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
 
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
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City ProjectEDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City Project
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from OracleMigrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
 

Recently uploaded

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 

Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen

  • 1. Die 10 besten PostgreSQL-Replikati onsstrategien für Ihr Unternehmen Borys Neselovskyi | Sales Engineer, EDB 23 March 2022
  • 2. © Copyright EnterpriseDB Corporation, 2021. All rights reserved. 2 Agenda • How physical and logical replication works in PostgreSQL • Differences between synchronous and asynchronous replication • Advantages, disadvantages and challenges in multi-master replication • Which replication strategy is more suitable to different use cases.
  • 3. 1) Yes 2) No POLL: Do you currently have external professional support for your databases?
  • 4. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Replication/HA options (10 solutions/variations) ● Shared disk failover ● File System (block device) replication ● WAL shipping: Archiving ● WAL shipping: Streaming replication ● WAL shipping with Synchronous commit ● Native logical replication ● Trigger based Primary-Standby replication ● SQL-based Replication Middleware ● Asynchronous multi-master Replication ● Synchronous multi-master Replication Legend: Native Postgres External tooling https://www.postgresql.org/docs/14/diffe rent-replication-solutions.html No products mentioned: None forgotten
  • 5. 1) None 2) Native WAL archiving 3) Native WAL streaming 4) Native synchronous commit 5) Native logical replication 6) 3rd party replication solution: Replicated disks replication 7) 3rd party replication solution: Multi-master replication POLL: Which replication solution are you currently using?
  • 6. “ “If your data is important enough to replicate, then you should also ensure professional support for the databases.” Michael Willer EDB
  • 7. “ “Your Data is important. That is why it is crucial to keep data redundant and save. Configuration of High Availability Landscapes can be very complex and should be well planned. Therefore, you should make sure that you have competent and well-trained personal and professional support for your databases.”
  • 8. How PostgreSQL works postgres (main) postgres (clients) checkpointer background writer wal writer autovacuum launcher stats collector logical replication launcher MEMORY (shared buffers, wal buffers, work mem, maintenance work mem, ..) Data files WAL files “archive_command” WAL files not here
  • 9. Shared disk & Disk replication Network disk (data,wal,...) Postgres processes VM1 Postgres install standby VM2 Postgres processes VM2 Disk Replication Network disk Postgres install standby VM3 Postgres install standby VM4 File corruption is a major concern “Cold standby”
  • 10. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Evaluation Good: No overhead on primary “Easy” to set up for the DBA Can’t lose a transaction (RPO=0?) Shared disk / Disk replication Use case Well, ….? It works Bad: - Any failover starts with the database going into recovery before opening (RTO might be high) - Only one server actually accesses the data - Disk replication has to be perfect (all updates done in the correct order) - Data corruption in one place = data corruption everywhere
  • 11. WAL Shipping: Archiving Transaction commits Transaction commits Transaction commits DB switches to new WAL file archive_command is run (copies file to shared disk) Waiting for new WAL files (checking local pg_wal, running restore_command, ….) restore_command picks up new file (copies file to pg_wal) New transactions are applied 1 2 3 4 5 2 1 3 4 5 Shared archive disk DB01 DB02
  • 12. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Evaluation Good: Very low impact on primary server. Standby can be used for read/only queries (that don’t need up-to-date information). WAL Shipping: Archiving Use case Easy way to get a copy of the database Standby doesn’t have to be up-to-date to the “minute” Good solution when communication between the databases isn’t possible due to network. Bad: Risk of data loss (checkpoints frequency can be increased - within reason)
  • 13. WAL Shipping: Streaming Physical blocks Primary database wal sender Standby database wal receiver Shared disk W AL archiving W AL restore Transaction commits 1 2 1 2 Transferred and applied Transaction commits Transferred and applied Asynchronous DB01 DB02
  • 14. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Evaluation Good: Minor impact on primary server Standby is almost up-to-date (read/only queries) RPO close to 0 (“almost” no data loss) WAL Shipping: Streaming Use case Good for almost all Postgres workloads. Standby is (almost) identical to the primary database. Bad: Still a risk of data loss (though a lot smaller than with WAL archiving) Communication between servers is needed
  • 15. WAL Shipping: Streaming (a.k.a. synchronous commit) Physical blocks Primary database wal sender Standby database wal receiver Shared disk W AL archiving W AL restore Transaction commits 1 2 1 2 Transferred and applied Transaction commits Transferred and applied Synchronous DB01 DB02
  • 16. 2022 Copyright © EnterpriseDB Corporation All Rights Reserved Synchronous Replication Settings Parameter synchronous_standby_names: FIRST 1 (dtm) FIRST 1 (dtm, ber) ANY 2 (dtm, ber, lej) Parameter synchronous_commit: off/local/remote_write/on/remote_apply FRA DTM LEJ BER
  • 17. 2022 Copyright © EnterpriseDB Corporation All Rights Reserved Reduce data loss → synchronous replication 17 … Shared Buffers WAL buffers … … Data Directory WAL Data Directory WAL … Shared Buffers WAL receiver … WAL Sender … local on on remote_write remote_apply commit…
  • 18. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Evaluation Good: As asynchronous streaming RPO=0 (no data loss) WAL Shipping: Synchronous commit Use case Same as asynchronous streaming + need the standby to be fully up-to-date Bad: If standby is unavailable - all commits hang (adding more databases is a workaround, see synchronous_server_names for information)
  • 19. Native logical replication logical Primary database Logical publisher wal sender (decode) (“START_REPLICATION”) Primary database Logical subscriber logical replication worker Transaction commits 1 2 1 2 Transferred and applied Transaction commits Transferred and applied (A)synchronous DB01 DB02
  • 20. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Evaluation Good: Replicating a select set of tables Low impact on publishing server Native logical replication Use case One or more or tables replicated. Can span postgres versions and OS (Major version upgrades) Consolidate several data sources to one (BI/Reporting server) INSERT/UPDATE/DELETE/TRUNCATE Bad: No DDL replication No conflict resolution REPLICATION IDENTITY is required for updates. (insert is fine without).
  • 21. The final four… ● Trigger based Primary-Standby replication ● SQL-based Replication Middleware ● Asynchronous Multimaster Replication ● Synchronous Multimaster Replication All are non-native
  • 22. Trigger-based replication Good: Easy to understand and (sometimes) easy to set up. 01001 10101 10110 11011 01110 11011 01111 Triggers capture data changes (Something) picks up the changes and pushes them to the other database(s). Bad: Tends to be fragile Tends to be slower than WAL-decoding solutions “Something”
  • 23. SQL-based replication Good: Easy to understand and (sometimes) easy to set up. Can provide read-only routing as well DB01 DB02 Proxy captures data changes Replicates all updates to other servers Bad: Which SQL is an update? Which isn’t? SQL-proxy Execute and reply R e p l i c a t e S Q L INSERT INTO …. UPDATE ….. TRUNCATE … CREATE TABLE DROP TABLE …. ?????? SELECT myfunction(); ??????
  • 24. Multi-master, active/active, … Good: Highly available. Applications can access and update any DB Scalable (to a degree). Bad: Can be difficult to configure (get assistance) Distributed systems are generally complex. No distributed locks (SELECT FOR UPDATE, …) Beware of conflicts! (The chosen solution must have solid conflict handling and avoidance) Fully synchronous multi-master currently not available, though some products have synchronous features
  • 25. 1) None 2) Native WAL archiving 3) Native WAL streaming 4) Native synchronous commit 5) Native logical replication 6) 3rd party replication solution: Replicated disks replication 7) 3rd party replication solution: Multi-master replication POLL: Which replication solution would you want to use?
  • 26. 2022 Copyright © EnterpriseDB Corporation All Rights Reserved References Demo script for replication Script to demo the different types of replication. Replication Engine Potpourri A comparison of several replication solutions, strengths and weaknesses. Defining High Availability A walk-through of what High Availability looks like for Postgres clusters. Nominally Bidirectional Blog post about a setup that you should never do, and why it doesn’t work
  • 27. Q&A
  • 28. 2021 Copyright © EnterpriseDB Corporation All Rights Reserved Thank you for joining! As a thank you for attending, we’ll be running a prize draw for a €25 voucher! Keep an eye on your inbox to see if you’re the lucky winner.
  • 29. Borys Neselovskyi borys.neselovskyi@enterprisedb.com linkedin.com/in/neselovskyi/ You can find more information at: http://enterprisedb.com info@enterprisedb.com