{"id":347,"date":"2017-06-06T05:49:19","date_gmt":"2017-06-06T12:49:19","guid":{"rendered":"http:\/\/www.kenwalger.com\/blog\/?p=347"},"modified":"2017-08-03T05:38:01","modified_gmt":"2017-08-03T12:38:01","slug":"mongodb-horizontal-scaling-sharding","status":"publish","type":"post","link":"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/","title":{"rendered":"MongoDB Horizontal Scaling through Sharding"},"content":{"rendered":"<p>There comes a time in many <a href=\"https:\/\/www.mongodb.com\">MongoDB<\/a> database, or any database for that matter, life cycles in which our data outgrows our servers. Either physically outgrows storage capabilities or the data grows so large that performance is degraded. Even scaling our physical servers up with a more powerful CPU, more RAM, or hard drives (vertical scaling) may not be enough. This is where horizontal scaling through sharding comes into practice.<\/p>\n<h3>Sharding<\/h3>\n<p>What is sharding exactly? It is the practice of distributing data across multiple machines. In MongoDB it supports instances with large data sets and needed high throughput operations. The data is distributed across all shards allowing the workload to be evenly shared. This has the potential for much better efficiency than a single server.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"349\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/attachment\/sharding-example\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?fit=600%2C485&amp;ssl=1\" data-orig-size=\"600,485\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sharding-example\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?fit=300%2C243&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?fit=600%2C485&amp;ssl=1\" class=\"alignnone size-full wp-image-349\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?resize=600%2C485\" alt=\"Sharded data distribution example\" width=\"600\" height=\"485\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-example.png?resize=300%2C243&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>Each cluster should, for redundancy, also be <a href=\"https:\/\/docs.mongodb.com\/manual\/replication\/\">replica sets<\/a> with <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/replica-set-primary\/\">primary<\/a> and <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/replica-set-members\/#replica-set-secondary-members\">secondary<\/a> servers.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"350\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/attachment\/clusters\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?fit=600%2C243&amp;ssl=1\" data-orig-size=\"600,243\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"clusters\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?fit=300%2C122&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?fit=600%2C243&amp;ssl=1\" class=\"alignnone size-full wp-image-350\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?resize=600%2C243\" alt=\"Sharded Cluster Example\" width=\"600\" height=\"243\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/clusters.png?resize=300%2C122&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>MongoDB\u00a0data is sharded at a <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/glossary\/\">collection<\/a> level, therefore it isn&#8217;t necessary to distribute the entire database across a sharded environment.<\/p>\n<h3>Cluster Configuration<\/h3>\n<p>There are three components to a <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/glossary\/#term-sharded-cluster\">sharded cluster<\/a> that we need. We need the shards themselves, a query router in the way of a <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/sharded-cluster-query-router\/\">mongos<\/a> server, and configuration or <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/sharded-cluster-config-servers\/\">config servers<\/a>.<\/p>\n<p>The shards are what store the subset of the data. The config servers store all of the metadata about the cluster and which shard houses what data. Data is stored in <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/sharding-data-partitioning\/\">chunks<\/a> on each shard and the config server keeps track of all that information.<\/p>\n<p>The mongos, in its role as a query router, acts as the interface between the application and the data. It routes queries and write operations to the appropriate shards. An application, therefore, will only access the data\u00a0<em>through<\/em> a mongos, never by touching the data itself. Queries are routed via the mongos to all shards\u00a0<strong>unless<\/strong> it can be determined the data resides on a particular shard.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"351\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/attachment\/shard-broadcast-operation\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?fit=600%2C587&amp;ssl=1\" data-orig-size=\"600,587\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"shard-broadcast-operation\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?fit=300%2C294&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?fit=600%2C587&amp;ssl=1\" class=\"alignnone size-full wp-image-351\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?resize=600%2C587\" alt=\"Broadcast Sharding\" width=\"600\" height=\"587\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-broadcast-operation.png?resize=300%2C294&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>There has to be a better way than broadcasting that request to\u00a0<strong>all<\/strong> shards though, right? As you might imagine, this &#8220;scatter\/gather&#8221; approach to querying can result in some long running operations. Well, I kind of eluded to it before by qualifying it with the &#8220;unless&#8221;, so there is a better way! Enter the <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/sharding-shard-key\/\">shard key<\/a>.<\/p>\n<h3>Shard Keys<\/h3>\n<p>A shard key determines how <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/document\/\">documents<\/a> in a collection are distributed across the shards. It is an indexed field, or indexed compound fields, that exists in\u00a0<strong>every<\/strong> document in the collection. Recall that MongoDB allows for a <a href=\"https:\/\/docs.mongodb.com\/manual\/core\/data-modeling-introduction\/\">flexible schema<\/a>\u00a0within the <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/document-model\/\">document model<\/a>. This is one consideration when choosing a shard key; every document must have the indexed field.<\/p>\n<p>If provided with a shard key during a query, the mongos knows how to route the request.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"352\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/attachment\/shard-targets-operation\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?fit=600%2C587&amp;ssl=1\" data-orig-size=\"600,587\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"shard-targets-operation\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?fit=300%2C294&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?fit=600%2C587&amp;ssl=1\" class=\"alignnone size-full wp-image-352\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?resize=600%2C587\" alt=\"Targeted shard query\" width=\"600\" height=\"587\" srcset=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/shard-targets-operation.png?resize=300%2C294&amp;ssl=1 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>This can greatly enhance performance. Choosing a good shard key, however, is very important. I&#8217;ve covered what goes into the selection of a good shard key in a <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/choosing-good-shard-key-mongodb\/\">different post<\/a>.<\/p>\n<h3>Trade offs to Sharding<\/h3>\n<p>As the saying goes, there&#8217;s no such thing as a free lunch. Sharding is the same way. Sharding your data sets increases infrastructure complexity as well as maintenance. One solution to help mitigate both of these is to utilize a DBaaS such as <a href=\"https:\/\/www.mongodb.com\/atlas\">Atlas<\/a>\u00a0to host your MongoDB data.<\/p>\n<p>If queries are run without including a shard key, the &#8220;scatter\/gather&#8221; approach is used. This can result in slow queries, therefore it is definitely something to remember when writing your applications.<\/p>\n<p>Once a collection is sharded, it cannot be unsharded. Similarly, once a shard key is selected, it cannot be changed. So these steps need to be undertaken with careful planning.<\/p>\n<p>If you are handling things yourself on your own hardware\u00a0I have briefly discussed some of the tools which can be used to check performance of a sharded collection in previous posts. Specifically in <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/mongodb-cli-tools\/\">MongoDB CLI Tools<\/a> and briefly in <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-explain-explained\/\">MongoDB explain() explained<\/a>.<\/p>\n<h3>Wrap Up<\/h3>\n<p>When your data has outgrown a single server, sharding is a great approach to keep your database performing well. There are some things to watch out for though. Make sure you choose a good shard key and stay up to date with database maintenance.<\/p>\n<p>There are a lot of MongoDB specific terms in this post. I created a <a href=\"https:\/\/www.echoskillstore.com\/MongoDB-Dictionary\/45103\">MongoDB Dictionary<\/a> skill for the <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01DFKC2SO\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01DFKC2SO&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=f9e513223de2525a72b95cf9561db55b\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Echo<\/a>\u00a0line of products. Check it out and you can say &#8220;Alexa, ask MongoDB what is a Shard?&#8221; and get a helpful response.<\/p>\n<hr \/>\n<p><em>Follow me on Twitter <a href=\"https:\/\/www.twitter.com\/kenwalger\">@kenwalger<\/a> to get the latest updates on my postings.<\/em><\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347&#038;t=MongoDB%20Horizontal%20Scaling%20through%20Sharding&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347&#038;p&#091;images&#093;&#091;0&#093;=https%3A%2F%2Fi0.wp.com%2Fwww.kenwalger.com%2Fblog%2Fwp-content%2Fuploads%2F2017%2F06%2Fsharding-e1496717243397.png%3Ffit%3D125%252C125%26ssl%3D1&#038;p&#091;title&#093;=MongoDB%20Horizontal%20Scaling%20through%20Sharding\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347&#038;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347&#038;title=MongoDB%20Horizontal%20Scaling%20through%20Sharding\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/reddit.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347&#038;title=MongoDB%20Horizontal%20Scaling%20through%20Sharding\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png?resize=48%2C48&#038;ssl=1\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=MongoDB%20Horizontal%20Scaling%20through%20Sharding&#038;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F347\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png?resize=48%2C48&#038;ssl=1\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>There comes a time in many MongoDB database, or any database for that matter, life cycles in which our data outgrows our servers. Either physically outgrows storage capabilities or the data grows so large that performance is degraded. Even scaling our physical servers up with a more powerful CPU, more RAM, or hard drives (vertical &hellip; <a href=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-horizontal-scaling-sharding\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MongoDB Horizontal Scaling through Sharding&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":348,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,3],"tags":[61],"yst_prominent_words":[117,487,99,739,104,486,474,483,737,87,489,488,738,93,736,469,741,485,740,477],"class_list":["post-347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mongodb","category-nosql","tag-sharding","pmpro-has-access"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/06\/sharding-e1496717243397.png?fit=125%2C125&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8lx70-5B","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":5,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions\/490"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media\/348"}],"wp:attachment":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/tags?post=347"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}