SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
PostgreSQL Replication
T
o
r
o
n
t
o
P
U
G   Steven Singer
    ssinger_pg@sympatico.ca
    FreeNode: stevenSn

                              July 28 2008
Who am I
T   SELECT * FROM pg_user where name='Steve'
o
r   ●   PostgreSQL user since 6.5
o   ●   Author of contrib/dbmirror
n       included with 7.x
t   ●   Software developer for a local
o       consulting company
P
U
    ●   Occasional contributor to side
        projects
G
The Golden Rule
T
o
r   ●   You can't have everything
o   ●   What you want != what you
n       need
t   ●   Determine need from
o       requirements
P
U
    ●   Be prepared to accept trade-
        offs
G
    ●   If you've already been sold on
        Oracle RAC, go and buy RAC
The Choices
T
o                         pgcluster
                                         pl/proxy
r               slony
                          pgcluster-II
                                         Mammoth
o          dbmirror                       RepDB
n       longdist                          Bucardo
t   pgpool
                                          Cybercluster

o   pgpool-II
                                              erserve
                                               rserv
P   Sequioa                        NTT WAL shipping
U   PITR
                             pg_dump/pg_restore
G     postgres-r      pyReplica    EDB Replicator
Why Replication?
T
o
r   ●   Because it is fun?
o   ●   So you can buy twice the
n       number of licenses?
t   ●   To distribute your data?
o
P
    ●   So you can be buzzword
U       compliant?
G
Fail-Over
T
o
r   ●   Goal: To have additional
o       database servers standing by in
n       case of:
t       –   Hardware Failure
o       –   DBA/Application mistakes
P       –   Maintenance
U   ●   Turning on a standby means
G       failing the master
Automatic or manual
T
o
r   ●   Who makes the decision to
o       promote a slave to a master?
n   ●   Computer or human?
t   ●   Look at your possible failures,
o       how can you detect them?
P
U
    ●    When will the wrong decision
        be made?
G
Load Balancing
T
o
r   ●   Goal: Improve performance by
o       adding more servers
n   ●   Master slave or multi-master?
t   ●   You can only do queries on
o       slaves
P
U
    ●   Multi-Master is really hard
G
Load Balancing : slaves
T
o
r   ●   Send queries to slaves
o   ●   Run query parts on machines
n       and combine results
t   ●   Partition some data across
o       servers (sharding)
P
U
    ●   Topic on its own
G   Question: How stale will you allow your slaves to be?
Trigger based
T            Replication
o
r   ●   Slony, Longdiste, Bucardo
o   ●   Uses ON INSERT,ON
n       UPDATE,ON DELETE triggers
t   ●   Slaves jump between consistent
o       snapsnots of master
P
U
    ●   Asynchronous
G   ●   Performance impact on master
    ●   No triggers will fires on DDL
Slony
T
o
r   ●   www.slony.info
o   ●   Developed by Afillias
n   ●   Async trigger based,
t       master/slave
o
P
    ●   Most widely deployed Postgreql
U       replication solution
G   ●   Very flexible
    ●   Allows for complicated setups
    ●   Some rough edges
Longdiste
T
o
r   ●   https://developer.skype.com/Sk
o       ypeGarage/DbProjects/SkyTools
n   ●   Async trigger based, master
t       slave
o   ●   Part of SkyTools from Skype
P
U
    ●   Based on experience with Slony
        but simpler; less features
G
    ●   Can't cascade slaves
    ●   No switchover support (Today)
Bucardo
T
o
r   ●   http://bucardo.org
o   ●   Async trigger based
n   ●   Developed by backcountry.com
t
o   ●   Allows multi-master writes with
P       user specified conflict
U       resolution
G
Middleware based
T       statement replication
o
r   ●   pgpool-II, pgcluster, Continuent,
o       GridSQL
n   ●   Sits in-between your application
t       and PostgreSQL
o   ●   Redirects SQL to one or more of
P       your databases
U   ●   How do you know all databases
G       contain the same data?
Middleware - Issues
T
o   ●   INSERT INTO x VALUES (rand())
r   ●   Functions/Stored Procedures, or
o       timestamps are a bad idea
n   ●   How do you ensure things
t       happen in the same order on all
o       nodes?
P   ●   What if a COMMIT on the
U       second node fails?
G
    ●   Limitations fine for some
        applications
Sequoia
T
o
r   ●   http://sequoia.continuent.org/Hom
o   ●   Middleware
n   ●   Supports multiple RDBMS
t
o   ●   Has its own journaling
P   ●   Ensure all SQL writers
U       understand how it works
G
PITR
T
o
r   ●   Point-In Time Recovery
o   ●   WAL segments are sent to the
n       slaves
t   ●   Aysnc (today)
o
P
    ●   Can't query slaves (today)
U       unless you bring them up
G   ●   Rolling slaves with ZFS?
    ●   Only good for failover (today)
