{"id":3685,"date":"2014-02-25T22:32:42","date_gmt":"2014-02-25T12:32:42","guid":{"rendered":"https:\/\/www.flamingspork.com\/blog\/?p=3685"},"modified":"2014-03-10T17:40:18","modified_gmt":"2014-03-10T07:40:18","slug":"ghosts-of-mysql-past-part-7-pbxt","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2014\/02\/25\/ghosts-of-mysql-past-part-7-pbxt\/","title":{"rendered":"Ghosts of MySQL Past, Part 7: PBXT"},"content":{"rendered":"<p>Recently, I\u00e2\u20ac\u2122ve been writing based on <a href=\"http:\/\/mirror.linux.org.au\/linux.conf.au\/2014\/Wednesday\/28-Past_Present_and_future_of_MySQL_and_variants_-_Stewart_Smith.mp4\">my linux.conf.au 2014 talk, which you can watch the recording of<\/a>. Also see <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/03\/past-present-and-future-of-mysql-and-variants-part-1-ghosts-of-mysql-past\/\">Part 1<\/a>, <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/04\/ghosts-of-mysql-past-part-2\/\">Part 2<\/a>, <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/05\/ghosts-of-mysql-past-part-3\/\">Part 3,<\/a> <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/06\/ghosts-of-mysql-past-part-4-a-million-features-for-enterprise\/\">Part 4<\/a>, <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/14\/ghosts-of-mysql-past-part-5-the-era-of-acquisitions\/\">Part 5<\/a> and <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/16\/ghosts-of-mysql-past-part-6-the-engine-revs\/\">Part 6<\/a>. My feed feel off Planet MySQL for a bit so you may have missed those posts &#8211; so feel free to go on a trip down memory lane before returning here for, well, more of a trip down memory lane.<\/p>\n<p>At the start of 2005, Paul McCullagh started working on a new transactional storage engine for MySQL. He announced it in early 2006, so the majority of initial development was done before Oracle bought InnoBase Oy.<\/p>\n<p>It&#8217;s at this point I should correct myself from my <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/14\/ghosts-of-mysql-past-part-5-the-era-of-acquisitions\/\">Part 5<\/a> where I was talking about when Maria started &#8211; it was actually at the start of 2005 when the project started, about 10 months before InnoDB Friday. I think this was mostly small scale work at first, before months later having a larger focus on it.<\/p>\n<p>But anyway, let&#8217;s talk about PBXT! It had a different architecture than InnoDB and thus could have an interesting set of performance characteristics. The shortest way to describe the original architecture is &#8220;kind of log based&#8221;. Rows are written to a log file and there&#8217;s a handle file that points to where the rows are in the log.<\/p>\n<p>Also, the design had both a fixed size and a variable sized part of the row. The fixed size part was stored alongside the handle in the record data file, so it was incredibly quick at getting the fixed size part of the row.<\/p>\n<p>Not having to write data twice and having really quick access to some columns gave PBXT a quite decent performance advantage for many work loads.<\/p>\n<p>The BLOB Streaming feature that was also worked on (originally just for PBXT and then for any engine) was quite ahead of its time. Think HandlerSocket but think of it done more correctly. HandlerSocket is an awful binary protocol that supports very limited operations and uses two TCP ports (one for reads, one for writes). The blob streaming used HTTP, something that anyone could use and manipulate and proxy and whatever you&#8217;d want.<\/p>\n<p>If we look at Paul&#8217;s <a href=\"http:\/\/pbxt.blogspot.com.au\/2007\/06\/pbxt-top-5-wishes-for-mysql-of-storage.html\">Top 5 Wishes for storage engines<\/a>, an engine test suite and sane APIs (or at least documented) would clearly have helped. Having to do API tracing to discover when you should start a transaction is probably not the best way to attract developers &#8211; the amount of time that could have been saved given better interfaces in the server was immense (and not just for PBXT developers).<\/p>\n<p>So, why aren&#8217;t we all using PBXT now? Well&#8230; if MySQL had shipped with PBXT, it would possibly have been a different story. There was (and indeed is) a very uneven playing field for MySQL storage engines. If you&#8217;re in the main MySQL tree then you&#8217;re everywhere. If not, then you&#8217;ve got a heck of a lot of work on packaging and keeping up to date with various API changes (not to mention ABI, which since we&#8217;re talking C++ and since we&#8217;re talking MySQL, changed a lot). With InnoDB being &#8220;good enough&#8221; for many and actually being forced to improve due to challengers such as PBXT (as well as being in the tree) it just continued to have the majority of the users&#8230; and it&#8217;s not easy making money as a storage engine vendor &#8211; and developing a storage engine does cost money.<\/p>\n<p>With no more than a couple of people working on it at any one time, it&#8217;s amazing that PBXT had such a big influence &#8211; and we can likely credit many InnoDB performance improvement to PBXT being so much better in some areas.<\/p>\n<p>An interesting side story: I was sending some build fixes\/complier warning fixes and other minimal patches to Paul when MySQL belonged to Sun and he mentioned that perhaps it was time he had a contributor agreement. I pointed out the Sun contributor agreement as an example of one that could be used, and maybe he could just replace &#8220;Sun Microsystems&#8221; with &#8220;PrimeBase&#8221; and I could submit that to the Sun system &#8211; at the very least, it would be amusing. Paul said that sounded like a great idea and I submitted Sun&#8217;s contributor agreement (which it expected outside contributors to agree to) to Sun for them to agree to.<\/p>\n<p>Well&#8230; a few weeks later I got a response, and Sun wasn&#8217;t exactly keen on it &#8211; until I pointed out a few times that it was in fact their agreement and then finally it was all okay.<\/p>\n<p>If your company wants people to agree to a contributor agreement: see if they&#8217;d agree to it if it was for someone else. It was an interesting exercise.<\/p>\n<p>Further reading:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.primebase.org\/download\/pbxt_ug_sept_2006.pdf\">PBXT at MySQL User Conference 2006<\/a><\/li>\n<li><a href=\"http:\/\/www.primebase.org\/download\/pbxt_mysql_uc_2007.pdf\">PBXT at MySQL User Conference 2007<\/a><\/li>\n<li><a href=\"http:\/\/pbxt.blogspot.com\">The PBXT Blog<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I\u00e2\u20ac\u2122ve been writing based on my linux.conf.au 2014 talk, which you can watch the recording of. Also see Part 1, Part 2, Part 3, Part 4, Part 5 and Part 6. My feed feel off Planet MySQL for a &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/02\/25\/ghosts-of-mysql-past-part-7-pbxt\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1,14],"tags":[628,518,279],"class_list":["post-3685","post","type-post","status-publish","format-standard","hentry","category-general","category-mysql","tag-mysql","tag-pbxt","tag-storage-engine"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-Xr","jetpack-related-posts":[{"id":1077,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/04\/19\/mysql-5124-stew1-with-maria-and-pbxt\/","url_meta":{"origin":3685,"position":0},"title":"mysql-5.1.24-stew1 (with Maria and PBXT)","author":"Stewart Smith","date":"2008-04-19","format":false,"excerpt":"I've hacked around a bit to get PBXT to compile in tree, and pulled in the Maria engine. Both are latest source. So, want to try out Maria? Want to try out PBXT? Just want to do .\/configure and go with it, just like building a normal MySQL Server? Grab\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1636,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/05\/15\/size-of-storage-engines\/","url_meta":{"origin":3685,"position":1},"title":"Size of Storage Engines","author":"Stewart Smith","date":"2009-05-15","format":false,"excerpt":"For whatever reason, let's look at \"Total Physical Source Lines of Code\" from a recent mysql-6.0 tree (and PBXT from PBXT source repo): See the spreadsheet here. Raw data: Blackhole\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 336 CSV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1143 Archive\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2960 MyISAM\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 34019 PBXT\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 41732 Maria\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 69019 InnoDB\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 82557 Falcon\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 91158 NDB\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 365272 NDB has a\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"http:\/\/spreadsheets.google.com\/pub?key=r_gtZ-mKTsbSlp6anfnACXw&oid=1&output=image","width":350,"height":200},"classes":[]},{"id":3291,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/04\/18\/where-are-they-now-mysql-storage-engines\/","url_meta":{"origin":3685,"position":2},"title":"Where are they now: MySQL Storage Engines","author":"Stewart Smith","date":"2013-04-18","format":false,"excerpt":"There was once a big hooplah about the MySQL Storage Engine Architecture and how it was easy to just slot in some other method of storage instead of the provided ones. Over the years I've repeatedly mentioned how this wasn't really the case and that it was remarkably non trivial.\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2118,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/08\/18\/storage-engine-independent-test-suite\/","url_meta":{"origin":3685,"position":3},"title":"Storage Engine independent test suite","author":"Stewart Smith","date":"2010-08-18","format":false,"excerpt":"This is something that has never existed in the MySQL world. Nothing to help you start developing your engine. Sure, you could start running the whole test suite against your engine.... but where it wasn't specifically MyISAM, you'd certainly hit things that were.. well... as simple as having to change\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":914,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/11\/09\/mysql-5122-stew2\/","url_meta":{"origin":3685,"position":4},"title":"mysql-5.1.22-stew2","author":"Stewart Smith","date":"2007-11-09","format":false,"excerpt":"New: Updated NDB Compressed LCP and BACKUP patches (now with O_DIRECT support) InnoDB patch for Windows that should give ~5x improvement on commits\/sec (Bug31876) Everything in current telco-6.3 tree (ndb ~6.3.5) Lots of NDB improvements and new features over regular 5.1. WL3686 Remove read before update WL2680 NDB Batched Update\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3347,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/05\/24\/an-old-note-on-the-storage-engine-api\/","url_meta":{"origin":3685,"position":5},"title":"An old note on the Storage Engine API","author":"Stewart Smith","date":"2013-05-24","format":false,"excerpt":"Whenever I stick my head into the MySQL storage engine API, I'm reminded of a MySQL User Conference from several years ago now. Specifically, I'm reminded of a slide from an early talk at the MySQL User Conference by\u00c2\u00a0Paul McCullagh describing developing PBXT. For \"How to write a Storage Engine\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=3685"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3685\/revisions"}],"predecessor-version":[{"id":3687,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3685\/revisions\/3687"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=3685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=3685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=3685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}