Commit 8550cbd0 authored by Michael Paquier's avatar Michael Paquier

doc: Improve some documentation about HA and replication

This clarifies some wording in the description of the options available
as replication solutions.  While on it, this replaces some instances of
"master" with "primary", for consistency with recent changes like
9e101cf6.

Author: Robert Treat
Reviewed-by: Magnus Hagander, Michael Paquier
Discussion: https://postgr.es/m/CAJSLCQ2TPaK_K8raofCamrqELCxY-H6mJrpDNRzc-LKpPY7c+g@mail.gmail.com
parent 8d9a9359
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
Some solutions deal with synchronization by allowing only one Some solutions deal with synchronization by allowing only one
server to modify the data. Servers that can modify data are server to modify the data. Servers that can modify data are
called read/write, <firstterm>master</firstterm> or <firstterm>primary</firstterm> servers. called read/write, <firstterm>master</firstterm> or <firstterm>primary</firstterm> servers.
Servers that track changes in the master are called <firstterm>standby</firstterm> Servers that track changes in the primary are called <firstterm>standby</firstterm>
or <firstterm>secondary</firstterm> servers. A standby server that cannot be connected or <firstterm>secondary</firstterm> servers. A standby server that cannot be connected
to until it is promoted to a master server is called a <firstterm>warm to until it is promoted to a primary server is called a <firstterm>warm
standby</firstterm> server, and one that can accept connections and serves read-only standby</firstterm> server, and one that can accept connections and serves read-only
queries is called a <firstterm>hot standby</firstterm> server. queries is called a <firstterm>hot standby</firstterm> server.
</para> </para>
...@@ -165,10 +165,10 @@ protocol to make nodes agree on a serializable transactional order. ...@@ -165,10 +165,10 @@ protocol to make nodes agree on a serializable transactional order.
Logical replication allows a database server to send a stream of data Logical replication allows a database server to send a stream of data
modifications to another server. <productname>PostgreSQL</productname> modifications to another server. <productname>PostgreSQL</productname>
logical replication constructs a stream of logical data modifications logical replication constructs a stream of logical data modifications
from the WAL. Logical replication allows the data changes from from the WAL. Logical replication allows replication of data changes on
individual tables to be replicated. Logical replication doesn't require a per-table basis. In addition, a server that is publishing its own
a particular server to be designated as a primary or a replica but allows changes can also subscribe to changes from another server, allowing data
data to flow in multiple directions. For more information on logical to flow in multiple directions. For more information on logical
replication, see <xref linkend="logical-replication"/>. Through the replication, see <xref linkend="logical-replication"/>. Through the
logical decoding interface (<xref linkend="logicaldecoding"/>), logical decoding interface (<xref linkend="logicaldecoding"/>),
third-party extensions can also provide similar functionality. third-party extensions can also provide similar functionality.
...@@ -177,22 +177,24 @@ protocol to make nodes agree on a serializable transactional order. ...@@ -177,22 +177,24 @@ protocol to make nodes agree on a serializable transactional order.
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Trigger-Based Master-Standby Replication</term> <term>Trigger-Based Primary-Standby Replication</term>
<listitem> <listitem>
<para> <para>
A master-standby replication setup sends all data modification A trigger-based replication setup typically funnels data modification
queries to the master server. The master server asynchronously queries to a designated primary server. Operating on a per-table basis,
sends data changes to the standby server. The standby can answer the primary server sends data changes (typically) asynchronously to the
read-only queries while the master server is running. The standby servers. Standby servers can answer queries while the primary is
standby server is ideal for data warehouse queries. running, and may allow some local data changes or write activity. This
form of replication is often used for offloading large analytical or data
warehouse queries.
</para> </para>
<para> <para>
<productname>Slony-I</productname> is an example of this type of replication, with per-table <productname>Slony-I</productname> is an example of this type of
granularity, and support for multiple standby servers. Because it replication, with per-table granularity, and support for multiple standby
updates the standby server asynchronously (in batches), there is servers. Because it updates the standby server asynchronously (in
possible data loss during fail over. batches), there is possible data loss during fail over.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -215,14 +217,10 @@ protocol to make nodes agree on a serializable transactional order. ...@@ -215,14 +217,10 @@ protocol to make nodes agree on a serializable transactional order.
<function>random()</function>, <function>CURRENT_TIMESTAMP</function>, and <function>random()</function>, <function>CURRENT_TIMESTAMP</function>, and
sequences can have different values on different servers. sequences can have different values on different servers.
This is because each server operates independently, and because This is because each server operates independently, and because
SQL queries are broadcast (and not actual modified rows). If SQL queries are broadcast rather than actual data changes. If
this is unacceptable, either the middleware or the application this is unacceptable, either the middleware or the application
must query such values from a single server and then use those must determine such values from a single source and then use those
values in write queries. Another option is to use this replication values in write queries. Care must also be taken that all
option with a traditional primary-standby setup, i.e., data modification
queries are sent only to the primary and are propagated to the
standby servers via primary-standby replication, not by the replication
middleware. Care must also be taken that all
transactions either commit or abort on all servers, perhaps transactions either commit or abort on all servers, perhaps
using two-phase commit (<xref linkend="sql-prepare-transaction"/> using two-phase commit (<xref linkend="sql-prepare-transaction"/>
and <xref linkend="sql-commit-prepared"/>). and <xref linkend="sql-commit-prepared"/>).
...@@ -351,7 +349,7 @@ protocol to make nodes agree on a serializable transactional order. ...@@ -351,7 +349,7 @@ protocol to make nodes agree on a serializable transactional order.
</row> </row>
<row> <row>
<entry>Allows multiple master servers</entry> <entry>Allows multiple primary servers</entry>
<entry align="center"></entry> <entry align="center"></entry>
<entry align="center"></entry> <entry align="center"></entry>
<entry align="center"></entry> <entry align="center"></entry>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment