SQL Server Interview Question #278

What are SQL Server data files and log files?

SQL Server Internals & Administration Senior Advanced

Detailed Explanation

SQL Server databases use data files to store database pages and transaction log files to store sequential log records.

Primary data files commonly use the .mdf extension, secondary data files commonly use .ndf, and log files commonly use .ldf, although extensions are conventions rather than the fundamental storage definition.

Data and log files have different access patterns and recovery roles. Multiple log files generally do not improve log throughput because SQL Server writes through the active log structure sequentially rather than striping log writes across files.