O'Reilly logo

PostgreSQL Replication by Hans-Jürgen Schönig, Zoltan Böszörmenyi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Different types of replication

Now that you are fully armed with the basic understanding of physical and theoretical limitations, it is time to learn about different types of replication.

Synchronous versus asynchronous replication

The first distinction we can make is whether to replicate synchronously or asynchronously.

What does this mean? Let us assume we have two servers and we want to replicate data from one server (the master) to the second server (the slave). The following diagram illustrates the concept of synchronous and asynchronous replication:

Synchronous versus asynchronous replication

We could use a simple transaction like the one shown in the listing:

BEGIN: INSERT INTO foo VALUES ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required