{"id":147,"date":"2014-04-04T01:11:44","date_gmt":"2014-04-04T09:11:44","guid":{"rendered":"http:\/\/www.tech.dimprash.com\/?p=147"},"modified":"2014-04-04T01:11:44","modified_gmt":"2014-04-04T09:11:44","slug":"sharding","status":"publish","type":"post","link":"http:\/\/www.tech.dimprash.com\/?p=147","title":{"rendered":"Sharding"},"content":{"rendered":"<p>Sharding is the equivalent of &#8220;horizontal partitioning&#8221;.  When you shard a database, you create replica&#8217;s of the schema, and then divide what data is stored in each shard based on a shard key.  For example, I might shard my customer database using CustomerId as a shard key &#8211; I&#8217;d store ranges 0-10000 in one shard and 10001-20000 in a different shard.  When choosing a shard key, the DBA will typically look at data-access patterns and space issues to ensure that they are distributing load and space across shards evenly.  <\/p>\n<p>?&#8221;Vertical partitioning&#8221; is the act of splitting up the data stored in one entity into multiple entities &#8211; again for space and performance reasons.  For example, a customer might only have one billing address, yet I might choose to put the billing address information into a separate table with a CustomerId reference so that I have the flexibility to move that information into a separate database, or different security context, etc.    <\/p>\n<p>To summarize &#8211; partitioning is a generic term that just means dividing your logical entities into different physical entities for performance, availability, or some other purpose.  &#8220;Horizontal partitioning&#8221;, or sharding, is replicating the schema, and then dividing the data based on a shard key.  &#8220;Vertical partitioning&#8221; involves dividing up the schema (and the data goes along for the ride).  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharding is the equivalent of &#8220;horizontal partitioning&#8221;. When you shard a database, you create replica&#8217;s of the schema, and then divide what data is stored in each shard based on a shard key. For example, I might shard my customer database using CustomerId as a shard key &#8211; I&#8217;d store ranges 0-10000 in one shard &hellip; <a href=\"http:\/\/www.tech.dimprash.com\/?p=147\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Sharding<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":1,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":148,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions\/148"}],"wp:attachment":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}