{"id":1579,"date":"2009-08-27T22:45:16","date_gmt":"2009-08-28T03:45:16","guid":{"rendered":"http:\/\/www.bytebot.net\/blog\/?p=1579"},"modified":"2009-08-27T22:47:48","modified_gmt":"2009-08-28T03:47:48","slug":"sharding-for-the-masses-introducing-the-spider-storage-engine","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine","title":{"rendered":"Sharding for the masses: Introducing the SPIDER storage engine (OpenSQLCamp @ FrOSCon)"},"content":{"rendered":"<p>This is the Sharding for the masses: Introducing the SPIDER storage engine by <a href=\"http:\/\/datacharmer.blogspot.com\/\">Giuseppe Maxia<\/a>, given at OpenSQLCamp, at FrOSCon, in August 2009. These are somewhat live notes, and the <a href=\"http:\/\/www.slideshare.net\/datacharmer\/sharding-for-the-masses\">slides<\/a> are available too.<\/p>\n<p><center><\/p>\n<div style=\"width:425px;text-align:left\" id=\"__ss_1893290\"><a style=\"font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;\" href=\"http:\/\/www.slideshare.net\/datacharmer\/sharding-for-the-masses\" title=\"Sharding for the masses\">Sharding for the masses<\/a><object style=\"margin:0px\" width=\"425\" height=\"355\"><param name=\"movie\" value=\"http:\/\/static.slidesharecdn.com\/swf\/ssplayer2.swf?doc=shardingforthemasses-090822071930-phpapp01&#038;stripped_title=sharding-for-the-masses\" \/><param name=\"allowFullScreen\" value=\"true\"\/><param name=\"allowScriptAccess\" value=\"always\"\/><\/object><\/p>\n<div style=\"font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;\">View more <a style=\"text-decoration:underline;\" href=\"http:\/\/www.slideshare.net\/\">documents<\/a> from <a style=\"text-decoration:underline;\" href=\"http:\/\/www.slideshare.net\/datacharmer\">Giuseppe Maxia<\/a>.<\/div>\n<\/div>\n<p><\/center><\/p>\n<p>Why sharding? Scaling, of course. The MySQL way to solve this, is replication (even Yahoo! and Google use this).<\/p>\n<p>When the master doesn&#8217;t have enough resources to cope with what you do (i.e. large data sets), replication chokes.<\/p>\n<p>You can use proxies for sharding. There exists MySQL Proxy (can be programmed using a scripting language &#8211; Lua), HSCALE (built on top of MySQL Proxy), SpockProxy (a fork of MySQL Proxy, without LUA scripting, specialised for sharding), in the market these days. This however, is the single point of failure &#8211; everything has to pass through one proxy. <\/p>\n<p>Enter SPIDER &#8211; a MySQL storage engine, built on top of the partitions engine. It associates a partition with a remote server, and is transparent to the user. Its developed by Kentoku Shiba.<\/p>\n<p>Installation: Get 5.1.37 sources, then get the source code for <a href=\"http:\/\/launchpad.net\/spiderformysql\">Spider 1.0<\/a>, and then get the patch for <a href=\"http:\/\/launchpad.net\/partitionconditionpushdownformysql\">condition pushdown<\/a>.<\/p>\n<p>Why the condition pushdown patch? Remote server works less, by receiving the condition. The SPIDER engine without the condition pushdown patch is still fast, but it can be more than 10x faster with condition pushdowns. <\/p>\n<p>http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/condition-pushdown-optimization.html (works with NDBCLUSTER), http:\/\/dev.mysql.com\/doc\/refman\/5.4\/en\/condition-pushdown-optimization.html (works with MyISAM). The patch by Kentoku, will add cond_push and cond_pop, to ha_partition &#8211; so now, every storage engine that uses table partitioning can get condition pushdown through ha_partition.<\/p>\n<p>You need to setup the engine first: <a href=\"http:\/\/datacharmer.org\/downloads\/spider_setup.sql\">http:\/\/datacharmer.org\/downloads\/spider_setup.sql<\/a> (the SQL is also available in the DOCS).<\/p>\n<p><a href=\"http:\/\/datacharmer.org\/downloads\/spider_remote_employees.sql\">spider_remote_employees.sql<\/a> &#8211; use this in conjunction with <a href=\"http:\/\/launchpad.net\/test-db\/\">http:\/\/launchpad.net\/test-db\/<\/a> &#8211; a good example of how to use the SPIDER storage engine.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Sharding%20for%20the%20masses%3A%20Introducing%20the%20SPIDER%20storage%20engine%20%28OpenSQLCamp%20%40%20FrOSCon%29&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2009%2F08%2F27%2Fsharding-for-the-masses-introducing-the-spider-storage-engine&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"929956bdce\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-1579\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-1579\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-1579\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>This is the Sharding for the masses: Introducing the SPIDER storage engine by Giuseppe Maxia, given at OpenSQLCamp, at FrOSCon, in August 2009. These are somewhat live notes, and the slides are available too. Sharding for the masses View more documents from Giuseppe Maxia. Why sharding? Scaling, of course. The MySQL way to solve this, [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Sharding%20for%20the%20masses%3A%20Introducing%20the%20SPIDER%20storage%20engine%20%28OpenSQLCamp%20%40%20FrOSCon%29&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2009%2F08%2F27%2Fsharding-for-the-masses-introducing-the-spider-storage-engine&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"929956bdce\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-1579\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-1579\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-1579\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2009\/08\/27\/sharding-for-the-masses-introducing-the-spider-storage-engine?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[23],"tags":[1000,1775,999,222,998,116],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-pt","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2832,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2013\/11\/30\/groonga-fulltext-search-library-for-cloud-web","url_meta":{"origin":1579,"position":0},"title":"groonga &#8211; fulltext search library for cloud &#038; web","date":"30\/11\/2013","format":false,"excerpt":"This is an incomplete fragment from 2011. Figure its worth publishing this now, considering MariaDB is likely to get groonga in the near future. The groonga team have released MariaDB 10.0.6 binaries as well. This is all part of the mroonga\u00a0project. These were my quick notes from the groonga talk\u2026","rel":"","context":"In &quot;MariaDB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1451,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2009\/04\/19\/its-a-storage-engine-world-after-all","url_meta":{"origin":1579,"position":1},"title":"Its a storage engine world, after all&#8230;","date":"19\/4\/2009","format":false,"excerpt":"While Zack covered the storage engine and appliances sessions pretty well, I feel he's missed out on a few important new engines (or engine related talks): DDEngine will be represented, speaking about Automated data versioning with a storage engine Long time MySQL Community Member Beat Vontobel, will be presenting on\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":834,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/06\/04\/horizontal-scaling-with-hivedb","url_meta":{"origin":1579,"position":2},"title":"Horizontal Scaling with HiveDB","date":"4\/6\/2008","format":false,"excerpt":"At the MySQL Conference & Expo 2008, Britt Crawford and Justin McCarthy, both from Cafepress.com, gave us a very interesting talk on scaling with HiveDB. I took a few notes (pasted below), their slides are online (warning: 6.1MB PDF), and if you're after their abstract its available as well. I\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3300,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2016\/12\/05\/tab-sweep-mysql-ecosystem-edition","url_meta":{"origin":1579,"position":3},"title":"Tab Sweep &#8211; MySQL ecosystem edition","date":"5\/12\/2016","format":false,"excerpt":"Tab housekeeping but I also realise that people seem to have missed announcements, developments, etc. that have happened in the last couple of months (and boy have they been exciting). I think we definitely need something like the now-defunct MySQL Newsletter (and no, DB Weekly or NoSQL Weekly just don't\u2026","rel":"","context":"In &quot;MariaDB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1481,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2009\/05\/05\/barry-abrahamson-talks-about-wordpresscom-technicals","url_meta":{"origin":1579,"position":4},"title":"Barry Abrahamson, talks about WordPress.com technicals","date":"5\/5\/2009","format":false,"excerpt":"While at the MySQL Conference, I caught up with Barry Abrahamson, the systems wrangler\/de-facto DBA behind Wordpress.com (and all other Automattic properties). Watch the video. You probably already know that Wordpress itself is built on top of MySQL. And despite everything you might have heard about our (MySQL\/Sun's) new founders,\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":537,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/26\/mysql-at-google","url_meta":{"origin":1579,"position":5},"title":"MySQL at Google","date":"26\/4\/2007","format":false,"excerpt":"MySQL: The Real Grid Database, Mark Callaghan, Chip Turner A tremendous amount of work also done by Wei Li and Gene Pang. Google has a large MySQL deployment, and they enhance it as needed. MySQL@Google: too many queries, transactions, data, and rapid growth. Real workload with OLTP and reporting. Workload\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/1579"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=1579"}],"version-history":[{"count":3,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/1579\/revisions"}],"predecessor-version":[{"id":1581,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/1579\/revisions\/1581"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=1579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=1579"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=1579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}