--- title: Synchronous Commit deepToC: true redirects: - /pgd/latest/commit-scopes/synchronous_commit/ #generated for DOCS-1247-PGD-6.0-Docs - /pgd/latest/reference/commit-scopes/synchronous_commit/ #generated for DOCS-3034 --- Commit scope kind: `SYNCHRONOUS COMMIT` ## Overview PGD's `SYNCHRONOUS COMMIT` is a commit scope kind that works in a way that's more like PostgreSQL's [`synchronous_commit`](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT) option in its underlying operation. Unlike the PostgreSQL option, though, it's configured as a commit scope and is easier to configure and interact with in PGD. Unlike other commit scope kinds, such as `QUORUM COMMIT` and `CAMO`, the transactions in a `SYNCHRONOUS COMMIT` operation aren't transformed into a two-phase commit (2PC) transaction. They work more like a Postgres `synchronous_commit`. ## Example In this example, when this commit scope is in use, any node in the `left_dc` group uses `SYNCHRONOUS COMMIT` to replicate changes to the other nodes in the `left_dc` group. It looks for a majority of nodes in the `left_dc` group to confirm that they committed the transaction. ``` SELECT bdr.create_commit_scope( commit_scope_name := 'example_sc_scope', origin_node_group := 'left_dc', rule := 'MAJORITY (left_dc) SYNCHRONOUS COMMIT', wait_for_ready := true ); ``` ## Configuration `SYNCHRONOUS COMMIT` supports the optional `DEGRADE ON` clause. See the [`SYNCHRONOUS COMMIT`](https://www.enterprisedb.com/pgd/latest/reference/tables-views-functions/commit-scopes/#synchronous-commit) commit scope reference for specific configuration parameters or see [this section](https://www.enterprisedb.com/docs/pgd/latest/commit-scopes/degrading) regarding Degrade on options. ## Confirmation Confirmation level | PGD Synchronous Commit handling -------------------------|------------------------------- `received` | A remote PGD node confirms the transaction once it's been fully received and is in the in-memory write queue. `replicated` | Same behavior as `received`. `durable` | Confirms the transaction after all of its changes are flushed to disk. Analogous to `synchronous_commit = on` in legacy synchronous replication. `visible` (default) | Confirms the transaction after all of its changes are flushed to disk and it's visible to concurrent transactions. Analogous to `synchronous_commit = remote_apply` in legacy synchronous replication. ## Details Currently `SYNCHRONOUS COMMIT` doesn't use the confirmation levels of the commit scope rule syntax. In commit scope rules, the original keyword `SYNCHRONOUS_COMMIT` is now aliased to `SYNCHRONOUS COMMIT`. The use of a space instead of an underscore helps distinguish it from Postgres's native `SYNCHRONOUS_COMMIT`. > For an AI-friendly overview of our documentation, see [llms.txt](https://www.enterprisedb.com/docs/llms.txt).