SlideShare a Scribd company logo
Module-1
PostgreSQL Replication
Module Objective
 Introduction to Replication
 Reasons for Replication
 Master/Slave Configuration
 Warm/Hot Standby
 Types of Replication
 Replication Modes
 Models of Replication
Introduction to Replication
 The Process of copying data from a PostgreSQL
database server to another server is called PostgreSQL
Replication.
 The intend is one or more standby servers ready to take
over operations if the primary server fails.
 The Source database server which sends the data is
usually called the Master server.
 The Server receiving the copied data is called
the Replica/Standby server.
Why Replication?
 High availability: refers to the ability of having an up to date copy of
your database at all times. This means that in the event of a failure of
your main database, the standby copy can be promoted to main and you
can start receiving traffic.
 Load balancing: practice of distributing incoming requests to your
application in a way that is balanced so that no particular database
experiences an uneven workload. With replication, this is possible since
multiple copies of the data exist at any point in time.
 Disaster recovery: is the need for effective disaster recovery in the event
of a systemic failure.
 Data Migration: To upgrade database server hardware or patches.
Master/Slave Configuration
Hot Standby
Master Server Slave Server
Warm Standby
Build in Replication Types
 Physical Replication:
File-based log shipping
Streaming replication
Physical replication replicate all databases.
Cannot Replicate between two different major versions or platforms.
 Logical Replication:
Replicating data objects and their changes based upon their
replication identity (usually a primary key).
Support table-level data synchronization.
Consolidating multiple databases into one single entity. (Analytics)
Replication Modes
 Asynchronous Mode of Replication
Transactions on the master server can be declared complete when the
changes have been done on just the master server.
These changes are then replicated to the replicas later in time.
The replica servers can remain out-of-sync for a certain duration, which
is called a replication lag.
 Synchronous Mode of Replication
Transactions on the master database are declared complete only when
those changes have been replicated to all the replicas.
Replica servers must all be available all the time for the transactions to
complete on the master.
Replication Modes
Replication Models
 Single-Master Replication
Changes to table rows in a designated master database server are replicated
to one or more replica servers.
The replicated tables in the replica database are not permitted to accept any
changes (except from the master).
Single-Master Replication is also called unidirectional, since replication
data flows in one direction only, from master to replica.
 Multi-Master Replication
Changes to table rows in more than one designated master database are
replicated to their counterpart tables in every other master database.
In this model conflict resolution schemes are often employed to avoid
problems like duplicate primary keys.
Multi-Master Replication is also called bidirectional, Since replication data
flows in both the directions.
Thank you. 

More Related Content

PDF
Replication with postgres and Getting started with Logical Replication
PPTX
PG_Phsycal_logical_study_Replication.pptx
PDF
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
PPTX
Built in physical and logical replication in postgresql-Firat Gulec
PDF
PostgreSQL Replication High Availability Methods
PDF
PostgreSQL replication
PPTX
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
PDF
Demystifying postgres logical replication percona live sc
Replication with postgres and Getting started with Logical Replication
PG_Phsycal_logical_study_Replication.pptx
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Built in physical and logical replication in postgresql-Firat Gulec
PostgreSQL Replication High Availability Methods
PostgreSQL replication
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
Demystifying postgres logical replication percona live sc

Similar to Postgresql_Replication.pptx (20)

PDF
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
PDF
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PDF
Postgres Vienna DB Meetup 2014
PDF
Replication in PostgreSQL tutorial given in Postgres Conference 2019
PDF
PostgreSQL replication
ODP
PostgreSQL Replication in 10 Minutes - SCALE
PDF
Logical Replication in PostgreSQL - FLOSSUK 2016
PPT
High Availbilty In Sql Server
PPTX
Logical Replication in PostgreSQL
 
PPT
arch_mtg_sqlsig_hcotter_replication.ppt
PPT
18 philbe replication stanford99
PPTX
Replication Techniques for Distributed Database Design
PPTX
Database replication
PPTX
Replication in Distributed Real Time Database
PDF
PGConf.ASIA 2019 Bali - Fault Tolerance in PostgreSQL - Muhammad Haroon
PDF
PGConf.ASIA 2017 Logical Replication Internals (English)
PDF
[Altibase] 9 replication part2 (methods and controls)
PDF
Built-in Replication in PostgreSQL
PPTX
SQLBits 2008 - SQL Server High Availability and Disaster Recovery Overview - ...
PPTX
Drop the Pressure on your Production Server
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
Postgres Vienna DB Meetup 2014
Replication in PostgreSQL tutorial given in Postgres Conference 2019
PostgreSQL replication
PostgreSQL Replication in 10 Minutes - SCALE
Logical Replication in PostgreSQL - FLOSSUK 2016
High Availbilty In Sql Server
Logical Replication in PostgreSQL
 