Multi-Master
T
o
r   ●   If the same row is changed on
o       two servers around the same
n       time?
t   ●   Solving this in the general
o       sense is really hard.
P   ●   Don't go here unless you
U       need to
G
Works in progress
T
o
r   ●   Not Production Ready
o   ●   Serious technical problems to
n       be worked out
t   ●   If your up for a challenge
o
P
    ●   Good place to spend your RAC
U       budget
G
postgres-r
T
o
r   ●   Multi Master based on a group
o       communication system
n   ●   All nodes process all
t       statements in the same order
o       (total order)
P   ●   Depends on a GCS like Spread
U   ●   Recently open-sourced
G
pgcluster-II
T
o
r   ●   Multi Master
o   ●   Shared disc
n   ●   Presented at pgconn 07 not
t       released
o
P
    ●   Status unknown
U
G
Rules of Thumb
T
o
r   ●   PITR if it will meet your needs
o   ●   Slony or Longdiste if you need
n       to query your slaves
t   ●   Find a way around multi-master
o
P
    ●   Avoid statement based
U       solutions if consistency is
        important
G
Questions?
T
o
r
o
n
t
o
P
U   Steven Singer
G   ssinger_pg@sympatico.ca
    FreeNode: stevenSn

Contenu connexe

Similaire à PostgreSQL Replication

Challenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleChallenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleRob Vesse
 
Scaling with apache spark (a lesson in unintended consequences) strange loo...
Scaling with apache spark (a lesson in unintended consequences)   strange loo...Scaling with apache spark (a lesson in unintended consequences)   strange loo...
Scaling with apache spark (a lesson in unintended consequences) strange loo...Holden Karau
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet SystemPuppet
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 
Amazon DynamoDB Lessen's Learned by Beginner
Amazon DynamoDB Lessen's Learned by BeginnerAmazon DynamoDB Lessen's Learned by Beginner
Amazon DynamoDB Lessen's Learned by BeginnerHirokazu Tokuno
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyAlex Chistyakov
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmudjcp
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streamingdatamantra
 
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki Kondo
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki KondoPGConf.ASIA 2019 - The Future of TDEforPG - Taiki Kondo
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki KondoEqunix Business Solutions
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Efficient Buffer Management
Efficient Buffer ManagementEfficient Buffer Management
Efficient Buffer Managementbasisspace
 
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)Aleksander Alekseev
 
Cephalocon apac china
Cephalocon apac chinaCephalocon apac china
Cephalocon apac chinaVikhyat Umrao
 
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...Ceph Community
 
Introduction to plotting in Python
Introduction to plotting in Python Introduction to plotting in Python
Introduction to plotting in Python bzamecnik
 
Introduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGIntroduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGAdam Kawa
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrPGConf APAC
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)Wei Shan Ang
 
ceph openstack dream team
ceph openstack dream teamceph openstack dream team
ceph openstack dream teamUdo Seidel
 

Similaire à PostgreSQL Replication (20)

Challenges and patterns for semantics at scale
Challenges and patterns for semantics at scaleChallenges and patterns for semantics at scale
Challenges and patterns for semantics at scale
 
Scaling with apache spark (a lesson in unintended consequences) strange loo...
Scaling with apache spark (a lesson in unintended consequences)   strange loo...Scaling with apache spark (a lesson in unintended consequences)   strange loo...
Scaling with apache spark (a lesson in unintended consequences) strange loo...
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet System
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet system
 
Amazon DynamoDB Lessen's Learned by Beginner
Amazon DynamoDB Lessen's Learned by BeginnerAmazon DynamoDB Lessen's Learned by Beginner
Amazon DynamoDB Lessen's Learned by Beginner
 
Harry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of BerkeleyHarry Potter and the Daemons of Berkeley
Harry Potter and the Daemons of Berkeley
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
 
Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streaming
 
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki Kondo
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki KondoPGConf.ASIA 2019 - The Future of TDEforPG - Taiki Kondo
PGConf.ASIA 2019 - The Future of TDEforPG - Taiki Kondo
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Efficient Buffer Management
Efficient Buffer ManagementEfficient Buffer Management
Efficient Buffer Management
 
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
 
Cephalocon apac china
Cephalocon apac chinaCephalocon apac china
Cephalocon apac china
 
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...
Common Support Issues And How To Troubleshoot Them - Michael Hackett, Vikhyat...
 
Kick my mouse away
Kick my mouse awayKick my mouse away
Kick my mouse away
 
Introduction to plotting in Python
Introduction to plotting in Python Introduction to plotting in Python
Introduction to plotting in Python
 
Introduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGIntroduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUG
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgr
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
 
ceph openstack dream team
ceph openstack dream teamceph openstack dream team
ceph openstack dream team
 

Plus de elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

Plus de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Dernier

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

