Pingu
Computer MySQL PostgreSQL Books Publications
Spielereien Kanu Geopolitik Business TopoDB POI Klettersteigen History TransPool Thermal Baden Brokenstuben Goldwaschen
Blog Contact
Shinguz
Google
/ch/open

PostgreSQL Replication

/ home / computer / postgresql / postgresql for mysql admins / .

Table of Contents

Details
  1. Physical Replication

    • Preparation
    • Set-up
    • Operations
    • Monitoring
    • Failover
    • Advanced topics
  2. Logical Replication

  3. PostgreSQL high availability setups

    • Reasons for high availability
    • Availability / fail-over
    • Reporting replica
    • Backup replica?
    • Read scale-out?
    • Delayed replica?
    • Upgrade path

Physical Replication

Also called “Write-Ahead Log Shipping”. Can be synchronous or asynchronous. Implemented using file-based log shipping or streaming replication.

Logical Replication

PostgreSQL high availability setups

Cluster manager

Patroni

Based on PostgreSQL (physical) Streaming Replication (async or sync).

Patroni + etcd HaProxy PgBouncer

etcd or Zookeeper

https://www.dbi-services.com/blog/setup-a-two-node-postgres-ha-cluster-using-edb-advanced-server-and-efm/ https://indico.cern.ch/event/1471762/contributions/6280213/attachments/2998599/5283395/P-DBI-E-20240323-PGconf-Architecture-for-Seamless-PostgreSQL-Upgrades.pdf https://www.dbi-services.com/blog/the-dbi-services-postgresql-reference-architecture-1-the-commercial-approach/ https://www.dbi-services.com/blog/the-dbi-services-postgresql-reference-architecture-2-the-community-approach/

Proxy / Load balancer

PostgreSQL 16 Brings Native Load Balancing to libpq for Improved Scalability https://medium.com/@mydbopsdatabasemanagement/postgresql-16-brings-native-load-balancing-to-libpq-for-improved-scalability-54a0a2588552

https://dhamaniasad.github.io/awesome-postgres/ https://github.com/stars/tbussmann/lists/postgresql

mails von daniel und tobias

Pgpool-II

https://www.pgpool.net/docs/latest/en/html/example-cluster.html

Based on PostgreSQL Streaming Replication

Slony-I

(outdated?) https://www.slony.info/ https://wiki.postgresql.org/wiki/Slony

HAproxy

ProxySQL

https://proxysql.com/documentation/proxysql-configuration-postgresql/

Spock pgEdge (Enterprise) https://docs.pgedge.com/spock-v5/development/install_spock/#creating-a-replication-scenario

EDB Failover manager

https://www.reddit.com/r/PostgreSQL/comments/1j0chnt/what_solution_do_you_use_for_automatic_failover/

Introduction to pg_auto_failover (Citus) https://pg-auto-failover.readthedocs.io/en/main/intro.html

Repmgr https://wiki.postgresql.org/wiki/Repmgr