IT lexicon › Database › Synchronous commit

Synchronous commit

Database På svenska → Updated: 2026-05-28

A PostgreSQL setting that controls how strongly a COMMIT is guaranteed before the client gets an OK. Fully synchronous: wait until the WAL is written to disk (and possibly acknowledged by a synchronous replica). Can be lowered to trade durability for lower latency.

Levels (synchronous_commit): on (default, WAL flushed locally + possibly a replica ack), remote_apply (the replica has applied it — readable), local (local disk only), off (return immediately, WAL flushed shortly after — a risk of losing the most recent transactions on crash, but NEVER corruption). The trick: it can be set per transaction → critical payments run on, unimportant logging runs off for speed. With synchronous replication, this determines whether commit waits for the replica (zero data loss) or not. The classic durability-vs-performance dial.

← Back to the lexicon