Analyze synchronous_commit parameters in PostgreSQL
This article focuses on "analyzing synchronous_commit parameters in PostgreSQL". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "analyzing synchronous_commit parameters in PostgreSQL".
Optional synchronous_commit parameters include on, off, local, remote_write and remote_apply. The impact on performance in a streaming replication environment is from small to large:
Off (async) > on (async) > remote_write (sync) > on | local (sync) > remote_apply (sync)
Off
This option means asynchronous operations, which may result in data loss, but not data inconsistencies.
On
This option ensures that the transaction is flushed to WAL, which ensures the persistence of the transaction.
Remote_write
This option ensures that WAL has been written to the OS of the remote host, and data will be lost if OS crashes.
Local
This option ensures that the log of the (primary) node has been flushed to the WAL (off the disk), ensuring the persistence of the transaction.
Remote_apply
This option ensures that the WAL of the slave is written and applied, and that the query results are consistent with the master node.
At this point, I believe you have a deeper understanding of "analyzing synchronous_commit parameters in PostgreSQL". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!