PostgreSQL Replication
Christophe Pettus PostgreSQL Experts PerconaLive, April 25, 2018
PostgreSQL Replication Christophe Pettus PostgreSQL Experts - - PowerPoint PPT Presentation
PostgreSQL Replication Christophe Pettus PostgreSQL Experts PerconaLive, April 25, 2018 Christophe Pettus CEO, PostgreSQL Experts, Inc. christophe.pettus@pgexperts.com thebuild.com twitter @xof Questions Welcome! "It's more
Christophe Pettus PostgreSQL Experts PerconaLive, April 25, 2018
CEO, PostgreSQL Experts, Inc. christophe.pettus@pgexperts.com thebuild.com twitter @xof
storage.
a specific underlying disk-level item.
to ‘cat’.”
unpleasant hexadecimal names, like: 000000010000002A00000065
recovery.
that contains the last checkpoint, and starts replaying the activity in it.
can start up and receive connections.
and keep it up to date with the primary?
archive_command.
the file over to the secondary (or to a place the secondary can get at it).
recovery.conf) to replay the WAL information.
copy files around.
since no persistent connection is required.
keep WAL information and base backups around to handle it.
shouldn’t be running anymore.
lag) of the primary.
queries.
letting it come back up; it takes <1 minute, usually.
segment: You can lose some changes.
disk space.
complex orchestration.
temporary tables and materialized views.
in the PostgreSQL server, you cannot pick and choose anything.
all the databases.
WAL shipping.
so can’t use it for zero-downtime upgrades.
WAL information down a network connection?
much) WAL information, only transmitted down to the secondary.
primary.
stream of the WAL information.
same limitations and benefits.
transaction activity.
lost transaction (committed on the primary but not the secondary) is essentially zero.
secondary, and that secondary is running a query that uses that relation, what should we do?
could be wrong.
completes.
that control how long to wait before cancelling the query.
and other servers for read-only traffic with higher values.
tables are being queried on the secondary.
query cancellations on the secondary.
traffic on the secondary.
update / insert / delete operations, and pushed them to the secondary that way?
Slony 1.
sending them over.
database (for data warehousing, etc.).
them for zero-downtime upgrading.
(at least a de facto one).
have a performance impact.
provider) system, thus suitable for RDS.
updates.
replication, use that instead.
version <9.4.
you don’t have access to built-in logical replication or the WAL stream (in specific, RDS).
a framework for implementing logical replication and
‘cat’” becomes “UPDATE menagerie SET animal_type=‘cat’ WHERE ctid=‘(12312,6)’” (to a first approximation).
“captures” the WAL stream.
stream to the slot’s specified plug-in, which can do whatever it wants with it.
processed the WAL stream, so that the local WAL segments can be recycled.
consumer (in the case of logical replication, the plug-in).
WAL information so it can catch up.
server (like any extension) that receives the stream of decoding WAL records.
feeding to an external data system, etc.
Logical replication into Kafka!
code and logging, but it’s not useful for any actual production use.
at the SQL level.
locked, triggers (can) fire, MVCC happens, etc.
subscriber to changes.
the subscriber node.
existing data, followed by replicating data going forward.
function to run DDL changes on each node; in-core leaves it to you).
to identify the row if all else fails.
sequence are, of course).
process.
source databases (or non-sequence keys).
this restriction.
at all (at present).
TRUNCATE CASCADEs.
partition root tables.
is not a real table, so cannot participate in logical replication (either source or destination).
ENABLE ALWAYS triggers (unverified at press time).
as 10,000 UPDATEs.
not.
sequence replication, etc.
not part of the core distribution.
uses SQL statements.
subscriber.
the current logical replication state is not passed over to the secondary.
pushed down to the logical subscribers, for example.
are… limited.
plugins.
logical replication.
two servers.
database system types.
TIMESTAMPTZ).
replication.
database-product migrations.
dedicated to failover.
pglogical feature.
CEO, PostgreSQL Experts, Inc. christophe.pettus@pgexperts.com thebuild.com twitter @xof