<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FewBar.com - Make it good &#187; MySQL</title>
	<atom:link href="http://fewbar.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://fewbar.com</link>
	<description>Technology, life, and mischief, not in that order</description>
	<lastBuildDate>Fri, 23 Dec 2011 01:41:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>The 2011 O&#8217;Reilly Open Mysql Drizzle Maria Monty Percona Xtra Galera Xeround Tungsten Cloud Database Conference and Expo</title>
		<link>http://fewbar.com/2011/04/the-2011-oreilly-open-mysql-drizzle-maria-monty-percona-xtra-galera-xeround-tungsten-cloud-database-conference-and-expo/</link>
		<comments>http://fewbar.com/2011/04/the-2011-oreilly-open-mysql-drizzle-maria-monty-percona-xtra-galera-xeround-tungsten-cloud-database-conference-and-expo/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 17:49:00 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[mysqlconf]]></category>
		<category><![CDATA[percona]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=382</guid>
		<description><![CDATA[Or, for short, the &#8220;2011 O&#8217;Reilly MySQL Users Conference &#38; Expo&#8221;. Yes thats the short name of the conference that, thus far, has brought me nothing but good info, good times, and insight into one of the most interesting open source communities around. MySQL has been at the core of a real revolution in the [...]]]></description>
			<content:encoded><![CDATA[<p>Or, for short, the &#8220;2011 O&#8217;Reilly MySQL Users Conference &amp; Expo&#8221;. Yes thats the short name of the conference that, thus far, has brought me nothing but good info, good times, and insight into one of the most interesting open source communities around.</p>
<p>MySQL has been at the core of a real revolution in the way data driven applications have exploded on the internet. Its so easy to just install it, fire up php&#8217;s mysql driver, and boom, you&#8217;re saving and retrieving data. The *use* of MySQL has always been incredibly simple.</p>
<p>The politics has, at times, been confusing.<span id="more-382"></span> Dual licensing was sort of an odd concept when MySQL AB was doing it &#8220;back in the day&#8221;. Nobody really understood how it worked or how they could sell something that was also &#8220;free&#8221;. But it worked out great for them. InnoDB got bought by Oracle and a lot of people thought &#8220;oh noes MySQL will have no transactional storage, Oracle will kill it.&#8221; Well we see where thats about 180 degrees from what actually happened (R.I.P. Falcon).</p>
<p>So this year, with the oddness of Oracle not being the top sponsor at an event that had driven a lot of the innovation and collaboration in the MySQL world (ironically, choosing instead to spend their time and effort on a conference called &#8220;Collaborate&#8221;), I thought &#8220;wonderful, more politics&#8221;.</p>
<p>But as <a href="http://blog.krow.net/post/4753904254/mysql-state-of-the-ecosystem-2011">Brian Aker says in his &#8220;State of the ecosystem&#8221; post</a>, it was quite the opposite. The absence of the commercial entity responsible for MySQL took a lot of the purely business focused discussion down to almost a whisper, while big ideas and big thinking seemed to be extremely prominent.</p>
<p><a href="http://en.oreilly.com/mysql2011/public/schedule/topic/563">Drizzle</a> had quite a few sessions, including my own about <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17640">what we&#8217;ve done with Drizzle in Ubuntu</a>. This is particularly interesting to me because Drizzle is mostly driven by a community effort, though most of the heavy lifting work up until now has been sponsored by Sun then Rackspace. Its purely an idea of how a MySQL-like database should be written, and while it may be seeing limited production use now, the discussions were on how it can be used, what it does now, not where its going or who is going to pay for its development. Its such a good idea, I&#8217;m pretty convinced users will drive it in much the same way Apache was driven by users wanting to do interesting things with HTTP.</p>
<p>I saw a lot of interesting ideas around replication put forth as well. <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17386">Galera</a>, Tungsten, and <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17747">Xeround</a> all seem to be trying to build on MySQL&#8217;s success with replication and NDB (a.k.a. MySQL Cluster). I really like that there are multiple takes on how to make a multi-master highly available / scalable system work. Getting all the people using and developing these things into one conference center is always pretty interesting to me.</p>
<p>The keynotes were especially interesting, as they were delivered by people who are sitting at the interesection of the old MySQL world, and the new MySQL &#8220;ecosystem&#8221;. I missed Monty Widenius&#8217;s keynote but it strikes me that he is still leading the charge for a simple, scalable, powerful database system, proving that the core of MySQL is mostly unchanged. Martin Mickos delivered a really interesting take on how MySQL was part of the last revolution in computing (LAMP) and how it may very well be a big part of the next revolution (IaaS, aka &#8220;the cloud&#8221;). Brian Aker reinforced that MySQL as a concept, and specifically, Drizzle, are just part of your Infrastructure (the I in IaaS).</p>
<p>Then on Thursday, <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17808">Baron Schwartz blew the whole place up</a>. Go, watch the video if you weren&#8217;t there, or haven&#8217;t seen it. Baron has always been  insightful in his evaluation of the MySQL ecosystem. Maatkit came around when the community needed it, and on joining Percona I think he brought his clear thinking to Petr&#8217;s bold decision making at just the right time to help fuel their rise as one of the most respected consulting firms in the &#8220;WebScale&#8221; world. So when Baron got up and said that the database is still going to scale up, that MySQL isn&#8217;t going to lose to NoSQL or SomeSQL, but rather, that the infrastructure would adapt to the data requirements, it caught my attention, and got me nodding. And when he plainly called Oracle out for not supporting the conference, there was a hush over the croud followed by a big sigh. Its likely that those in attendance were the ones who understand that, and those who weren&#8217;t there were probably the ones who need to hear it. I&#8217;d guess by now they&#8217;ve seen the video or at least heard the call. Either way, thanks Baron for your insight and powerful thoughts.</p>
<p>This was my second MySQL Conference, and I hope it won&#8217;t be my last. The mix of users, developers, and business professionals has always struck me as quite unique, as MySQL sits at the intersection of a number of very powerful avenues. Lets hope that O&#8217;Reilly decides to do it again, *and* lets hope that Oracle gets on board as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2011/04/the-2011-oreilly-open-mysql-drizzle-maria-monty-percona-xtra-galera-xeround-tungsten-cloud-database-conference-and-expo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handlersocket &#8212; NoSQL for MySQL, now on your favorite Linux..</title>
		<link>http://fewbar.com/2011/02/handlersocket-nosql-for-mysql-now-on-your-favorite-linux/</link>
		<comments>http://fewbar.com/2011/02/handlersocket-nosql-for-mysql-now-on-your-favorite-linux/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 07:42:19 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[handlersocket]]></category>
		<category><![CDATA[natty]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=347</guid>
		<description><![CDATA[Handlersocket is what all the cool kids are using these days.. I think. Basically you get a couple of new ports on your mysql server that allow SQL-free reading and writing for doing many thousands of tiny transactions per second without the overhead of parsing SQL. Thanks to my venerable Ubuntu sponsor, Chuck Short, handlersocket [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL">Handlersocket</a> is what all the cool kids are using these days.. I think. Basically you get a couple of new ports on your mysql server that allow SQL-free reading and writing for doing many thousands of tiny transactions per second without the overhead of parsing SQL.</p>
<p>Thanks to my venerable Ubuntu sponsor, Chuck Short, <a href="https://launchpad.net/ubuntu/+source/handlersocket">handlersocket is now available in Ubuntu Natty</a> in the universe repository. apt-get install handlersocket-mysql-5.1 handlersocket-doc, then follow the instructions in /usr/share/doc/handlersocket-doc/docs-en to enable it, and you have yourself a bonified NoSQL solution for your MySQL server. </p>
<p>There are also client libraries for perl (libnet-handlersocket-perl) and C/C++ (libhsclient-dev .. static only as the API is in flux). Other languages are still not packaged, but the protocol is simple, and links to early implementations are listed in the README file, which should be at /usr/share/doc/handlersocket-mysql-5.1/README.</p>
<p>It should be on Debian unstable as well soon&#8230;<br />
<em>Update April 3 2011, Handlersocket is now in Debian Unstable as well</em></p>
<p>Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2011/02/handlersocket-nosql-for-mysql-now-on-your-favorite-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Drizzle7 Beta Released! now with MySQL migration! « LinuxJedis /dev/null</title>
		<link>http://fewbar.com/2010/09/drizzle7-beta-released-now-with-mysql-migration-%c2%ab-linuxjedis-devnull/</link>
		<comments>http://fewbar.com/2010/09/drizzle7-beta-released-now-with-mysql-migration-%c2%ab-linuxjedis-devnull/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 22:39:31 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Drizzle]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=286</guid>
		<description><![CDATA[Drizzle7 Beta Released! now with MySQL migration! « LinuxJedis /dev/null. Drizzle is a project that is near and dear to my heart. To sum it up, Drizzle took all that was really good in MySQL, cut out all that was mediocre, and replaced some of it with really good stuff. The end product is, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxjedi.co.uk/?p=30">Drizzle7 Beta Released! now with MySQL migration! « LinuxJedis /dev/null</a>.</p>
<p><a href="http://www.linuxjedi.co.uk/?p=30"><img src='http://fewbar.com/wp-content/uploads/2010/09/drizzle64.png' alt='' /></a></p>
<p>Drizzle is a project that is near and dear to my heart.</p>
<p>To sum it up, Drizzle took all that was really good in MySQL, cut out all that was mediocre, and replaced some of it with really good stuff. The end product is, I think, something that is leaner, should be more stable, and definitely more flexible.</p>
<p>So go check out the beta! I guess I should use Andrew&#8217;s migration tool and see if I can migrate this blog to drizzle. <img src='http://fewbar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2010/09/drizzle7-beta-released-now-with-mysql-migration-%c2%ab-linuxjedis-devnull/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gearman K.O.&#8217;s mysql to solr replication</title>
		<link>http://fewbar.com/2010/03/gearman-replicate-mysql-to-solr/</link>
		<comments>http://fewbar.com/2010/03/gearman-replicate-mysql-to-solr/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 05:47:36 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[gearman]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=154</guid>
		<description><![CDATA[Ding ding ding.. in this corner, wearing black shorts and a giant schema, we have over 11 million records in MySQL with a complex set of rules governing which must be searchable and which must not be. And in that corner, we have the contender, a kid from the back streets, outweighed and out reached [...]]]></description>
			<content:encoded><![CDATA[<p>Ding ding ding.. in this corner, wearing black shorts and a giant schema, we have over 11 million records in MySQL with a complex set of rules governing which must be searchable and which must not be. And in that corner, we have the contender, a kid from the back streets, outweighed and out reached by all his opponents, but still victorious in the queue shootout, with just open source, and 12 patch releases.. written in C, its <b><a href="http://gearman.org">gearman</a></b>!</p>
<p><a href="http://fewbar.com.s3.amazonaws.com/wp-content/uploads/2010/03/ko-mike-tyson.png"><img src="http://fewbar.com.s3.amazonaws.com/wp-content/uploads/2010/03/ko-mike-tyson.png" alt="" title="ko-mike-tyson" width="500" height="437" class="alignnone size-full wp-image-155" /></a><br />
<span id="more-154"></span></p>
<p>I&#8217;m pretty excited today, as I&#8217;m preparing to go live with the first real, high load application of Gearman that I&#8217;ve written. What is it you say? Well it is a simple trigger based replicator from mysql to <a href="http://lucene.apache.org/solr/">SOLR</a>.</p>
<p>I should say (because I know some of my colleagues read this blog) that I don&#8217;t actually believe in this design. Replication using triggers seems fraught with danger. It totally makes sense if you have a giant application and can&#8217;t track down everywhere that a table is changed. However, if your app is simple and properly abstracted, hopefully you know the 1 or 2 places that write to the table.</p>
<p>I should also say that I really can&#8217;t reveal all of the details. The general idea is pretty simple. Basically we have a trigger that dumps a primary key into gearman via the <a href="https://launchpad.net/gearman-mysql-udf">gearman MySQL UDFs</a>. The idea is just to tell a gearman worker &#8220;look at this record in that table&#8221;.</p>
<p>Once the worker picks it up, it applies some logic to the record.. &#8220;should this be searchable or not&#8221;. If the answer is yes it should be searchable, the worker pushes the record into SOLR. If not, the worker will make sure it is not in solr.</p>
<p>This at least is pretty simple. The end result is a system where we can rebuild the search index in parallel using multiple CPU&#8217;s (thank you to solr/lucene for being able to update indexes concurrently and efficiently btw). This is done by pushing all of the records in the table into the queue at once.</p>
<p>Anyway, gearmand is performing like a champ, libgearman and the gearman pecl module are doing great. I&#8217;m just really happy to see gearman rolled out in production, as I really do think it has that nice mix of simplicity and performance. I love the commandline client which makes it easy to write scripts to inject things into queues, or query workers.  This allows me to access a worker like this:</p>
<p><code>$ gearman -h gearmanbox -f all_workers -s<br />
Known Workers: 11</p>
<p>boxname_RealTimeUpdate_Queue_TriggerWorker_1 jobs=627366,restarts=0,memory_MB=4.27,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13311 jobs=304134,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:58 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13306 jobs=606126,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13314 jobs=576714,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13342 jobs=294846,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13347 jobs=376998,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13359 jobs=470508,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:58 -0700<br />
boxname_RealTimeUpdate_Queue_Subject_13364 jobs=403182,restarts=0,memory_MB=7.03,lastcheckin=Tue, 23 Mar 2010 22:37:58 -0700<br />
boxname_RealTimeUpdate_Property_SolrPublish_ jobs=219630,restarts=0,memory_MB=6.19,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Queue_TriggerWorker_2 jobs=393642,restarts=0,memory_MB=4.27,lastcheckin=Tue, 23 Mar 2010 22:37:59 -0700<br />
boxname_RealTimeUpdate_Property_SolrBatchPub jobs=6,restarts=0,memory_MB=6.23,lastcheckin=Tue, 23 Mar 2010 22:37:28 -0700</code></p>
<p>Brilliant.. no need for html or HTTP.. just a nice simple commandline interface.</p>
<p>I think gearman still has a ways to go. I&#8217;d really like to see some more administration added to it. Deleting empty queues and quickly flushing all queues without restarting gearmand would be nice to haves. We&#8217;ll see what happens going forward, but for not, thanks so much to the gearman team (especially Eric Day who showed me gearman, and Brian Aker for pushing hard to release v0.12).</p>
<p>w00t!</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2010/03/gearman-replicate-mysql-to-solr/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Your code must suck</title>
		<link>http://fewbar.com/2009/07/your-code-must-suck/</link>
		<comments>http://fewbar.com/2009/07/your-code-must-suck/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 21:19:24 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=103</guid>
		<description><![CDATA[While attending OSCON 2009 w/ my faithful sidekick fluffy, we constantly kept finding instances of a common theme. The leading companies and projects seem to share one attribute that might shock you. They all have at least *some* crappy code. At some point, all of them have set aside their principles and thrown in a [...]]]></description>
			<content:encoded><![CDATA[<p>While attending <a href="http://en.oreilly.com/oscon2009">OSCON 2009</a> w/ my faithful sidekick <a href="http://poorlycoded.com/">fluffy</a>, we constantly kept finding instances of a common theme. The leading companies and projects seem to share one attribute that might shock you.</p>
<p>They all have at least *some* crappy code. At some point, all of them<span id="more-103"></span> have set aside their principles and thrown in a hack to get things working. This is reinforced by those projects that have their dignity, but no market share. FreeBSD users are famous for saying that Linux is coded by 10,000 monkeys. FreeBSD is an awesome project, that has powered some <a href="http://yahoo.com">huge websites</a>. However, the primary Free OS is Linux. Even further along that line is Windows, which is pretty much a hack on a hack on a hack, but somehow, everybody ends up running it.</p>
<p>This isn&#8217;t to say that all of the code in popular projects sucks. Just that some of it does. I&#8217;m still waiting for the example of an organization that has produced pure, beautiful code with no compromises, and then gone on to garner a large market share and/or massive profits.</p>
<p>The site <a href="http://www.thedailywtf.com/">TheDailyWTF</a> exists primarily because of this fact. I hit that site at least twice a week to have a good laugh. Many times it causes me to reminisce about some of the things I saw early in my career. Just as often, I&#8217;m reminded of something more recent. The trend doesn&#8217;t seem to stop, despite advances in computing and human understanding, it goes back decades. I imagine Ogg, the first guy who designed a wheel, snarked about how Thag&#8217;s wheels weren&#8217;t perfectly round. But ultimately, Thag was able to produce wheels that weren&#8217;t perfectly round, but rolled pretty well. He probably got them out in half the time, and ended up trading more wheels for Mammoth pelts than Ogg by a factor of five. No doubt Thag was able to attract more mates with his Mammoth Pelt fortune, so maybe its just in our nature. </p>
<p>Really though, this flies in the face of code purity, which we all want. Code sucking == profit? Hacks == market share? This doesn&#8217;t sit well with those of us who pride ourselves on brace placement discipline, and knowing at least 5 design patterns without looking them up in a book. But there it is, that pile of dung you knocked out at 3am the day before release to QA&#8230; 3 years ago. Still powering the site despite being closer to Alpaca bile than beautiful code.</p>
<p>This doesn&#8217;t mean projects fail without hacks. What it means though, is that projects that obsess over doing things &#8220;the right way&#8221; tend to languish, and rarely achieve success on a massive scale. For some that is ok, they&#8217;re happy to have produced something great that a few people like and that works right for them. In fact, this is largely the  (healthy) attitude I see from the PostgreSQL project. </p>
<p>The PostgreSQL developers and users tend to feel strongly that their database is far superior to the likes of say, MySQL. They&#8217;ll tell you that they have always had full ACID compliance, that their bug counts are low, and performance continues to rise with every release.</p>
<p>I know a lot of people are successfully running PostgreSQL, but really, by contrast, seems like everybody&#8217;s running MySQL. MySQL is not bad code either. It just has hacks. Ok, having dug into it a bit now, it has <strong>a lot</strong> of hacks. But, why is MySQL the leader, and PostgreSQL the follower.</p>
<p>I think the answer is right there in that last sentence. As Cesar Milan will tell you, &#8220;choo gotta be da pack leader&#8221;. PostgreSQL probably would have continued on as a fine, but obscure, database engine had MySQL not revolutionized data storage in the same way Apache revolutionized web serving. MySQL has managed to carve out a huge market with Free software, while PostgreSQL&#8217;s market is only now beginning to grow. Really PostgreSQL has refused to follow in MySQL&#8217;s footsteps for a long time, and because of that, they&#8217;ve avoided many of the pitfalls MySQL has fallen in to as their scope creeps larger and larger like an amoeba slowly devouring the edges of the enterprise market that used to seem so far from its original targets.</p>
<p>However, even the Postgres guys know that hacks may be necessary. <a href="http://archives.postgresql.org/pgsql-hackers/2008-05/msg00913.php">As of May, 2008 they have given in</a> and will produce a general purpose master/slave replication system. The message to the &#8220;pgsql-hackers&#8221; list has an air of reluctance to it..</p>
<blockquote><p>Users who might consider<br />
PostgreSQL are choosing other database systems because our existing<br />
replication options are too complex to install and use for simple cases.<br />
In practice, simple asynchronous single-master-multiple-slave<br />
replication covers a respectable fraction of use cases, so we have<br />
concluded that we should allow such a feature to be included in the core<br />
project.</p></blockquote>
<p>Its like they&#8217;re finally saying &#8220;ok we want more users, so we&#8217;ll include this thing that goes against our principles.&#8221; Personally I think this is great, as PostgreSQL <strong>is</strong> a nice RDBMS, and to be able to use it for small-medium scaleout just like MySQL is really quite exciting.</p>
<p>So, the moral of the story is, if you want your project to be successful, throw in some crap code. Otherwise your developers will be up on their high horses too long, and not down in the trenches getting things done.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/07/your-code-must-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TokyoTyrant &#8211; MemcacheDB, but without the BDB?</title>
		<link>http://fewbar.com/2009/06/tokyotyrant-memcachedb-but-without-the-bdb/</link>
		<comments>http://fewbar.com/2009/06/tokyotyrant-memcachedb-but-without-the-bdb/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 06:40:26 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Memcache]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[memcachedb]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[tokyocabinet]]></category>
		<category><![CDATA[tokyotyrant]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=85</guid>
		<description><![CDATA[Anyway, the next thing I mentioned was that we had also tried MemcacheDB with some success. Brian wasn't exactly impressed with MemcacheDB, and immediately suggested that we should be using <a href="http://tokyocabinet.sourceforge.net/tyrantdoc/">Tokyo Tyrant</a> instead. I had heard of Tokyo Cabinet, the new hotness in local key/value storage and retrieval, but what is this Tyrant you speak of?]]></description>
			<content:encoded><![CDATA[<p>This past April I was riding in a late model, 2 door rental car with an interesting trio for sure. On my right sat <a href="http://capttofu.livejournal.com/">Patrick Galbraith</a>, maintainer of DBD::mysql and author of the Federated storage engine. Directly in front of me manning the steering wheel (for those of you keen on spatial description, you may have noted at this point that its most likely I was seated in the back, left seat of a car which is designed to be driven on the right side of the road. EOUF [end of useless fact]), David Axmark, co-founder of MySQL. Immediately to his right sat <a href="http://krow.net/">Brian Aker</a>, of (most recently) Drizzle fame.<br />
<span id="more-85"></span><br />
This was one of those conversations that I felt grossly unprepared for. It was the 2009 MySQL User&#8217;s conference, and  Patrick and I had been hacking on <a href="https://launchpad.net/dbd-drizzle">DBD::drizzle</a> for most of the day. We had it 98% of the way there and were in need of food, so we were joining the Drizzle dev team for gourmet pizza.</p>
<p>As we navigated from the Santa Clara conference center to Mountain View&#8217;s quaint downtown, Brian, Patrick, and I were discussing memcached stuff. I mentioned <a href="http://fewbar.com/2008/12/memcached-and-mogile-form-memcachemegazord/">my idea, and subsequent implementation of the Mogile+Memcached method for storing data more reliably</a> in memcached. I knew in my head why we had chosen to read from all of the replica servers, not just the first one that worked, but I forgot (The reason, btw, is that if one of the servers had missed a write for some reason, you might get out-of-date data). I guess I was a little overwhelmed by Brian&#8217;s mountain of experience w/ memcached.</p>
<p>Anyway, the next thing I mentioned was that we had also tried MemcacheDB with some success. Brian wasn&#8217;t exactly impressed with MemcacheDB, and immediately suggested that we should be using <a href="http://tokyocabinet.sourceforge.net/tyrantdoc/">Tokyo Tyrant</a> instead. I had heard of Tokyo Cabinet, the new hotness in local key/value storage and retrieval, but what is this Tyrant you speak of?</p>
<p>I&#8217;ve been playing with Tokyo Tyrant ever since, and advocating for its usage at Adicio. Its pretty impressive. In addition to speaking memcached protocol, it apparently speaks HTTP/WEBDAV  too. The ability to select hash, btree, and a host of other options is nice, though I&#8217;m sure some of these are available as obscure options to berkeleydb as well.</p>
<p>Anyway, I was curious what performance was like, so I did some tests on my little Xen instance, and came up with pretty graphs.</p>
<p><a href="http://fewbar.com/wp-content/uploads/2009/06/tokyotyrantvsmemcachedb1.gif"><img src="http://fewbar.com/wp-content/uploads/2009/06/tokyotyrantvsmemcachedb1.gif" alt="tokyotyrantvsmemcachedb1" title="tokyotyrantvsmemcachedb1" width="465" height="472" class="alignnone size-full wp-image-92" /></a></p>
<p>I used the excellent <a href="http://code.google.com/p/brutis/">Brutis</a> tool to run these benchmarks using the most interesting platform for me at the moment.. which would be, php with the pecl Memcache  module.</p>
<p>These numbers were specifically focused on usage that is typical to MemcacheDB. A wide range of keys (in this case, 10000 is &#8220;wide&#8221; since the testing system is very small), not-small items (2k or so), and lower write:read ratio (1:50). I had the tests restart each daemon after each run, and these numbers are the results of the average of 3 runs each test.</p>
<p>I also tried these from another xen instance on the same LAN, and things got a lot slower. Not really sure why as latency is in the sub-millisecond range.. but maybe Xen&#8217;s networking just isn&#8217;t very fast. Either way, the numbers for each combination didn&#8217;t change much.</p>
<p>What I find interesting is that memachedb in no-sync mode actually went faster than memached. Of course, in nosync mode, memcachedb is just throwing data at the disk. It doesn&#8217;t have to maintain LRU or slabs or anything.</p>
<p>Tokyo Tyrant was very consistent, and used *very* little RAM in all instances. I do recall reading that it compresses data. Maybe thats a default? Anyway, tokyo tyrant also was the most CPU hungry of the bunch, so I have to assume having more cores might have resulted in much better results.</p>
<p>I&#8217;d like to get together a set of 3 or 4 machines to test multiple client threads, and replication as well. Will post that as part 2 when I pull it together. For now, it looks like.</p>
<p>In case anybody wants to repeat these tests, I&#8217;ve included <a href="http://spamaps.org/files/tt-mdb-memcache-tests.tgz">the results, and the scripts used to generate them in this tarball</a>.</p>
<p>&#8211; Additional info, 6/4/2009<br />
Another graph that some might find interesting, is this one detailing CPU usage. During all the tests, brutis used about 60% of the CPU available on the machine, so 40% is really 100%:</p>
<p><a href="http://fewbar.com/wp-content/uploads/2009/06/tokyotyranttests_cpu.gif"><img src="http://fewbar.com/wp-content/uploads/2009/06/tokyotyranttests_cpu.gif" alt="tokyotyranttests_cpu" title="tokyotyranttests_cpu" width="428" height="385" class="alignnone size-full wp-image-98" /></a></p>
<p>This tells me that the CPU was the limiting factor for Tokyo Tyrant, and with a multi-core machine, we should see huge speed improvements. Stay tuned for those tests!</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/06/tokyotyrant-memcachedb-but-without-the-bdb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parallel mysql replication?</title>
		<link>http://fewbar.com/2009/06/parallel-mysql-replication/</link>
		<comments>http://fewbar.com/2009/06/parallel-mysql-replication/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:08:48 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[parallelism]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=80</guid>
		<description><![CDATA[Its always been a dream of mine. I&#8217;ve posted about parallel replication on Drizzle&#8217;s mailing list before. I think when faced with the problem of a big, highly concurrent master, and scaling out reads simply with lower cost slaves, this is going to be the only way to go. So today I was really glad [...]]]></description>
			<content:encoded><![CDATA[<p>Its always been a dream of mine. I&#8217;ve <a href="https://lists.launchpad.net/drizzle-discuss/msg03988.html">posted about parallel replication</a> on Drizzle&#8217;s mailing list before. I think when faced with the problem of a big, highly concurrent master, and scaling out reads simply with lower cost slaves, this is going to be the only way to go.</p>
<p>So today I was really glad to see that somebody is trying out the idea. Seppo Jaakola from <a href="http://www.codership.com/">&#8220;Codership&#8221;</a>, who I&#8217;ve never heard of before today, <a href="https://lists.launchpad.net/drizzle-discuss/msg04214.html">posted a link</a> to an article on his blog about his <a href="http://www.codership.com/content/parallel-applying">experimentation with parallel replication slaves</a>. The findings are pretty interesting.<br />
<span id="more-80"></span><br />
I hope that he&#8217;ll be able to repeat his tests with a real world setup. The software they&#8217;ve written seems to have the right idea. The biggest issue I have with the tests is that  the tests were run on tiny hardware. Hyperthreading? Single disks? Thats not really the point of having parallel replication slaves.</p>
<p>The idea is that you have maybe a gigantic real time write server for OLTP. This beast may have lots of medium-power CPU cores, and an obscene amount of RAM, and a lot of battery backed write cache for writes.</p>
<p>Now you know that there are tons of reads that shouldn&#8217;t ever be done against this server. You drop a few replication slaves in, and you realize that you need a box with as much disk storage as your central server, and probably just as much write cache. Pretty soon scaling out those reads is just not very cost effective.</p>
<p>However, if you could have lots of CPU cores, and lots of cheap disks, you could dispatch these writes to be done in parallel, and you wouldn&#8217;t need expensive disk systems or lots of RAM for each slave.</p>
<p>So, the idea is not to make slaves faster in a 1:1 size comparison. Its to make it easier for a cheap slave to keep up with a very busy, very expensive master.</p>
<p>I do see where another huge limiting factor is making sure things synchronize in commit order. I think thats an area where a lot of time needs to be spent on optimization. The order should already be known so that the commiter thread is just waiting for the next one in line, and if the next 100 are already done it can just rip through them quickly, not signal them that they can go. Something like this seems right:</p>
<p><code><br />
id=first_commit_id();<br />
while(wait_for_commit(id)) {<br />
  commit(id);<br />
  id++;<br />
}<br />
</code></p>
<p>I applaud the efforts of Codeship, and I hope they&#8217;ll continue the project and maybe ship something that will rock all our worlds.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/06/parallel-mysql-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>At the MySQL/Percona 2009 Conference</title>
		<link>http://fewbar.com/2009/04/at-the-mysqlpercona-2009-conference/</link>
		<comments>http://fewbar.com/2009/04/at-the-mysqlpercona-2009-conference/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 17:12:12 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[percona]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=64</guid>
		<description><![CDATA[I&#8217;m seated in rooms 203/204 of the Santa Clara convention center, listening to Eric Day&#8217;s talk on Gearman, a very cool technology for asynchronous distributed job queueing. Anyway, the point is, I&#8217;m here at the conference, wandering around. If you see me, come by and say hi. Here&#8217;s what I look like today&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m seated in rooms 203/204 of the Santa Clara convention center, listening to Eric Day&#8217;s talk on <a href="http://gearman.org">Gearman</a>, a very cool technology for asynchronous distributed job queueing. Anyway, the point is, I&#8217;m here at the conference, wandering around. If you see me, come by and say hi. Here&#8217;s what I look like today&#8230;</p>
<p><img src="http://fewbar.com/wp-content/uploads/2009/04/photo-5.jpg" alt="Me at the MySQL/Percona conference" title="Me at the MySQL/Percona conference" width="300" height="225" class="alignnone size-medium wp-image-65" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/04/at-the-mysqlpercona-2009-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I should write an innodb backup tool</title>
		<link>http://fewbar.com/2008/11/i-should-write-an-innodb-backup-tool/</link>
		<comments>http://fewbar.com/2008/11/i-should-write-an-innodb-backup-tool/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 18:04:15 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[reliability]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=23</guid>
		<description><![CDATA[One of my favorite bloggers, Peter over at Percona/MySQL Performance Blog, has thrown down the gauntlet. Basically saying that it would be fairly trivial to write an incremental InnoDB backup tool. If you see me, and I haven&#8217;t run up to you and told you that I am writing/have written an amazing InnoDB incremental backup [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite bloggers, Peter over at Percona/MySQL Performance Blog, <a href="http://www.mysqlperformanceblog.com/2008/11/10/thoughs-on-innodb-incremental-backups/">has thrown down the gauntlet</a>. Basically saying that it would be fairly trivial to write an incremental InnoDB backup tool.</p>
<p>If you see me, and I haven&#8217;t run up to you and told you that I am writing/have written an amazing InnoDB incremental backup tool, I give you permission to make fun of me. This sounds like a fun, interesting project that will challenge me and sort of scratches an itch I have, which is, faster MySQL backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2008/11/i-should-write-an-innodb-backup-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deciding whether to send reads to slave or master</title>
		<link>http://fewbar.com/2008/10/maximizing-usage-of-mysql-replication-slaves/</link>
		<comments>http://fewbar.com/2008/10/maximizing-usage-of-mysql-replication-slaves/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 17:43:42 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=18</guid>
		<description><![CDATA[There are quite a few articles out there that talk about how to give your application some context and send reads to one server, and writes to another. There are even some mentions of marking your connection &#8220;dirty&#8221; and then sending all reads to the write server. As a first try at scaling things, I [...]]]></description>
			<content:encoded><![CDATA[<p>There are quite a few articles out there that talk about how to give your application some context and send reads to one server, and writes to another. There are even some mentions of marking your connection &#8220;dirty&#8221; and then sending all reads to the write server.</p>
<p>As a first try at scaling things, I recently made a change to our web application&#8217;s data access layer where reads went to a group of readonly slaves. However, if a write was made to a database, a value was put into the user&#8217;s session, saying that the database was dirty, and causing all subsequent reads to go to the master server.<br />
<span id="more-18"></span><br />
This was good as users would use the readonly slaves as long as they hadn&#8217;t changed anything in the database. The real problem though, was that as soon as the user logged in, their account was updated to say that they had logged in, marking that database dirty.</p>
<p>Rather than try to cleverly change this one problem, we changed the &#8220;dirty&#8221; value from a boolean to a timestamp. Whenever the user writes to the database, it records the current time in their session. Then a global timeout is applied to that. This gives the replication slaves time to catch up and get the record that was just changed, then the user will have a consistent view fo their data.</p>
<p>This is great, but I think a further step is to have something publish the actual maximum lag of the slaves into a memcache key, and simply double that value as the timeout. This would allow maximum usage of the readonly slaves and keep the master server busy doing mostly writes.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2008/10/maximizing-usage-of-mysql-replication-slaves/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.205 seconds -->

