top of page

Delayed Durability During Shutdown


Introduction


In the world of database management systems, ensuring data durability is of paramount importance. It involves guaranteeing that committed transactions are not lost in the event of unexpected failures or system crashes. SQL Server offers a feature known as Delayed Durability to address this challenge. Delayed Durability provides a mechanism for optimizing transaction logging and improving performance without compromising data integrity. This article aims to delve into the concept of Delayed Durability in SQL Server, specifically focusing on its behavior during expected shutdown scenarios.


Database Shutdown

Delayed Durability is a feature introduced in SQL Server 2014 and later versions that allows transactions to be committed quickly, deferring the durability of the transactional changes to a later point in time. By default, SQL Server ensures durability by writing transactional log records to disk immediately before confirming the transaction commit. However, with Delayed Durability, the transactional log records are kept in memory for a longer duration, reducing the I/O overhead associated with disk writes.



Advantages of Delayed Durability


  1. Improved Throughput: Delayed Durability can significantly enhance the throughput of high-volume transactional workloads. By reducing the disk I/O operations required for transaction logging, it minimizes the latency associated with synchronous writes, leading to improved overall performance.

  2. Reduced Lock Contention: In scenarios where contention arises due to exclusive locks held by transactions during the commit phase, Delayed Durability can alleviate the problem. With reduced disk I/O, the contention time decreases, resulting in a smoother execution of concurrent transactions.

  3. Lower Latency for Transaction Confirmation: By reducing the disk write latency, Delayed Durability shortens the time required to confirm a transaction, leading to faster response times for applications.



What Happens During Shutdown?


Of course, the implications of using Delayed Durability are that you might lose data. Even after a transaction has been committed, if it hasn't persisted yet and there was an unexpected shutdown, then it's lost.


This is probably not an option for many workloads, but for some specific workloads that can tolerate a certain amount of data loss, like application logs, this can be a great feature to reduce transaction latency and improve throughput.


So it's clear what happens when there is an unexpected shutdown, but what happens when the shutdown is planned? You might expect that during a planned shutdown, SQL Server will ensure that all pending transactions are committed to disk before allowing the shutdown process to complete so that committed transactions are not lost during the expected shutdown.


It might surprise you (as it surprised me) that this is not the case. SQL Server doesn't bother to flush the log buffer of the databases during a planned shutdown process, so you still might lose data. The same happens when you perform a failover using any of the high-availability solutions, such as Availability Groups, Failover-Cluster Instances, or Log Shipping.


If you can't tolerate any data loss during a planned shutdown, then you probably can't tolerate data loss at all, and Delayed Durability is not the right choice for you. But if you still choose to use Delayed Durability, and you would like to ensure that you don't lose any data during a planned shutdown (or failover), then make sure you execute the sys.sp_flush_log system stored procedure on each one of the relevant databases before you execute the shutdown command.



Conclusion


Delayed Durability in SQL Server provides a valuable optimization technique for improving transactional performance while maintaining data integrity. During an unexpected shutdown, you might lose some data. But you should be aware that the same behavior allowing data loss also happens during a planned shutdown or a planned failover.

84 Comments


Guest
Nov 01

đánh bài  là bộ môn phạt đỉnh cao, quen thuộc với các dân chơi làng cá. Đây có thể được xem là trò chơi phổ biến hàng đầu, chinh phục thủ công bằng đường đánh nhanh gọn, Tích hợp và tỷ lệ thưởng cực đậm. Việc tìm kiếm một sân chơi chất lượng, yêu cầu cao về bảo mật cũng được rất nhiều người chơi quan tâm. Nếu bạn cũng đang muốn có một địa chỉ “ruột” để bước vào địa chỉ hỗ trợ, những thông tin dưới đây rất đáng để tham khảo.


Like

Guest
Nov 01

https://cwin1.work/ là địa chỉ truy cập chính thức của thương hiệu Cwin, nổi bật với giao diện hiện đại, tốc độ nhanh và độ ổn định cao. Website được tối ưu cho cả máy tính và điện thoại, giúp người dùng dễ dàng trải nghiệm ở bất kỳ đâu. Cwin luôn chú trọng đầu tư vào hệ thống bảo mật để đảm bảo an toàn tuyệt đối cho người chơi. Ngoài ra, trang còn mang đến nhiều chương trình khuyến mãi giá trị và dịch vụ hỗ trợ tận tâm, giúp người dùng tận hưởng trọn vẹn thế giới giải trí chất lượng cao.

Like

Guest
Nov 01

https://88clb8.one/ là lựa chọn hoàn hảo dành cho người chơi muốn tận hưởng dịch vụ giải trí trực tuyến chất lượng và an toàn. Website được tối ưu hóa với giao diện thân thiện, tốc độ truy cập nhanh và tính ổn định cao. 88CLB luôn đặt sự hài lòng của người dùng lên hàng đầu bằng cách cung cấp hệ thống bảo mật mạnh mẽ, giao dịch minh bạch và nhiều chương trình khuyến mãi hấp dẫn. Với dịch vụ chuyên nghiệp và hỗ trợ tận tâm, đây chắc chắn là điểm đến lý tưởng để trải nghiệm giải trí trực tuyến đẳng cấp.

Like

Guest
Oct 31

https://u888.expert/ là một trong những kênh truy cập chính thức được khuyến nghị của U888 – nền tảng giải trí trực tuyến nổi bật nhờ sự ổn định và uy tín. Trang web được tối ưu về tốc độ, dễ thao tác và tương thích trên mọi thiết bị. U888 chú trọng bảo mật thông tin và mang đến môi trường an toàn cho tất cả người dùng. Ngoài ra, website còn có nhiều ưu đãi hấp dẫn, giúp người chơi nhận thêm nhiều phần thưởng giá trị. Đây là lựa chọn lý tưởng cho những ai tìm kiếm trải nghiệm giải trí chuyên nghiệp và đáng tin cậy.

Like

Guest
Oct 31

https://88clb8.dev/ là nền tảng giải trí trực tuyến hiện đại, nổi bật với tốc độ truy cập nhanh, giao diện thân thiện và độ an toàn cao. 88CLB luôn chú trọng đến trải nghiệm người dùng, mang đến không gian giải trí ổn định, bảo mật tuyệt đối và dịch vụ hỗ trợ tận tâm. Bên cạnh đó, trang thường xuyên triển khai nhiều chương trình khuyến mãi, mang đến cơ hội nhận thưởng giá trị cho người chơi. Đây là lựa chọn lý tưởng cho những ai muốn tận hưởng dịch vụ chuyên nghiệp và chất lượng trong môi trường trực tuyến an toàn.


Like

STAY IN TOUCH

Get New posts delivered straight to your inbox

Thank you for subscribing!

bottom of page