{"id":217,"date":"2016-12-29T00:43:41","date_gmt":"2016-12-28T23:43:41","guid":{"rendered":"http:\/\/wpmututorials.com\/?p=217"},"modified":"2017-12-05T23:40:31","modified_gmt":"2017-12-05T22:40:31","slug":"shardb","status":"publish","type":"post","link":"https:\/\/wpmututorials.com\/plugins\/shardb\/","title":{"rendered":"Scaling WordPress MU with multiple databases"},"content":{"rendered":"<p>Our larger <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/mu.wordpress.org\"  >WordPress MU<\/a> install, <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/homeschooljournal.net\"  >Homeschool Journal<\/a> has been running on multiple databases for about 3 years. Technically, it&#8217;s possible to have thousands of blogs in a single database install. Usually where people running MU start to have issues with the number of blogs is with getting complete backups of the database. <\/p>\n<p>Upgrades with multiple databases have always been more work and many people running multiple databases typically did not upgrade until the .1 release of whatever version of MU. When I upgraded Homeschool Journal to MU 2.7.1, it was two weeks before I had found and repaired all of the database issues (via several plugins). I decided I wasn&#8217;t going to go through that again. <\/p>\n<p>With the number of blogs at <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/wordpress.com\"  >WordPress.com<\/a>, <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/automattic.com\"  >Automattic<\/a> must be using a database plugin that supports WordPress MU better. So, over a couple of weekends, I tweaked <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/wordpress.org\/extend\/hyperdb\/\"  >HyperDB<\/a> to use the same MD5 hash based sharding structure that we were using. <\/p>\n<p>I released <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/wpmututorials.com\/goto\/http:\/\/wordpress.org\/extend\/plugins\/shardb\/\"  >SharDB (Download)<\/a> last week as a beta release intended for larger WordPress MU installs using an existing 1-3 character MD5 hash (by blog id) based multi-database sharding structure. (Other structures will be added in early 2010.) The alpha testing of SharDB was carried out this fall with the help of a few people who I knew were using the same multi-database that we were. SharDB has been powering live sites since early October.<\/p>\n<p>SharDB has been tested with over 50 plugins including BuddyPress 1.1 through 1.1.3, domain mapping (both Donncha&#8217;s and my version) and my multi-site plugin. I have not found any issues with any of the tested plugins. It should support any plugin that accesses data via the $wpdb object. It has been used to upgrade live sites from 2.7.1 through to 2.8.6 and I&#8217;ve upgraded a test site to the WordPress MU 2.9 release candidate tagged 2009\/12\/21. (Note: I used the plugin in <a href=\"http:\/\/wpmututorials.com\/news\/mu-2-9-beta\/\">this post<\/a> to create the commentmeta tables before updating MU from 2.8.6 to 2.9RC.)<\/p>\n<p>One of the features that I really like about SharDB is that I don&#8217;t need to edit the database config when adding plugins (a feature inherited from HyperDB). Also, I haven&#8217;t had issues with plugins failing to create tables. As an added bonus, I added a handy column to the site admin blog screen so that you can see which database a blog&#8217;s tables are in.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our larger WordPress MU install, Homeschool Journal has been running on multiple databases for about 3 years. Technically, it&#8217;s possible to have thousands of blogs in a single database install. Usually where people running MU start to have issues with the number of blogs is with getting complete backups of the database. Upgrades with multiple databases have always been more work and many people running multiple databases typically did not upgrade until the .1 release of whatever version of MU. When I upgraded Homeschool Journal to MU 2.7.1, it was two weeks before I had found and repaired all of\u2026<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[308,304],"yst_prominent_words":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[]}},"featured_image_urls":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":"","tptn_thumbnail":""},"post_excerpt_stackable":"<p>Our larger WordPress MU install, Homeschool Journal has been running on multiple databases for about 3 years. Technically, it&#8217;s possible to have thousands of blogs in a single database install. Usually where people running MU start to have issues with the number of blogs is with getting complete backups of the database. Upgrades with multiple databases have always been more work and many people running multiple databases typically did not upgrade until the .1 release of whatever version of MU. When I upgraded Homeschool Journal to MU 2.7.1, it was two weeks before I had found and repaired all of&hellip;<\/p>\n","category_list":"<a href=\"https:\/\/wpmututorials.com\/category\/plugins\/\" rel=\"category tag\">Plugins<\/a>","author_info":{"name":"Ron","url":"https:\/\/wpmututorials.com\/author\/ron\/"},"comments_num":"61 comments","_links":{"self":[{"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/posts\/217"}],"collection":[{"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/comments?post=217"}],"version-history":[{"count":1,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/posts\/217\/revisions"}],"predecessor-version":[{"id":1708,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/posts\/217\/revisions\/1708"}],"wp:attachment":[{"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/media?parent=217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/categories?post=217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/tags?post=217"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/wpmututorials.com\/wp-json\/wp\/v2\/yst_prominent_words?post=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}