{"id":484,"date":"2008-08-14T12:27:06","date_gmt":"2008-08-14T18:27:06","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/archives\/000484"},"modified":"2008-08-14T12:38:32","modified_gmt":"2008-08-14T18:38:32","slug":"mysql-and-memcached-notes-from-a-webinar","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/484","title":{"rendered":"MySQL and memcached: notes from a webinar"},"content":{"rendered":"<p>Just listened to another mysql webinar.  This time it was about mysql and memcached.  I got in a little late, but here are my notes.<\/p>\n<p><a href=\"http:\/\/www.danga.com\/memcached\/\">Memcached<\/a> is a distributed caching mechanism.  Not as robust as <a href=\"http:\/\/www.oracle.com\/technology\/products\/coherence\/index.html\">Coherence<\/a>, for example, but free, open source, and widely used and supported.<\/p>\n<p>There is a project that hooks <a href=\"http:\/\/tangent.org\/586\/Memcached_Functions_for_MySQL.html\">mysql UDFs to memecached<\/a>.<\/p>\n<p>The main speaker worked at <a href=\"http:\/\/www.grazr.com\/\">Grazr<\/a>, a feed manipulation company.  He presented some lessons and stated that some seemed obvious, but we all know how it is, you learn mistakes the hard way.<\/p>\n<ol>\n<li>Beware architecture momentum&#8211;early decisions influence later ones.<\/li>\n<li>Your scaling plan is wrong in some way!&#8211;grazr overbuilt.<\/li>\n<li>Testing is limited: they had issues with replication speed. Users are better at testing site than any perl script.<\/li>\n<li>Replication is fast, until it isn&#8217;t.  It&#8217;s asynchronous nature can make it hard to program to.<\/li>\n<li>Memcached is your friend<\/li>\n<li><a href=\"http:\/\/www.sphinxsearch.com\/\">Sphinx<\/a>, an open source SQL full text search engine (like <a href=\"http:\/\/lucene.apache.org\/java\/docs\/\">Lucene<\/a>), is your friend.  It also has a mysql storage engine&#8211;virtual table that you can join with other data sources.  This sounds cool.<\/li>\n<li>Do bulk insert and lazy writes&#8211;if you don&#8217;t need to immediately read it, do the write later.<\/li>\n<li>Emphasis on scaling hurt user experience.  Fast, data correct transaction are available with two options: one server, or a sync buffer like memcached.<\/li>\n<li>Use instrumentation&#8211;he mentioned tools like <a href=\"http:\/\/www.nagios.org\/\">nagios<\/a> and <a href=\"http:\/\/www.cacti.net\/\">cacti<\/a> (cacti has mysql plugin [which I couldn&#8217;t find]) to help scaling&#8211;close the loop: when you make a change, find out what that change did.<\/li>\n<li>Try new things&#8211;for example, the <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/blackhole-storage-engine.html\">MySQL blackhole storage engine<\/a> for data that is only read on slaves, not on the master.<\/li>\n<li>Everyone has same problems&#8211;avoid Not Invented Here syndrome.  Not just the obvious stuff (who writes a web server these days&#8211;<a href=\"http:\/\/www.lighttpd.net\/story\">oh wait<\/a>), for example, there&#8217;s a batch job processor like gearman.  Note that he also said they had to Invent a few things before they learned this lesson.<\/li>\n<li>Accept change&#8211;design for now+1, not now+100<\/li>\n<li>Listen&#8211;even folks not intimately familiar with your technology may have good ideas, and more brains are better.<\/li>\n<\/ol>\n<p>End notes<\/p>\n<p>Looks like a couple of interesting whitepapers are available (you&#8217;ll have to register and get pinged via email a few times by sales folks): <a href=\"http:\/\/www.mysql.com\/why-mysql\/white-papers\/mysql_wp_memcached.php\">&#8220;Designing and Implementing Scalable Applications with Memcached and MySQL&#8221;<\/a>.  And there are <a href=\"http:\/\/www.mysql.com\/news-and-events\/web-seminars\/index.html\">future webinars<\/a> on the MySQL\/memcached topic, one on SAAS applications and one on Scalable web architecture.<\/p>\n<p>In a meta note, I enjoy the webinars because:<\/p>\n<ol>\n<li>Easy to get to<\/li>\n<li>Free<\/li>\n<li>High quality<\/li>\n<li>One can bail if you want (which I did a few weeks ago when MySQL proxy http:\/\/forge.mysql.com\/wiki\/MySQL_Proxy didn&#8217;t turn out to be all that interesting to me).<\/li>\n<li>The give me something to blog about \ud83d\ude42<\/li>\n<\/ol>\n<p>[tags]webinar, memcached, users are the best testers[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just listened to another mysql webinar. This time it was about mysql and memcached. I got in a little late, but here are my notes. Memcached is a distributed caching [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}