<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edwin M SarmientoAlwaysOn Readable Secondaries: That Extra 14-bytes In Your Record You Didn&#8217;t Know About &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/that-extra-14-bytes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.edwinmsarmiento.com</link>
	<description>Intentional Excellence</description>
	<lastBuildDate>Mon, 13 Apr 2026 21:00:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">84283043</site>		<item>
		<title>AlwaysOn Readable Secondaries: That Extra 14-bytes In Your Record You Didn&#8217;t Know About</title>
		<link>https://www.edwinmsarmiento.com/that-extra-14-bytes/</link>
		<comments>https://www.edwinmsarmiento.com/that-extra-14-bytes/#comments</comments>
		<pubDate>Sat, 12 Jan 2013 23:51:19 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[AlwaysOn Availability Groups]]></category>
		<category><![CDATA[Availability Groups]]></category>
		<category><![CDATA[readable secondaries]]></category>
		<category><![CDATA[row versioning]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<guid isPermaLink="false">http://bassplayerdoc.wordpress.com/?p=713</guid>

				<description><![CDATA[&#8211; &#8220;Progress comes at a price.&#8221; Edwin Sarmiento- I&#8217;ve responded to customers&#8217; inquiries about the benefits of implementing SQL Server 2012 AlwaysOn Availability Groups since Microsoft released a public CTP of &#8220;Denali.&#8221; I&#8217;ve delivered presentations, written articles, prepared proof-of-concept designs and even recorded a video on this topic. While it may be a new feature [&#8230;]]]></description>
					<content:encoded><![CDATA[<p style="text-align: center;"><em>&#8211; &#8220;Progress comes at a price.&#8221; Edwin Sarmiento-</em></p>
<p>I&#8217;ve responded to customers&#8217; inquiries about the benefits of implementing SQL Server 2012 AlwaysOn Availability Groups since Microsoft released a public CTP of &#8220;<em>Denali</em>.&#8221; I&#8217;ve delivered presentations, written articles, prepared proof-of-concept designs and even <a href="http://www.youtube.com/watch?v=A8lSl8nO1r4" target="_blank">recorded a video</a> on this topic. While it may be a new feature in SQL Server 2012, the concepts are the same as in the older versions of SQL Server. In a few words, I describe AlwaysOn Availability Groups as a &#8220;<em>database mirroring configuration sitting on top of a Windows Failover Cluster infrastructure.&#8221; </em>Why do I say this? It&#8217;s because I want SQL Server DBAs to leverage what they already know on features like database mirroring and failover clustering and apply them when dealing with AlwaysOn Availability Groups.</p>
<p>With the drive to maximize IT investments in organizations, I also get asked a lot about the concept of the readable secondaries. Now, I&#8217;d be honest. I try to stay away from anything that pertains to licensing but I sure do answer any technical question that may arise during the discussion. One of this is the concept of redirecting read-only workloads on the secondary replica. Sure, this is a great idea because you can offload your reporting applications from the primary replica to the secondary replica.  You can, then, provision faster disk subsystems and more memory on the secondary replica to accommodate the read-only workload that you can now run against it. This concept is really nothing new. It&#8217;s the concept behind a mirrored database that you take a snapshot from so you can run reports against it. Because of the maintenance overhead of creating database snapshots against mirrored databases, not too many customers implement it. But those who do understand what they&#8217;re up against. They know that the <strong>tempdb</strong> database on the mirrored server will now be experiencing more load because of the versioning applied to the mirrored database when a snapshot is taken. Now, <a href="http://msdn.microsoft.com/en-us/library/ff878253.aspx" target="_blank">Readable Secondaries</a> are basically that &#8211; a mirrored database that is constantly getting row versions shipped from the principal database. Since you cannot make any changes &#8211; whether schema or data &#8211;  to the mirrored database (or Readable Secondaries for AlwaysOn Availability Groups), neither can the version store in the database engine. Can you guess where those changes will be made?</p>
<p><strong>Answer</strong>: The principal database (or the primary replica in the case of AlwaysOn Availability Groups.)</p>
<p>With that in mind, all records that are being modified in the primary database will automatically get an <a href="http://msdn.microsoft.com/en-us/library/ms175492(v=sql.105).aspx" target="_blank"><strong>additional 14-bytes</strong></a> as a side effect of turning on Readable Secondaries. Now, you might be thinking, &#8220;<em>14 bytes isn&#8217;t all that bad, is it?</em>&#8221; Think again. A 100 byte row will grow by 14% once you make some modifications on it. Think about what that will do to your pages &#8211; index page splits that may cause index fragmentation or the allocation of a new data page if there isn&#8217;t enough space on the data page where the record is being stored. This also affects the amount of transaction log records that get sent to the secondary replicas and, therefore, affect the failover time which affects the overall recovery point objective and recovery time objective (RPO/RTO.)</p>
<p>To prove the point, let&#8217;s look at a record from a database that is configured in an AlwaysOn Availability Group. Using the undocumented DBCC commands &#8211; DBCC IND and DBCC PAGE, we can take a look at a particular record inside a database.</p>
<p><code style="font-size: 14px;"><span style="color: blue;">DBCC </span><span style="color: black;">IND </span><span style="color: gray;">(</span><span style="color: red;">'membership'</span><span style="color: gray;">,</span><span style="color: red;">'tblCommittees'</span><span style="color: gray;">,</span><span style="color: black;">1</span><span style="color: gray;">)<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">DBCC </span><span style="color: black;">TRACEON </span><span style="color: gray;">(</span><span style="color: black;">3604</span><span style="color: gray;">)<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">DBCC </span><span style="color: black;">PAGE </span><span style="color: gray;">(</span><span style="color: black;">membership</span><span style="color: gray;">, </span><span style="color: black;">1</span><span style="color: gray;">, </span><span style="color: black;">203</span><span style="color: gray;">, </span><span style="color: black;">3</span><span style="color: gray;">)<br />
</span></code></p>
<div id="attachment_714" style="width: 539px" class="wp-caption aligncenter"><a href="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page1.jpg"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-714" class="size-full wp-image-714" src="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page1.jpg" alt="Example of using DBCC IND with DBCC PAGE " width="529" height="330" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1.jpg 895w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1-300x187.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1-760x475.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1-518x324.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1-82x51.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page1-600x375.jpg 600w" sizes="(max-width: 529px) 100vw, 529px" /></a><p id="caption-attachment-714" class="wp-caption-text">Example of using DBCC IND with DBCC PAGE</p></div>
<p>I&#8217;m using a sample database called <strong>membership</strong> with a table named <strong>tblCommittees </strong>for this example. Using the DBCC IND command, I was able to retrieve the Page ID value for the record that I want to look at, in this case, page <strong>203</strong>. Currently, the row containing the <strong>CommitteeName</strong> column value <strong>Membership</strong> has a length of <strong>63 bytes</strong>. The membership database is joined in an AlwaysOn Availability Group but not configured with readable secondaries. Even if I modify the value of the <strong>CommitteeName</strong> column from <strong>Membership</strong> to <strong>Membershop</strong>, the size of the row remains the same.</p>
<p><a href="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page2.jpg"><img decoding="async" class="aligncenter size-full wp-image-715" src="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page2.jpg" alt="DBCC_PAGE2" width="529" height="334" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2.jpg 879w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2-300x189.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2-760x480.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2-518x327.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2-82x52.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page2-600x379.jpg 600w" sizes="(max-width: 529px) 100vw, 529px" /></a></p>
<p>After turning on readable secondaries on my AlwaysOn Availability Group, I updated the same column again, reverting it back to <strong>Membership</strong>. This time, the record size has increased by an additional <strong>14 bytes</strong>, bringing it up to <strong>77 bytes</strong>.</p>
<p><a href="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page3.jpg"><img decoding="async" class="aligncenter size-full wp-image-716" src="http://bassplayerdoc.files.wordpress.com/2013/01/dbcc_page3.jpg" alt="DBCC_PAGE3" width="529" height="292" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3.jpg 979w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3-300x166.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3-760x421.jpg 760w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3-518x287.jpg 518w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3-82x45.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2013/01/dbcc_page3-600x332.jpg 600w" sizes="(max-width: 529px) 100vw, 529px" /></a></p>
<p>This is the version store kicking in, appending 14 bytes in the row to contain the row versioning information. You&#8217;ll see the output of the DBCC PAGE command displaying the version information for the updated record (the size of the column remains the same because I&#8217;ve only modified one character in the column value. )</p>
<p>This is just one of those things to keep in mind when implementing AlwaysOn Availability Groups readable secondaries. make sure that you properly test your environment with your existing workload, including administrative workloads such as batch processes and index maintenance.</p>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/that-extra-14-bytes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">713</post-id>	</item>
	</channel>
</rss>