Accelerated Database Recovery (ADR) in SQL Server

Accelerated Database Recovery (ADR) is one of the most transformative features in recent SQL Server releases, and with SQL Server 2025, it’s more powerful and flexible than ever.

ADR is a SQL Server feature designed to drastically improve database availability by reengineering the recovery process. Traditional recovery could take a long time, especially with long-running transactions, because SQL Server had to scan the transaction log from the oldest uncommitted transaction. ADR changes this by introducing a new architecture that makes recovery and rollback nearly instantaneous, regardless of transaction length or database activity.

Key Benefits:

Fast and consistent recovery: Recovery time is no longer affected by the number or size of active transactions.

Instantaneous rollback: Even very long-running transactions can be rolled back instantly.

Aggressive log truncation: The transaction log is truncated more aggressively, preventing log growth even with active long transactions.

How Does ADR Work?

ADR introduces several new internal components:

Persistent Version Store (PVS): Stores row versions in the user database, not tempdb, allowing for fast undo operations.

Secondary Log Stream (SLOG): Tracks non-versioned operations for quick access during recovery.

Logical Revert: Enables fast rollback by reverting only the affected rows, not the entire transaction log.

ADR Recovery Phases:

Analysis: Identifies the state of transactions at the time of a crash, reconstructs SLOG.

Redo: Replays committed changes. With ADR, this is split into two subphases, making it much faster.

Undo: Instantly rolls back uncommitted transactions using PVS and SLOG, instead of scanning the log.






The standout enhancement in SQL Server 2025 is that ADR can now be enabled for tempdb. This is a game-changer for environments with heavy use of temp tables or table variables, as it brings the benefits of instantaneous rollback and aggressive log truncation to workloads that previously could suffer from long rollbacks and transaction log bloat in tempdb.

                                                            Enable ADR for a Database

           ALTER DATABASE [YourDatabase] SET ACCELERATED_DATABASE_RECOVERY = ON;

Best Practices and Considerations

When to use ADR: Ideal for workloads with unavoidable long-running transactions or where fast recovery and minimal log growth are critical.

Monitor PVS: Persistent Version Store can consume space; monitor and manage accordingly.

Batch small transactions: For workloads with many single-row modifications, consider batching to optimize ADR performance.

Comments

Popular posts from this blog

How data is replicated from the Primary Replica to the Secondary Replica in a SQL Server Always On Availability Group

COPILOT Feature in SQL Server 2025