seniorT-SQL

What is SQL Server Transaction Log architecture and how does write-ahead logging work?

Updated May 17, 2026

Short answer

SQL Server uses a transaction log to guarantee durability using write-ahead logging (WAL).

Deep explanation

The transaction log records every data modification before the changes are written to data files. This ensures durability (ACID). Write-Ahead Logging guarantees that log records are hardened to disk before corresponding data pages are flushed. In case of crash, SQL Server replays the log (redo) or rolls back incomplete transactions (undo). The log is logically divided into VLFs (Virtual Log Files), and improper sizing leads to fragmentation and recovery delays.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More T-SQL interview questions

View all →