Microsoft recently announced the preview of SQL Server Accelerated Database Recovery (ADR). ADR is a redesigned SQL database engine feature that improves database recovery process in Azure in the presence of long running transactions.
Image source; Microsoft
The key benefits of ADR are, Fast and consistent database recovery, Instantaneous transaction rollback, and Aggressive log truncation.
With ADR, long running transactions do not impact the overall recovery time, enabling fast and consistent database recovery irrespective of the number of active transactions in the system or their sizes.
With ADR, transaction rollback is instantaneous, irrespective of the time that the transaction has been active or the number of updates that has performed.
With ADR, the transaction log is aggressively truncated, even in the presence of active long running transactions, which prevents it from growing out of control.
The four key components of ADR are:
Persisted Version Store (PVS)
The persisted version store is a new SQL database engine mechanism for persisting the row versions generated in the database itself instead of the traditional tempdb version store. PVS enables resource isolation as well as improves availability of readable secondaries.
Logical Revert
Logical revert is the asynchronous process responsible for performing row level version based Undo - providing instant transaction rollback and undo for all versioned operations.
Keeps track of all aborted transactions
- Performs rollback using PVS for all user transactions
- Releases all locks immediately after transaction abort
sLog
sLog is a secondary in-memory log stream that stores log records for non-versioned operations (such as metadata cache invalidation, lock acquisitions, and so on). The sLog is:
- Low volume and in-memory
- Persisted on disk by being serialized during the checkpoint process
- Periodically truncated as transactions commit
- Accelerates redo and undo by processing only the non-versioned operations
- Enables aggressive transaction log truncation by preserving only the required log records
Cleaner
The cleaner is the asynchronous process that wakes up periodically and cleans page versions that are not needed.