arch_mtg_sqlsig_hcotter_replication.ppt
18 philbe replication stanford99
Replication Techniques for Distributed Database Design
Database replication
Replication in Distributed Real Time Database
PGConf.ASIA 2019 Bali - Fault Tolerance in PostgreSQL - Muhammad Haroon
PGConf.ASIA 2017 Logical Replication Internals (English)
[Altibase] 9 replication part2 (methods and controls)
Built-in Replication in PostgreSQL
SQLBits 2008 - SQL Server High Availability and Disaster Recovery Overview - ...
Drop the Pressure on your Production Server
Ad

Recently uploaded (20)

PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Introduction to Information and Communication Technology
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPTX
Internet___Basics___Styled_ presentation
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
Funds Management Learning Material for Beg
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
introduction about ICD -10 & ICD-11 ppt.pptx
Introuction about ICD -10 and ICD-11 PPT.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Job_Card_System_Styled_lorem_ipsum_.pptx
Introduction to Information and Communication Technology
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
presentation_pfe-universite-molay-seltan.pptx
Module 1 - Cyber Law and Ethics 101.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
QR Codes Qr codecodecodecodecocodedecodecode
Internet___Basics___Styled_ presentation
Paper PDF World Game (s) Great Redesign.pdf
Unit-1 introduction to cyber security discuss about how to secure a system
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
Funds Management Learning Material for Beg
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Ad

Postgresql_Replication.pptx

  • 2. Module Objective  Introduction to Replication  Reasons for Replication  Master/Slave Configuration  Warm/Hot Standby  Types of Replication  Replication Modes  Models of Replication
  • 3. Introduction to Replication  The Process of copying data from a PostgreSQL database server to another server is called PostgreSQL Replication.  The intend is one or more standby servers ready to take over operations if the primary server fails.  The Source database server which sends the data is usually called the Master server.  The Server receiving the copied data is called the Replica/Standby server.
  • 4. Why Replication?  High availability: refers to the ability of having an up to date copy of your database at all times. This means that in the event of a failure of your main database, the standby copy can be promoted to main and you can start receiving traffic.  Load balancing: practice of distributing incoming requests to your application in a way that is balanced so that no particular database experiences an uneven workload. With replication, this is possible since multiple copies of the data exist at any point in time.  Disaster recovery: is the need for effective disaster recovery in the event of a systemic failure.  Data Migration: To upgrade database server hardware or patches.
  • 5. Master/Slave Configuration Hot Standby Master Server Slave Server Warm Standby
  • 6. Build in Replication Types  Physical Replication: File-based log shipping Streaming replication Physical replication replicate all databases. Cannot Replicate between two different major versions or platforms.  Logical Replication: Replicating data objects and their changes based upon their replication identity (usually a primary key). Support table-level data synchronization. Consolidating multiple databases into one single entity. (Analytics)
  • 7. Replication Modes  Asynchronous Mode of Replication Transactions on the master server can be declared complete when the changes have been done on just the master server. These changes are then replicated to the replicas later in time. The replica servers can remain out-of-sync for a certain duration, which is called a replication lag.  Synchronous Mode of Replication Transactions on the master database are declared complete only when those changes have been replicated to all the replicas. Replica servers must all be available all the time for the transactions to complete on the master.
  • 9. Replication Models  Single-Master Replication Changes to table rows in a designated master database server are replicated to one or more replica servers. The replicated tables in the replica database are not permitted to accept any changes (except from the master). Single-Master Replication is also called unidirectional, since replication data flows in one direction only, from master to replica.  Multi-Master Replication Changes to table rows in more than one designated master database are replicated to their counterpart tables in every other master database. In this model conflict resolution schemes are often employed to avoid problems like duplicate primary keys. Multi-Master Replication is also called bidirectional, Since replication data flows in both the directions.