Group commit works by allowing several transactions that reach the durability boundary at nearly the same time to share one WAL flush. Instead of paying the full storage-synchronisation latency once per transaction, one leader can flush the log far enough to make several commit records durable together.
The mechanism is simple in concept and subtle in tuning. More batching can improve throughput when fsync latency is expensive and concurrent transactions are available. Too much deliberate waiting increases response time and can even reduce throughput. This pillar explains the queueing logic, commit positions, leaders and followers, fsync amortisation, asynchronous commit, synchronous replication, commit_delay, observability and benchmark design.
Master guide: How Write-Ahead Logging Works · Pillar: How Database Checkpoints Work · How X Works Hub
The Direct Answer: One Flush Can Cover Many Commits
Transactions Need Different WAL Positions
Each committing transaction needs the log durable through at least its own commit record.
The Highest Position Covers the Lower Ones
If transactions A, B and C require WAL positions 100, 120 and 140, a successful flush through 140 also makes the earlier required positions durable. They can all be released after the same storage synchronization, provided the database’s commit protocol and replication requirements are satisfied.
Why fsync Latency Makes Grouping Valuable
A Flush Has Fixed Latency Beyond Its Byte Count
Storage must drain caches and confirm persistence. On many devices, the synchronization round trip can dominate the tiny amount of commit metadata.
Sharing the Round Trip Improves Amortisation
Ten committers covered by one flush pay roughly one synchronization event rather than ten serial events. CPU and contention still exist, but the expensive durable boundary is shared.
Group Commit Does Not Merge Transactions Logically
Each Transaction Keeps Its Own Atomicity
Their statements, locks, visibility and commit records remain separate.
Only the Durability Operation Is Shared
Transactions do not become one giant transaction merely because the same fsync made their WAL durable. Failure and application semantics remain per transaction.
The Leader and Followers Model
One Process Performs the Flush
A group leader reaches the log-flush critical section and determines how far WAL must be synchronized.
Other Committers Wait Behind It
Followers that need WAL positions at or below the leader’s eventual flush target can be satisfied by the same operation. PostgreSQL’s current WAL documentation describes followers queueing while a leader performs XLogFlush.
The Group Can Form Naturally Without Artificial Delay
Concurrency Creates a Window
While one transaction is already flushing, other transactions can reach commit and discover that the in-progress flush may cover their positions.
PostgreSQL Documents This ‘Gangway’ Effect
Its current WAL configuration notes that group commit can occur even when commit_delay is zero. At higher client counts, naturally overlapping committers can make explicit delay less useful.
commit_delay Deliberately Widens the Grouping Window
The Leader Waits Briefly Before Flushing
The intention is to let more concurrent transactions add commit records to WAL.
Then One Sync Covers the Larger Group
PostgreSQL exposes commit_delay in microseconds and applies it only when fsync is enabled and enough sibling transactions are active. The delay is a throughput optimisation, not a durability requirement.
commit_siblings Avoids Waiting When Concurrency Is Too Low
A Solo Committer Has Nobody to Batch With
Sleeping only adds latency.
The Threshold Tests Whether Grouping Is Plausible
PostgreSQL’s commit_siblings specifies how many other active transactions must exist before commit_delay is used. The setting is heuristic: active transactions are not guaranteed to become committers during the delay.
Too Much Delay Can Lower Throughput
Longer Waiting Increases Per-Transaction Latency
Committers remain blocked before the flush begins.
Concurrency Can Collapse if Clients Are Synchronous
If each client waits for one transaction before submitting the next, excessive delay reduces the number of transactions reaching the server. PostgreSQL explicitly warns that an overly large commit_delay can increase latency enough to reduce total throughput.
The Best Group Size Depends on Device Latency
High-Latency Durable Storage Benefits More From Sharing
A millisecond-scale sync is expensive relative to a small commit record.
Very Fast Durable Storage Shrinks the Opportunity
If synchronization is already extremely cheap, added coordination and delay can dominate. Benchmark the actual WAL device with realistic concurrency rather than assuming group commit settings transfer across hardware.
Group Commit Is About Commit Rate, Not Query Rate
A Busy Read-Only Workload Does Not Create WAL Commit Pressure
Many active sessions may be irrelevant to the optimization.
Write Transactions Need to Reach the Durability Boundary Together
Measure commits per second, WAL syncs per second and average commit group size if the engine exposes enough counters. General CPU utilization is not a substitute.
One Flush Can Cover More Than Commit Records
WAL Contains All Earlier Required Changes
The log records generated before a transaction’s commit record must also be durable through the commit point.
Flushing to a Later LSN Covers the Prefix
The WAL stream is ordered. Synchronizing through a later position commits the prefix physically. This prefix property is why one leader can satisfy several followers safely.
Group Commit Does Not Mean One Transaction Waits for Another’s Business Logic
Followers Need Only the Shared Flush
They are not logically dependent on one another’s application operations.
A Slow Transaction That Has Not Reached Commit Does Not Join Yet
Only work that has produced the required WAL and arrived at the durability boundary can benefit from the current group.
Synchronous Commit Defines the Local Wait
The Common Durable Mode Waits for Local WAL Flush
PostgreSQL’s normal synchronous_commit modes wait for local durable WAL before reporting success, subject to replication configuration.
Group Commit Shares That Wait
Several locally synchronous transactions can all be released when one flush reaches the maximum required LSN among them.
Asynchronous Commit Removes the Per-Transaction Wait
The Transaction Can Report Success Before Local WAL Flush
PostgreSQL supports synchronous_commit=off for transactions willing to accept possible loss after a database or operating-system crash.
The WAL Writer Flushes Later
This can improve latency but changes the durability contract. A benchmark comparing synchronous group commit with asynchronous commit must label the difference; faster acknowledgement is not free durability.
Asynchronous Commit Does Not Make the Database Structurally Inconsistent
Recent Acknowledged Transactions Can Disappear After Crash
That is the intended risk.
Recovery Still Produces a Consistent Database State
PostgreSQL documents that asynchronous commit can lose recent transactions but should leave the database as though those transactions had aborted cleanly. This is different from turning fsync off, which can threaten database consistency more broadly.
Synchronous Replication Extends the Commit Boundary
Local WAL Flush May Not Be Enough
Applications can require a standby to receive, write, durably flush or apply the commit record.
Group Commit Can Still Help Locally
The primary can amortise its local flush while remote acknowledgements add another latency component. Total commit time can then be dominated by network round trips or standby storage rather than local WAL.
remote_write, on and remote_apply Mean Different Things
Remote Write Is Weaker Than Remote Durable Flush
Bytes may only have reached the standby operating system.
Remote Apply Is Stronger Than Remote Flush
The standby has replayed the transaction far enough for queries there to observe it. PostgreSQL exposes these distinctions through synchronous_commit settings. The application should choose based on failure and visibility requirements, not on one generic word like synchronous.
Group Commit and Replication Batching Are Related but Distinct
One Local Flush Can Cover Several Transactions
That is group commit at the primary durability layer.
Replication Can Also Send WAL in Batches
Transport and standby apply have their own buffering. Do not assume the same transaction set shares every stage. Local, network and remote storage batching have separate queues.
The WAL Writer Also Affects Flush Timing
Background Processes Write and Flush WAL
Not every WAL write is initiated by a committing backend.
Asynchronous Transactions Rely More on Background Progress
PostgreSQL’s wal_writer_delay and wal_writer_flush_after influence how quickly unwaited WAL becomes durable. These settings affect the maximum exposure window of asynchronous commits under PostgreSQL’s documented model.
Write and Sync Counters Reveal Different Costs
Writing WAL Moves Bytes Toward Storage
Depending on method, they can still be in kernel cache.
Syncing Crosses the Durability Boundary
PostgreSQL’s pg_stat_io can track WAL write and fsync counts/timing when configured. A system with high write bandwidth but slow fsyncs can be commit-latency bound even though throughput graphs show plenty of sequential write capacity.
Group Commit Can Improve Throughput Without Changing WAL Volume Much
The Same Logical Records Still Exist
Batching does not eliminate the individual transactions’ commit records.
It Reduces Synchronization Events
The win comes from fewer durable-flush round trips per transaction, not from dramatically fewer WAL bytes. Monitor fsync frequency separately from WAL bytes generated.
The Savings Depend on How Many Commits One Flush Covers
Group Size One Means No Amortisation
The leader did the flush for itself only.
Larger Groups Spread the Fixed Cost
If a flush costs F microseconds and covers g committers, the simplified fixed flush cost per transaction is F/g before other overhead. This is teaching arithmetic, not a complete latency formula.
A Queueing View Helps Explain the Sweet Spot
A Small Delay Can Accumulate Followers
At moderate concurrency, a few extra microseconds can turn isolated flushes into groups.
A Large Delay Adds Queueing Faster Than It Saves Flushes
Once groups are already large, further waiting may not reduce sync count enough to compensate. The optimum shifts with arrival rate, storage latency and client behavior.
Client Think Time Changes Grouping
Closed-Loop Clients Submit One Transaction Then Wait
Long response time reduces offered concurrency.
Open-Loop Load Generators Keep Arrival Rate Independent
They can create larger queues and different group-commit behavior. Benchmark methodology therefore changes the result. State whether the test is open-loop or closed-loop.
Connection Pool Size Changes the Opportunity
Too Few Concurrent Writers Limit Group Formation
The device can still be fast, but there are not enough overlapping commits.
Too Many Writers Can Add Lock and Scheduler Contention
Increasing pool size purely to chase larger groups can hurt the database elsewhere. Group commit is one component of end-to-end concurrency.
Small Transactions Benefit Most Directly
Their Useful Work Is Short
Commit flush latency can dominate total transaction time.
Large Transactions Have More Work Before Commit
They still benefit from shared flush, but the fixed synchronization cost is a smaller percentage of their total latency. Workload transaction size distribution matters.
Batching at the Application Layer Is Different
One Transaction Can Contain Many Business Operations
This reduces commit count but changes atomicity, lock duration and failure scope.
Group Commit Keeps Transactions Separate
It shares durability cost without merging business semantics. Do not replace many independent transactions with one giant transaction merely to simulate group commit unless the application actually wants that atomicity.
Group Commit and Checkpoints Interact Through Storage Contention
Checkpoint Writes Can Compete With WAL fsync
Both use the storage stack.
Commit Latency Can Spike During Heavy Data-Page Writeback
Even if the WAL device is separate, controller or filesystem contention can matter. Correlate commit latency with checkpoint and I/O metrics rather than assuming group-commit settings alone explain every spike.
Dedicated WAL Storage Can Change the Economics
Separating Sequential WAL From Random Data Writes Can Reduce Interference
Historically this has been a common design on some workloads.
Modern Storage Topology Is More Complicated
NVMe devices, RAID controllers, cloud block volumes and shared queues have different characteristics. Test the actual deployment. A separate logical volume is not automatically a separate physical bottleneck.
Battery-Backed Caches Change fsync Latency
A Controller Can Acknowledge Durable Writes Quickly if the Cache Itself Is Protected
The stable media can be reached later.
Database Durability Still Depends on Honest Flush Semantics
A device that lies about persistence can defeat WAL guarantees. Reliability requires hardware and virtualization layers to honor the synchronization commands the database relies on.
Common Failure: Setting commit_delay Because ‘Batching Is Good’
No Concurrent Committers Means Pure Waste
The delay simply slows each transaction.
Measure First
PostgreSQL recommends considering the measured fsync cost and representative workload. Default zero can already provide natural group commit under concurrency.
Common Failure: Comparing Async and Sync Commit as Equal Durability
The Async Mode Looks Much Faster
The client is released before local durable flush.
The Failure Contract Is Different
A crash can lose recent acknowledged transactions. Performance numbers must state the durability mode beside them or the comparison is misleading.
Common Failure: Treating Every Latency Spike as fsync
Commit Can Wait on Locks, CPU, Network or Replication
The WAL sync is only one stage.
Use Wait Events and I/O Timing
Break commit latency into local write/sync, synchronous standby waiting, scheduling and lock contention where the database provides observability. Tuning commit_delay for a lock-bound workload will not solve the root cause.
Common Failure: Chasing Throughput With Too Many Connections
Large Pools Can Inflate Queueing
Context switching and lock contention rise.
A Smaller Pool Can Deliver Better Throughput and Lower Tail Latency
Find the saturation point experimentally. Group commit needs concurrency, but infinite concurrency is not the goal.
A One-Client Baseline
Measure the Unbatched Cost
Run a durable tiny-transaction workload with one client.
This Approximates the Commit Sync Floor
It includes more than fsync, but it provides a baseline. Use pg_test_fsync or platform tools to separately understand storage synchronization cost.
A Multi-Client Experiment
Increase Concurrency Stepwise
Record throughput, median and tail commit latency, WAL sync count and WAL bytes.
Look for Amortisation
If throughput rises faster than fsync count, group commit is likely sharing flushes. Stop increasing clients once latency grows sharply without meaningful throughput gain.
A commit_delay Experiment
Hold the Workload Fixed
Compare delay zero with a few carefully chosen nonzero values.
Watch Both Throughput and Latency
A setting that slightly raises throughput while violating p99 latency objectives is not automatically better. Repeat enough times to separate signal from storage variance.
A Replication Commit Experiment
Compare local, remote_write, on and remote_apply Only if the Architecture Supports Them
Each mode has a different wait condition.
Measure Network and Standby Components
If remote_apply dominates, local group commit tuning may have little user-visible effect. Optimise the stage that actually owns the wait.
Visual Analogy: Group Commit Is Carpooling Across the Durability Bridge
Each Transaction Still Has Its Own Destination
They remain independent commits.
They Share One Expensive Crossing
If several arrive together, one flush transports the durable WAL prefix for all of them. Waiting forever for a fuller car is silly; leaving every car empty is wasteful. The useful setting balances departure frequency with occupancy.
How the Parts Work Together: Group Commit Converts Concurrency Into Efficiency
Concurrent Demand Creates an Opportunity
Many transactions independently need the same expensive service: durable log synchronization.
The System Aggregates That Demand
A leader performs one durable action and releases several followers. This is a general systems pattern: preserve logical independence while sharing a fixed-cost physical operation.
Frequently Asked Questions
Does Group Commit Delay Every Transaction?
Not necessarily. Natural group commit can happen with zero configured delay when transactions overlap around an in-progress flush. Explicit commit_delay adds intentional waiting only under the configured conditions.
Does Group Commit Change Isolation?
No. Isolation and visibility are transaction semantics. Group commit changes how durability work is physically shared.
More Frequently Asked Questions
Can One Slow Transaction Hold the Group?
A transaction that has not reached commit is not part of the current durability group. Once a follower waits for a flush, it waits for that flush and any additional remote durability requirements, not for another transaction’s application logic.
Is Bigger Group Size Always Better?
No. Larger groups often require more waiting or more concurrency. The optimal balance depends on fsync latency, workload arrival rate and latency objectives.
The Pillar Boundary and Sources
What This Article Owns
This pillar owns group-commit mechanics: WAL flush leaders/followers, shared fsync, commit_delay, synchronous/asynchronous commit and durability-latency trade-offs. Checkpoint page flushing and crash replay have separate owners.
Sources and Further Reading
PostgreSQL 18’s WAL introduction notes that one WAL fsync can commit many concurrent small transactions. The current WAL Configuration page documents commit_delay, commit_siblings, natural group commit and WAL sync methods, while Write Ahead Log settings documents synchronous_commit modes.
Final Synthesis: Group Commit Shares Durability Cost Without Sharing Transaction Meaning
The Mechanism
Let concurrent transactions write their independent WAL records, collect committers around one flush, synchronize through the highest required log position and release every transaction covered by that durable prefix.
The Trade-Off
More grouping can amortise fsync latency; more waiting can hurt response time. The right balance comes from actual commit concurrency and storage latency. Group commit is effective because it exploits coincidence in physical timing while preserving independent transaction semantics.
Worked Group-Commit Timeline With Three Transactions
Transaction A reaches commit first and needs WAL durable through position 100. While A is preparing to flush, transaction B reaches position 120 and transaction C reaches 140. If the leader flushes WAL through 140, all three durability requirements are satisfied by one synchronization. A, B and C remain separate transactions; only the physical flush is shared.
This prefix property is the core of group commit. A durable log position includes every earlier record in the stream. The leader therefore needs to synchronize through the highest participating requirement, not perform one device flush per follower.
Natural Group Commit Can Be Strong Even With commit_delay = 0
On a busy server, one flush can already be in progress when more backends arrive at the same WAL-flush bottleneck. Those followers can queue behind the leader and benefit from its work without an intentionally inserted sleep.
PostgreSQL calls this a gangway effect in its documentation. It is why explicit commit_delay should be treated as an optimisation to test, not as the switch that enables group commit. Concurrency itself can form groups.
Group Size Is an Emergent Workload Property
The number of transactions covered by one flush depends on arrival rate, transaction duration, connection count, scheduler timing and storage latency. A slower flush can paradoxically create a larger natural group because more committers arrive while it is in progress.
That does not mean slower storage is desirable. It means observed group size cannot be interpreted alone. Always pair group size with sync latency, throughput and response time.
Why Tiny Transactions Expose fsync Cost Most Clearly
If a transaction performs 100 microseconds of useful database work and then waits 800 microseconds for durable synchronization, commit dominates its latency. Sharing that 800-microsecond cost across several transactions can transform throughput.
A transaction spending 200 milliseconds doing complex joins before commit has a different profile. The same flush saving exists, but it is a smaller portion of end-to-end latency. Group-commit tuning should therefore use the application’s real transaction size distribution.
The Simplified Amortisation Equation
Let one durable sync have fixed latency F and suppose it covers g transactions. Ignoring coordination and queueing, the fixed synchronization cost per transaction is roughly F/g. The equation explains why grouping can improve throughput.
It is not a full latency model. Every transaction still waits for the group flush to finish, and some wait longer than others depending on when they joined. Coordination, WAL writes, CPU and remote replication remain. Use the equation to understand amortisation, not to predict exact p99 latency.
Leader Latency and Follower Latency Differ
The leader may arrive first, optionally wait for commit_delay, initiate the flush and then wait for storage. A follower can arrive later and wait only for the remaining portion of the same flush.
Average commit latency can therefore hide a distribution inside each group. Instrumentation that only records aggregate transactions per second will not reveal whether early group leaders are paying much more latency than late followers.
commit_delay Creates a Deliberate Queue
When enabled under its documented conditions, PostgreSQL’s group-commit leader sleeps briefly before synchronizing. The hope is that more backends become ready to commit and add their WAL records to the group.
The delay is useful only if the extra followers save enough future sync operations to repay the waiting cost. If transaction arrival is sparse, the leader simply sleeps alone. That is why commit_siblings exists as a guard against low-concurrency waste.
commit_siblings Is Only a Heuristic Signal
Other active transactions are potential future committers, not guaranteed followers. They may still be executing long statements or waiting on locks.
A high commit_siblings threshold avoids delay in lightly loaded periods but can miss opportunities when just a few high-frequency writers dominate. A lower threshold can increase delay exposure. Representative workload testing is more reliable than theoretical tuning alone.
Closed-Loop Clients Can Hide the Cost of Delay
A closed-loop benchmark sends one transaction, waits for the response, then sends the next. If commit delay increases, each client generates fewer transactions per second, reducing offered load.
An open-loop generator can maintain a fixed arrival rate and reveal queue buildup instead. Both are useful, but they answer different questions. Document the load model when evaluating group commit.
Connection Pools Change the Grouping Window
A pool with only two active writers cannot form a 20-transaction commit group. Increasing the pool creates more overlap, but it also increases lock competition, memory use and scheduler pressure.
The best pool size is therefore not the one that maximises group size. It is the one that maximises useful throughput while meeting latency and resource goals across the entire database workload.
Group Commit and WAL Buffering Are Connected
Backends generate commit records into WAL buffers. If buffers are under pressure, WAL writes can occur before the final commit flush path, affecting latency and lock hold times.
Healthy group commit therefore assumes the log-generation path itself is not repeatedly stalling on buffer exhaustion. PostgreSQL’s wal_buffers and WAL I/O statistics help distinguish record-insertion pressure from durable sync pressure.
Local fsync Can Stop Being the Bottleneck Under Synchronous Replication
When a transaction waits for a synchronous standby, local WAL can become durable quickly while the commit remains blocked on network transfer, standby write, standby flush or standby apply.
In that situation, optimizing local commit_delay may barely change user-visible latency. Measure the wait stage that dominates the chosen synchronous_commit mode.
Remote Apply Adds Visibility Latency
remote_apply waits beyond remote durable storage until the standby has replayed the commit far enough for queries there to see it. This is a stronger condition than remote_write or remote flush.
Applications that require immediate read-after-write visibility on a synchronous standby may value this guarantee, but the extra replay wait can dominate the local durability path. Performance comparisons must identify the exact remote condition.
Asynchronous Commit Moves Latency Out of the Request Path
With asynchronous local commit, the transaction can return before the WAL reaches durable storage. The WAL writer eventually flushes the records, so most transactions survive normal operation.
The exposure window is precisely the point: a sudden crash can lose acknowledged transactions. This may be acceptable for low-value event logging or regenerable data and unacceptable for payments. Durability policy is a business decision as much as a database setting.
Group Commit Does Not Eliminate WAL Write Amplification
Every transaction still produces the WAL records required by its changes. Batching reduces the number of synchronization operations, not necessarily the total bytes.
If WAL bytes are the bottleneck because the workload modifies many indexes or logs full-page images, larger commit groups may not solve the problem. Identify whether the saturated resource is bandwidth or synchronization latency.
Storage Queues Can Make fsync Latency Variable
A WAL sync issued while the device is idle can complete quickly. The same sync issued while checkpoint writes and unrelated workloads occupy the device queue can take much longer.
This variability changes grouping behavior dynamically. Slow flushes create larger groups but worse individual latency. Correlate commit timing with overall storage queue depth and checkpoint activity.
Dedicated WAL Devices Can Help Only if They Are Truly Independent
Separating WAL onto another device can reduce interference from random data-page writes. But two cloud volumes can share the same physical backend, and two partitions definitely share one device.
Validate independence with platform documentation and measurements. Logical separation is not automatically physical isolation.
A Better Benchmark Scorecard
Record throughput, median latency, p95 and p99 commit latency, WAL writes, WAL fsyncs, average fsync time, WAL bytes, CPU usage, active connections and checkpoint activity. If replication is involved, record network round-trip time and standby flush/apply delay.
Then label the durability mode. These metrics let you tell whether performance improved because of better grouping, weaker durability, more concurrency or merely a warm storage cache.
A Practical Tuning Sequence
First measure single-client synchronous commit latency. Next increase concurrency with commit_delay at zero. If natural group commit already produces good throughput, leave the explicit delay alone. If commits remain sync-bound and concurrency exists, test small delay values on a disposable or staging system.
Stop when extra delay raises tail latency faster than it reduces sync frequency. The goal is not the largest group. The goal is the best service outcome under the required durability contract.
A Group-Commit Postcondition Checklist
Each transaction remains logically independent. The durable WAL position after the shared flush covers every released transaction. No follower is released before its configured local and remote durability conditions are met. Error handling must not report success to followers if the leader’s synchronization fails.
These postconditions matter more than implementation style. Whether the engine uses explicit leader/follower queues, condition variables or another concurrency primitive, the released group must correspond exactly to a durability prefix the storage system has actually established.
Group Commit Under Bursty Traffic
Bursty applications naturally create commit clusters. Hundreds of requests can arrive after a queue drains or a scheduled job wakes. During the burst, group size grows and fsync cost is heavily amortised. During quiet periods, most flushes may cover one transaction.
An average group size across the whole day can therefore hide two operating regimes. Use distributions or time-bucketed metrics if the application’s load varies sharply.
Group Commit and Transaction Batching Are Different Optimisations
Application batching reduces the number of logical transactions by putting more work inside one transaction. Group commit preserves the original transaction boundaries and shares only the durability flush. They can be combined, but they change different things.
Larger application transactions can hold locks longer and enlarge rollback scope. Group commit avoids those semantic changes. Prefer the mechanism that matches the actual requirement rather than reshaping business transactions only to reduce fsync count.
Group Commit Review: Optimize the Bottleneck You Actually Have
If WAL fsync time dominates, grouping can help. If CPU, locks, network or standby apply dominates, the same tuning may produce no meaningful gain. Start from wait-event and I/O evidence.
The goal is not a clever commit_delay value. The goal is to satisfy the required durability with the lowest sustainable latency and highest useful throughput. Sometimes the correct setting is the default zero because natural grouping is already doing enough.
Group Commit Under Failure: Who May Be Released?
If the leader’s WAL synchronization fails, the followers cannot be told that their commits reached the promised durable point merely because their records were included in the attempted group. The group shares success only when the shared physical operation succeeds under the configured durability contract.
This makes error propagation part of group-commit correctness. Every follower needs a result consistent with the actual flush outcome and any remote synchronous requirements. A leader/follower implementation that improves throughput but loses failure semantics is not a correct optimization.
Group Commit Postconditions
The flushed WAL prefix must cover each released transaction’s commit record. Transactions remain logically independent. Followers that require remote durability must not be released solely because local fsync completed. Metrics should show fewer synchronization events without changing the promised commit semantics.
Continue: How Database Crash Recovery Works.
Group Commit Failure Modes Worth Rehearsing
Inject a WAL synchronization error in a disposable environment and verify that every follower receives an outcome consistent with the failed shared flush. Then test client disconnects after the flush but before replies are delivered. The database and client can disagree about whether the client knows the commit outcome even when the durable state itself is correct.
These tests separate storage durability from response delivery. Group commit safely shares one physical operation only when success and failure propagate to every participant according to its own transaction contract.
A final group-commit principle is to preserve the durability contract while optimizing the physical operation. The database is free to gather many committers behind one flush, but each transaction must be released only when the shared WAL prefix satisfies its own required local and remote conditions. Throughput improvements that silently weaken those conditions are not group-commit improvements; they are durability changes and must be evaluated as such.
One last tuning rule is to prefer evidence over group-size folklore. If fsync count falls but p99 latency rises beyond the service objective, the larger groups are not automatically an improvement. Measure the complete commit path under the same durability mode and choose the setting that serves the workload rather than the prettiest batching metric.
Continue the WAL Series
How Write-Ahead Logging Works · How Database Checkpoints Work · How X Works Hub
