PostgreSQL's Synchronous Commit: A Performance vs. Durability Trade-off

This post explores the performance implications of PostgreSQL's `synchronous_commit` setting. Turning it off significantly boosts transaction throughput, reducing I/O and CPU load, but introduces a small risk window for data loss. The author demonstrates a 30% increase in TPS on I/O-constrained systems. The article advocates for a nuanced approach, suggesting adjusting `synchronous_commit` per session, transaction, or operation, with a Ruby on Rails example provided. The author also notes that on Aurora PostgreSQL, setting `synchronous_commit` to `off` yields the greatest performance gains.
Read more