Thursday, May 5, 2011

Brief about Protocols



TCP/IP - Widly accepted. You can connect from Unix machine also.
Shared Memory - When only Shared Memory is enabled, you can connect only from local machine. You cannot connect from remote machines.
Names Pipes - Microsoft Windows only.
VIA - Used for special hardware

To add more on this TCP/IP is a widely used protocol for Internet and is often faster then Named Pipes.Named pipe could work only in LAN (Local N/W) and often performs poorly in slow N/Ws.

Moreover, Kerberos Authentication Protocol could be integrated with TCP/IP only so it is better for security perspective also.

Wednesday, May 4, 2011

Write-Ahead Transaction Log

This topic describes the role of the write-ahead transaction log in recording data modifications to disk. For basic information about transaction logs, see Introduction to Transaction Logs.

SQL Server 2005 uses a write-ahead log (WAL), which guarantees that no data modifications are written to disk before the associated log record is written to disk. This maintains the ACID properties for a transaction. For more information about transactions and ACID properties, see Transactions (Database Engine).

To understand how the write-ahead log works, it is important for you to know how modified data is written to disk. SQL Server maintains a buffer cache into which it reads data pages when data must be retrieved. Data modifications are not made directly to disk, but are made to the copy of the page in the buffer cache. The modification is not written to disk until a checkpoint occurs in the database, or the modification must be written to disk so the buffer can be used to hold a new page. Writing a modified data page from the buffer cache to disk is called flushing the page. A page modified in the cache, but not yet written to disk, is called a dirty page.
At the time a modification is made to a page in the buffer, a log record is built in the log cache that records the modification. This log record must be written to disk before the associated dirty page is flushed from the buffer cache to disk. If the dirty page is flushed before the log record is written, the dirty page creates a modification on the disk that cannot be rolled back if the server fails before the log record is written to disk. SQL Server has logic that prevents a dirty page from being flushed before the associated log record is written. Log records are written to disk when the transactions are committed.