<?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>iBlog, iByte, iBrianiBlog, iByte, iBrian &#187; Performance</title>
	<atom:link href="http://blog.brianbuikema.com/category/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brianbuikema.com</link>
	<description>Technology Moves as Fast as We Move It by Brian Buikema</description>
	<lastBuildDate>Tue, 05 Mar 2013 15:33:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>MongoDB Sharding:  A Detailed Overview and 15 Minute High Speed Read</title>
		<link>http://blog.brianbuikema.com/2011/01/mongodb-sharding-a-detailed-overview-and-15-minute-high-speed-read/</link>
		<comments>http://blog.brianbuikema.com/2011/01/mongodb-sharding-a-detailed-overview-and-15-minute-high-speed-read/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 03:20:30 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Document Repository]]></category>
		<category><![CDATA[Mongodb]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Ubunto]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[cloudcomputing]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[documentrepository]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1265</guid>
		<description><![CDATA[Scaling is a key feature of MongoDB. And even though manual sharding is supported by most databases, MongoDB supports the concept of autosharding. This 15 minute high speed post provides a detailed overview of autosharding in MongoDB and, specifically, how to create shards supporting autosharding in MongoDB. The process of splitting up data and storing [...]]]></description>
			<content:encoded><![CDATA[<p>Scaling is a key feature of MongoDB.  And even though manual sharding is supported by most databases, MongoDB supports the concept of <em>autosharding</em>.  This 15 minute high speed post provides a detailed overview of autosharding in MongoDB and, specifically, how to create shards supporting autosharding in MongoDB.</p>
<p>The process of splitting up data and storing portions of data on different machines is called <em>sharding</em>.  By splitting up data across machines, it becomes possible to store more data and handle much more load without requiring large or powerful machines, e.g., machines that consist of powerful CPU&#8217;s and/or massive amounts of RAM.</p>
<p>Two types are sharding can occur.  <em>Manual sharding</em> and <em>autosharding</em>.</p>
<p>In <em>manual sharding</em>, the application code manages storing different data on different servers and querying the appropriate server to get it back.  Manual sharding can be done with virtually any database software package.</p>
<p>In MongoDB <em>autosharding</em>, some of the administrative overhead required in manual sharding is eliminated.  The cluster of database servers, or <em>shards</em>, handles splitting up of data and rebalancing of data automatically.</p>
<h2>Autosharding</h2>
<p>The basic concept behind MongoDB&#8217;s sharding is to break up collections into smaller chunks, or <em>documents</em>.  These documents can be distributed across shards so that each shard is responsible for a subset of the total dataset.</p>
<p>As an example, consider the following.  When you set up sharding you choose a key from a collection and use that key&#8217;s values to split up the data.  This key is called the <em>shard key</em>.</p>
<p>Suppose we had a collection of contacts.  If we chose &#8220;lastName&#8221; as our shard key, one shard could hold documents where &#8220;lastName&#8221; starts with A-F, the next shard could hold last names from G-P, and the final shard could hold last names Q-Z.  As you add or remove shards, MongoDB would rebalance this data so that each shard was getting a balanced amount of traffic and a practical amount of data.</p>
<p>So when should you decide to start sharding?  Consider the following reasons:</p>
<blockquote>
<ul>
<li>When you&#8217;ve run out of disk space on your current machine.</li>
<li>You want to write data faster than a single mongod can handle.</li>
<li>You want to keep a larger portion of data in memory to improve performance.</li>
</ul>
</blockquote>
<h2>Setting up Sharding</h2>
<p>Three different components are involved in sharding as follows:</p>
<h4>shard</h4>
<p style="padding-left: 30px;">A shard is a container that holds a subset of a collection&#8217;s data.  A shard is either a single mongod server (for development/testing), or a replica set (for production).</p>
<h4>mongos</h4>
<p style="padding-left: 30px;">This is the router process.  It routes requests and aggregates responses.  It doesn&#8217;t store any data or configuration information, although it does cache information from the config servers.</p>
<h4>config server</h4>
<p style="padding-left: 30px;">Config servers store the configuration of the cluster.  For example, which data is located on which shard.  Used by mongos to determine request routing.</p>
<h3>Starting the Servers</h3>
<p>First we need to strat up our config server and mongos.  We need to start a config server because mongos uses it to get its configuration.</p>
<pre class="brush: plain; title: ; notranslate">
$ mkdir -p ~/dbs/config
$ ./mongod --dbpath ~/dbs/config --port 20000
</pre>
<p>Now we start a mongos process for an application to connect to.  Routing servers do not even need a data directory, but they need to know the location of the config server.</p>
<pre class="brush: plain; title: ; notranslate">
$ ./mongos --port 30000 --configdb localhost:20000
</pre>
<p>Shard administration is always done through a mongos.</p>
<h3>Adding a Shard</h3>
<p>Start a normal mongod instance (or replica set), since this is what a shard naturally is</p>
<pre class="brush: plain; title: ; notranslate">
$ mkdir -p ~/dbs/shard1
$ ./mongod --dbpath ~/dbs/shard1 --port 10000
</pre>
<p>Now connect to the mongos process started earlier and add the shard to the cluster.</p>
<p>First, start up a shell connected to the mongos process as follows:</p>
<pre class="brush: plain; title: ; notranslate">
$ ./mongo localhost:30000/admin
</pre>
<p>Now add this shard with the <em><strong>addshard </strong></em>database command:</p>
<pre class="brush: plain; title: ; notranslate">
&gt; db.runCommand({addshard : &quot;localhost:10000&quot;, allowLocal : true})
{
    &quot;added&quot; : &quot;localhost:10000&quot;,
    &quot;ok&quot; : true
}
</pre>
<p>The &#8220;allowLocal&#8221; key is necessary only if you are running the shard on <strong>localhost </strong>and lets MongoDB know that you&#8217;re in development and know what you are doing.</p>
<h3>Sharding Data</h3>
<p>In order to allow MongoDB to distribute data, you have to explicitly turn sharding on at both the database and collection levels.  For example, the following enaables sharding for the database <em>acme</em>:</p>
<pre class="brush: plain; title: ; notranslate">
&gt; db.runCommand({&quot;enablesharding&quot; : &quot;acme&quot;})
</pre>
<p>Once you&#8217;ve enabled on the <em><strong>acme </strong></em>database, a collection is sharded by running the shardcollection command as follows:</p>
<pre class="brush: plain; title: ; notranslate">
&gt; db.runCommand({&quot;shardcollection&quot; : &quot;acme.products&quot;, &quot;key&quot;, : {&quot;_id&quot; : 1}})
</pre>
<p>Now the collection will be sharded by the &#8220;_id&#8221; key.  When data is added to <strong><em>acme</em></strong>, it will be automatically distributed across the shards based on the values of &#8220;_id&#8221;.</p>
<p>I hope this post enlightens you on the possibilities that MongoDB&#8217;s auto-sharding feature provides for ease of scaling.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2011/01/mongodb-sharding-a-detailed-overview-and-15-minute-high-speed-read/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MS CRM Dynamics:  Part 2 &#8211; Adding High Performance Advanced Tuning and Optimizations to Your CRM System to Ensure Top Performance</title>
		<link>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-2-adding-high-performance-advanced-tuning-and-optimizations-to-your-crm-system-to-ensure-top-performance/</link>
		<comments>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-2-adding-high-performance-advanced-tuning-and-optimizations-to-your-crm-system-to-ensure-top-performance/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 05:38:24 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1223</guid>
		<description><![CDATA[Part 1 discussed designing and executing advanced performance testing for the deployment of Microsoft CRM Dynamics solutions. This post discusses how to ensure your production CRM environment is tuned and optimized for top performance. My knowledge in this area has been largely obtained by working closely with Robert Shurtleff, the Microsoft CRM Dynamics Architect at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-1-designing-and-executing-advanced-performance-testing-of-your-crm-solution/">Part 1</a> discussed designing and executing advanced performance testing for the deployment of Microsoft CRM Dynamics solutions.</p>
<p>This post discusses how to ensure your production CRM environment is tuned and optimized for top performance.</p>
<p>My knowledge in this area has been largely obtained by working closely with Robert Shurtleff, the Microsoft CRM Dynamics Architect at Ciber.</p>
<p>Therefore I supply a link to <a href="http://rgsiiiya.blogspot.com/2010/11/dynamics-crm-advanced-performance.html">Robert&#8217;s post on this subject</a>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-2-adding-high-performance-advanced-tuning-and-optimizations-to-your-crm-system-to-ensure-top-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS CRM Dynamics:  Part 1 &#8211; Designing and Executing Advanced Performance Testing of Your CRM Solution</title>
		<link>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-1-designing-and-executing-advanced-performance-testing-of-your-crm-solution/</link>
		<comments>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-1-designing-and-executing-advanced-performance-testing-of-your-crm-solution/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 05:27:36 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1222</guid>
		<description><![CDATA[MS CRM Dynamics can be configured and customized per specific business needs. However, neglecting performance testing can kill your CRM deployment. Conversely, administering some common advanced performance tactics targeted at your specific usage can upgrade performance metrics to well above acceptable standards. More coming soon.]]></description>
			<content:encoded><![CDATA[<p>MS CRM Dynamics can be configured and customized per specific business needs.  However, neglecting performance testing can kill your CRM deployment.</p>
<p>Conversely, administering some common advanced performance tactics targeted at your specific usage can upgrade performance metrics to well above acceptable standards.</p>
<p>More coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2010/12/ms-crm-dynamics-part-1-designing-and-executing-advanced-performance-testing-of-your-crm-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