PostgreSQL Replication

  • 1. PostgreSQL Replication T o r o n t o P U G Steven Singer ssinger_pg@sympatico.ca FreeNode: stevenSn July 28 2008
  • 2. Who am I T SELECT * FROM pg_user where name='Steve' o r ● PostgreSQL user since 6.5 o ● Author of contrib/dbmirror n included with 7.x t ● Software developer for a local o consulting company P U ● Occasional contributor to side projects G
  • 3. The Golden Rule T o r ● You can't have everything o ● What you want != what you n need t ● Determine need from o requirements P U ● Be prepared to accept trade- offs G ● If you've already been sold on Oracle RAC, go and buy RAC
  • 4. The Choices T o pgcluster pl/proxy r slony pgcluster-II Mammoth o dbmirror RepDB n longdist Bucardo t pgpool Cybercluster o pgpool-II erserve rserv P Sequioa NTT WAL shipping U PITR pg_dump/pg_restore G postgres-r pyReplica EDB Replicator
  • 5. Why Replication? T o r ● Because it is fun? o ● So you can buy twice the n number of licenses? t ● To distribute your data? o P ● So you can be buzzword U compliant? G
  • 6. Fail-Over T o r ● Goal: To have additional o database servers standing by in n case of: t – Hardware Failure o – DBA/Application mistakes P – Maintenance U ● Turning on a standby means G failing the master
  • 7. Automatic or manual T o r ● Who makes the decision to o promote a slave to a master? n ● Computer or human? t ● Look at your possible failures, o how can you detect them? P U ● When will the wrong decision be made? G
  • 8. Load Balancing T o r ● Goal: Improve performance by o adding more servers n ● Master slave or multi-master? t ● You can only do queries on o slaves P U ● Multi-Master is really hard G
  • 9. Load Balancing : slaves T o r ● Send queries to slaves o ● Run query parts on machines n and combine results t ● Partition some data across o servers (sharding) P U ● Topic on its own G Question: How stale will you allow your slaves to be?
  • 10. Trigger based T Replication o r ● Slony, Longdiste, Bucardo o ● Uses ON INSERT,ON n UPDATE,ON DELETE triggers t ● Slaves jump between consistent o snapsnots of master P U ● Asynchronous G ● Performance impact on master ● No triggers will fires on DDL
  • 11. Slony T o r ● www.slony.info o ● Developed by Afillias n ● Async trigger based, t master/slave o P ● Most widely deployed Postgreql U replication solution G ● Very flexible ● Allows for complicated setups ● Some rough edges
  • 12. Longdiste T o r ● https://developer.skype.com/Sk o ypeGarage/DbProjects/SkyTools n ● Async trigger based, master t slave o ● Part of SkyTools from Skype P U ● Based on experience with Slony but simpler; less features G ● Can't cascade slaves ● No switchover support (Today)
  • 13. Bucardo T o r ● http://bucardo.org o ● Async trigger based n ● Developed by backcountry.com t o ● Allows multi-master writes with P user specified conflict U resolution G
  • 14. Middleware based T statement replication o r ● pgpool-II, pgcluster, Continuent, o GridSQL n ● Sits in-between your application t and PostgreSQL o ● Redirects SQL to one or more of P your databases U ● How do you know all databases G contain the same data?
  • 15. Middleware - Issues T o ● INSERT INTO x VALUES (rand()) r ● Functions/Stored Procedures, or o timestamps are a bad idea n ● How do you ensure things t happen in the same order on all o nodes? P ● What if a COMMIT on the U second node fails? G ● Limitations fine for some applications
  • 16. Sequoia T o r ● http://sequoia.continuent.org/Hom o ● Middleware n ● Supports multiple RDBMS t o ● Has its own journaling P ● Ensure all SQL writers U understand how it works G
  • 17. PITR T o r ● Point-In Time Recovery o ● WAL segments are sent to the n slaves t ● Aysnc (today) o P ● Can't query slaves (today) U unless you bring them up G ● Rolling slaves with ZFS? ● Only good for failover (today)
  • 18. Multi-Master T o r ● If the same row is changed on o two servers around the same n time? t ● Solving this in the general o sense is really hard. P ● Don't go here unless you U need to G
  • 19. Works in progress T o r ● Not Production Ready o ● Serious technical problems to n be worked out t ● If your up for a challenge o P ● Good place to spend your RAC U budget G
  • 20. postgres-r T o r ● Multi Master based on a group o communication system n ● All nodes process all t statements in the same order o (total order) P ● Depends on a GCS like Spread U ● Recently open-sourced G
  • 21. pgcluster-II T o r ● Multi Master o ● Shared disc n ● Presented at pgconn 07 not t released o P ● Status unknown U G
  • 22. Rules of Thumb T o r ● PITR if it will meet your needs o ● Slony or Longdiste if you need n to query your slaves t ● Find a way around multi-master o P ● Avoid statement based U solutions if consistency is important G
  • 23. Questions? T o r o n t o P U Steven Singer G ssinger_pg@sympatico.ca FreeNode: stevenSn