Delayed Durability is a SQL Server feature where a transaction can be considered committed before its log records are physically flushed to disk. Normally, SQL Server follows Write-Ahead Logging (WAL) and waits for the transaction log to be written to disk before returning success to the client. With Delayed Durability enabled, SQL Server returns COMMIT success immediately and postpones the log flush. This improves transaction throughput and reduces log I/O waits, but introduces a risk: if SQL Server crashes before the log is flushed, recently committed transactions can be lost.
Normal Durability vs Delayed
Durability
|
Feature |
Normal Commit |
Delayed Durability |
|
Log Flushed Before
Success |
Yes |
No |
|
Data Loss Possible |
No |
Yes |
|
Throughput |
Lower |
Higher |
|
WRITELOG Waits |
More |
Less |
|
Suitable for Banking |
Yes |
No |
|
Suitable for Logging/Audit Systems |
Sometimes |
Yes |
Delayed
Durability is used in high-throughput systems where transaction log flushes
become a bottleneck and occasional loss of recently committed transactions is
acceptable. Typical use cases include telemetry systems, logging frameworks,
audit data collection, IoT sensor ingestion, clickstream tracking, caching
systems, and staging databases. By delaying log flushes, SQL Server reduces
WRITELOG waits and increases transaction throughput significantly.
No comments:
Post a Comment
If you have any doubt, please let me know.