<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
  <channel>
      <title>In Valid Logic</title>
    <link>http://invalidlogic.com</link>
    <language>en</language>
    <webMaster>ken@invalidlogic.com (Ken Robertson)</webMaster>
    <pubDate>2012-01-22T11:25:37-08:00</pubDate>
    <copyright>Copyright 2009</copyright>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    <ttl>60</ttl>
    <description>Endlessly expanding technology</description>
    
    <item>
      <title>Jekyll on PaaS.io with Cloud Foundry</title>
      <link>http://invalidlogic.com/2012/01/06/jekyll-on-paasio-with-cloud-foundry/</link>
      <pubDate>Fri Jan 06 00:00:00 -0800 2012</pubDate>
      <guid>http://invalidlogic.com/archives/2012/01/06/jekyll-on-paasio-with-cloud-foundry/</guid>
      <description>&lt;p&gt;Recently I moved my blog over to the service I am currently working on building, &lt;a href=&quot;http://paas.io&quot;&gt;PaaS.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Running Jekyll on PaaS.io isn't all that different from running it on other services, though I had a few other goals in mind.  The way I wanted it set up was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stop using &lt;code&gt;rack-jekyll&lt;/code&gt;.  Its a nice gem, however it is locked to an older version of Jekyll.  And the current gem is on an even more outdated one.  Currently, Cloud Foundry doesn't support pulling bundler sources from git too.&lt;/li&gt;
&lt;li&gt;Have a &lt;code&gt;public&lt;/code&gt; folder for static content like CSS and images.&lt;/li&gt;
&lt;li&gt;Have the &lt;code&gt;_site&lt;/code&gt; folder for generated content&lt;/li&gt;
&lt;li&gt;Don't have it copy the &lt;code&gt;Gemfile&lt;/code&gt; and the &lt;code&gt;config.ru&lt;/code&gt; into the &lt;code&gt;_site&lt;/code&gt; folder (annoys me)&lt;/li&gt;
&lt;li&gt;Redirect &lt;code&gt;www.invalidlogic.com&lt;/code&gt; to &lt;code&gt;invalidlogic.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Low foot print&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;First, the &lt;code&gt;Gemfile&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:rubygems&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack-contrib&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack/contrib/try_static&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack-redirect&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;thin&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:development&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;jekyll&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;RedCloth&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rdiscount&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;The main gems being used are &lt;code&gt;thin&lt;/code&gt;, &lt;code&gt;rack-contrib&lt;/code&gt; (for TryStatic, note on that later), and &lt;code&gt;rack-redirect&lt;/code&gt; (for www redirection).  I also include some of the gems I use for Jekyll in the development group.  That way they are available locally but not loaded when I deploy (lower footprint... and yes, it is minor).&lt;/p&gt;

&lt;p&gt;Now, the &lt;code&gt;config.ru&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;bundler&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Bundler&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Solo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;DomainRedirect&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TryStatic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:root&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;_site&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:urls&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w[/]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.html&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;index.html&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/index.html&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Static&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:root&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;public&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:urls&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w[/]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;404&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;text/html&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Not Found&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;There are 4 rack components here.  First, &lt;code&gt;Rack::EY::Solo::DomainRedirect&lt;/code&gt; is the &lt;code&gt;rack-redirect&lt;/code&gt; gem and handles the www redirection.  Next, is &lt;code&gt;Rack::TryStatic&lt;/code&gt;.  It is used to access files from the &lt;code&gt;_site&lt;/code&gt; generated content directory.  It gives a couple different &lt;code&gt;:try&lt;/code&gt; values for different ways to find the intended file.  Then is the &lt;code&gt;Rack::Static&lt;/code&gt; which gets static content from the &lt;code&gt;public&lt;/code&gt; directory.  No need to try different combinations.  And last is a generic lambda that will return 404.&lt;/p&gt;

&lt;p&gt;Next, want to avoid duplication.  With things as they are, when I run &lt;code&gt;jekyll&lt;/code&gt; it will copy the &lt;code&gt;public&lt;/code&gt; and other items into the &lt;code&gt;_site&lt;/code&gt; folder duplicating it.  To resolve that, in our &lt;code&gt;_config.yml&lt;/code&gt;, can add an exclude line:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;yaml&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;exclude&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p-Indicator&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;public&amp;#39;&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Gemfile&amp;#39;&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;Gemfile.lock&amp;#39;&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;config.ru&amp;#39;&lt;/span&gt; &lt;span class=&quot;p-Indicator&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;And with that, we are set!  All of our goals are met.  Commit and push to deploy!  Currently I have &lt;a href=&quot;http://cloudfoundry.org&quot;&gt;Cloud Foundry&lt;/a&gt; set up with a Rack framework defined (will be sending a pull request with it soon) and also have my blog set to use Ruby 1.9.3 as well.&lt;/p&gt;

&lt;p&gt;Soon I'll be providing some more details on &lt;a href=&quot;http://paas.io&quot;&gt;PaaS.io&lt;/a&gt;, so stay tuned and click over to it and sign up to get access to the beta.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>iPhone vs Android is the new Mac vs PC</title>
      <link>http://invalidlogic.com/2011/10/18/iphone-vs-android-is-the-new-mac-vs-pc/</link>
      <pubDate>Tue Oct 18 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/10/18/iphone-vs-android-is-the-new-mac-vs-pc/</guid>
      <description>&lt;p&gt;After spending &lt;a href=&quot;/2010/04/06/one-week-with-a-droid-and-a-few-hours-with-an-ipad/&quot;&gt;18 months with Android&lt;/a&gt;, I am now back to an iPhone and
likely here to stay.  While Android isn't necessarily bad, it more boils
down to iPhone simply being better.  After a while, I started looking at
iPhone vs Android as largely a repeat of the Mac vs PC comparisons.&lt;/p&gt;

&lt;h3&gt;Mac vs PC&lt;/h3&gt;

&lt;p&gt;Just look at it.  Apple is doing what they've always done.  They control
the hardware and the software.  They have a solid, unified experience.
You can pick up any iPhone, old or new, and still be at home.&lt;/p&gt;

&lt;p&gt;Android is repeating the history of PCs.  Google makes the OS, as
Microsoft did with Windows.  Then OEMs offer a wide variety of different
hardware, with their own shitty customizations layered on top of the OS.
Even worse, you have the carriers layering on their customizations and
restrictions.&lt;/p&gt;

&lt;p&gt;You can go from one Android phone to another and have it
be completely foreign.  Even baseline apps can have different names and
a completely different look and feel, such between the &quot;Email&quot; vs &quot;Mail&quot; of vanilla
Android and HTC Android.&lt;/p&gt;

&lt;h3&gt;Shelf Life&lt;/h3&gt;

&lt;p&gt;With Android, the phones have a very short shelf life.  I bought a
Thunderbolt from Verizon back in April, just 6 months ago.  About a
month after I bought it, it was no longer the hot model they were
pimping.  In fact, there have been 2-3 phones to come out since then
that became &quot;king of the mountain.&quot;&lt;/p&gt;

&lt;p&gt;With iPhone, they release a new phone about once a year, and that one
stays the current phone.  Older phones are still pretty well supported.
The iPhone 3GS is over 2 years old, still got updated to iOS 5, and
likely will until iOS 6.  My original Motorola Droid that is
nearing 2 years old is pretty much forgotten already.&lt;/p&gt;

&lt;p&gt;Updates with iPhone?  Available right away to everyone.  AT&amp;amp;T or
Verizon, you get the update when Apple makes it generally available.&lt;/p&gt;

&lt;p&gt;Updates with Android?  Have fun.  Google has to release it, your OEM has
to customize it, then the carrier gets to tweak it, and decide when to
finally roll it out.  Google released Gingerbread back in December 2010,
nearly 10 months ago.  Verizon just started rolling out the update last
month, &lt;a href=&quot;http://www.gottabemobile.com/2011/10/17/htc-thunderbolt-gingerbread-update-said-to-be-returning-soon/&quot;&gt;then pulled it&lt;/a&gt;.  Even then, they decide when you can upgrade with a phased roll out.  And since it was pulled, looks like they seem to skip over adequate testing.&lt;/p&gt;

&lt;p&gt;Most Android users who want recent releases end up rooting their phones
and use unofficial ROMs put together by an informal group of people.
Have an issue with your phone?  Limited options.&lt;/p&gt;

&lt;h3&gt;Marketing&lt;/h3&gt;

&lt;p&gt;I definitely agreed with &lt;a href=&quot;http://www.slowcookedbacon.com/&quot;&gt;my friend Joe&lt;/a&gt; in his &lt;a href=&quot;http://www.slowcookedbacon.com/the-droid-bionic-shows-why-android-isnt-domin&quot;&gt;post about the Droid Bionic&lt;/a&gt;.  Android phones are being pitched like PCs.  They give a bunch of technical specs that are meaningless to consumers.  It echos the &lt;a href=&quot;http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html&quot;&gt;&quot;Golden Circle&quot;&lt;/a&gt; idea by Simon Sinek.  Apple is still doing what they do best.  Verizon sells like PC manufacturers.  Lacking inspiration.&lt;/p&gt;

&lt;h3&gt;False Sense of Market Share&lt;/h3&gt;

&lt;p&gt;You've probably seen the headlines of &lt;a href=&quot;http://www.dailytech.com/Android+Outsells+iPhone+5to2+Has+Nearly+50+Percent+of+the+Market/article22326.htm&quot;&gt;&quot;Android sales outpacing
iPhone&quot;&lt;/a&gt;
or &lt;a href=&quot;http://www.dailytech.com/Android+Market+Share+Reaches+56+Percent+RIMs+Microsofts+Cut+in+Half/article22852.htm&quot;&gt;&quot;Android market share to surpass iPhone&quot;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Overall the numbers are comparing apples to oranges.  They are comparing
the sales figure of a &lt;em&gt;single phone&lt;/em&gt; to a whole &lt;em&gt;group of phones&lt;/em&gt;.
There are many different Android phones, and individually, iPhone is
spanking them in sales figures.  No single Android phone has a chance of
elipsing the iPhone or gaining any meaningful market share, especially
with their overall short shelf life.  I'd be very interested to see
sales figured of individual phones and see how long they really last.
All the manufacturers are still struggling to get a sliver of what the iPhone is capable of.&lt;/p&gt;

&lt;p&gt;The numbers may hold some weight for developers because it represents
the size of your audience.  But at the same time, Android is many phones
vs iPhones entire existence is now just 5 phones.  Less &quot;your app
doesn't work on my Verizon Droid Mumbojumbo&quot; and you don't have a Droid
Mumbojumbo to test on.&lt;/p&gt;

&lt;h3&gt;Falseness of Open&lt;/h3&gt;

&lt;p&gt;Many people tout Android as being open, however the actions of Google
with &lt;a href=&quot;http://www.businessweek.com/technology/content/mar2011/tc20110324_269784_page_2.htm&quot;&gt;Honeycomb's source code&lt;/a&gt; seem to be heading in the direction of more closed.&lt;/p&gt;

&lt;p&gt;While Google said part of their goal was to try and unify the platform
more, as Honeycomb was intended for tablets and not handsets, the
ability to control a platform is difficult while also keeping it &quot;open.&quot;
I think Google is right in closing it, since in order to further the
platform, they will need to have some control in order to maintain a
consistent direction.&lt;/p&gt;

&lt;p&gt;However, the &quot;openness&quot; usually just comes from developers.  What do most of then
define the &quot;openness&quot; as?  Being able to write apps and put them on
their phone without paying $99.  They tout the source being open, but
the truth is that isn't what they really care about.  Very few Android
developers likely dive into the OS code, they just want to install their
own apps for free.&lt;/p&gt;

&lt;p&gt;Personally, if I prefer one platform over the other, a $99 fee to build
apps isn't going to a stopper for me.  But I also
don't mind paying for the tools I use in my craft if they are worth it.&lt;/p&gt;

&lt;h3&gt;Working&lt;/h3&gt;

&lt;p&gt;Most average people care more about how well the phone works.  iPhone
simply works better.  Since software and hardware are more married, the
experience is more consistent.  In my own experience, apps crash less on
iPhone.  The phone lags less.  Scrolling and browsing is more graceful.
My wife is still on her original Droid for another month, and every day
I see her struggle with the phone.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.changewaveresearch.com/articles/2011/smart_phones_20110718.html&quot;&gt;iPhone has better customer satisfaction ratings than Android.&lt;/a&gt;  While the reasons aren't mentioned, I wouldn't be surprised that part of it stems from &quot;it just works&quot;.&lt;/p&gt;

&lt;p&gt;Apple has a strong emphasis on usability.  Google and the OEMs aren't as
much so.  This particularly stuck me with a &lt;a href=&quot;http://dinnerwithandroid.tumblr.com/post/8838035574/dual-wielding&quot;&gt;post I read&lt;/a&gt; about a guy talking to a girl who had an Android phone and an iPod Touch.  In particuar, &quot;nothing happened when I plugged it into my computer.&quot;  To the average user, the simple integration is important.  They don't know why the phone shows up as a &quot;Mass Storage Device&quot; when they plug it in.&lt;/p&gt;

&lt;h3&gt;Future&lt;/h3&gt;

&lt;p&gt;The future for Android will probable improve.  The OS is maturing and
hardware getting better, however the ecosystem of manufacturers and
carriers will likely stay the same.  The reality is that Apple is doing
what Apple has always done and they've gotten really good at it.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Cooking with Chef slides</title>
      <link>http://invalidlogic.com/2011/07/25/cooking-with-chef-slides/</link>
      <pubDate>Mon Jul 25 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/07/25/cooking-with-chef-slides/</guid>
      <description>&lt;p&gt;A little late, but I have posted my slides from my talk at the &lt;a href=&quot;http://www.meetup.com/EBRuby/&quot;&gt;East Bay
Ruby Meetup&lt;/a&gt; in &lt;a href=&quot;http://www.meetup.com/EBRuby/events/16505489/&quot;&gt;June&lt;/a&gt;.&lt;/p&gt;

&lt;center&gt;&lt;div style=&quot;width:425px;margin: 10px&quot; id=&quot;__ss_8668127&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/krobertson2/cooking-with-chef-8668127&quot; title=&quot;Cooking with Chef&quot;&gt;Cooking with Chef&lt;/a&gt;&lt;/strong&gt;&lt;object id=&quot;__sse8668127&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cheftalk-110722221912-phpapp02&amp;stripped_title=cooking-with-chef-8668127&amp;userName=krobertson2&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed name=&quot;__sse8668127&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cheftalk-110722221912-phpapp02&amp;stripped_title=cooking-with-chef-8668127&amp;userName=krobertson2&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/center&gt;


&lt;p&gt;Check them out and feel free to ping me if there are any questions.  At
the meetup, was also talking about doing a bit of a blog series on
getting started with Chef and posting some of the scripts and baseline
setup I have used before.  Hope to start forming some simple getting started resources.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>New Opportunities</title>
      <link>http://invalidlogic.com/2011/07/19/new-opportunities/</link>
      <pubDate>Tue Jul 19 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/07/19/new-opportunities/</guid>
      <description>&lt;div style=&quot;float:right; margin-left: 10px; margin-bottom: 5px&quot;&gt;&lt;img src=&quot;http://invalidlogic-blog.s3.amazonaws.com/demandbase_logo.gif&quot; width=&quot;200&quot; height=&quot;32&quot;/&gt;&lt;/div&gt;


&lt;p&gt;Finally posting about it a little bit late, but last week was my first
week in a new position with a new company.  I truly enjoyed my stay at
&lt;a href=&quot;http://www.involver.com/&quot;&gt;Involver&lt;/a&gt;, but saw an opportunity pop up and decided to take it.&lt;/p&gt;

&lt;p&gt;This new opportunity is to be one of the first in-house Ruby developers
at &lt;a href=&quot;http://www.demandbase.com&quot;&gt;Demandbase&lt;/a&gt;.  Demandbase specializes in a
B2B analytics API for reporting and logging information about visitors
hitting your business's website.&lt;/p&gt;

&lt;p&gt;That all sounds fancy, but the gist is I'll be helping to grow and form
the team, scale up and expand the platform, and able to leverage both
skillsets as a developer and in operations.  They've been working with
the awesome guys from &lt;a href=&quot;http://highgroove.com/&quot;&gt;Highgroove&lt;/a&gt;, utilizing
Chef in a continuous deployment setup, doing geographic load balancing, and have a pretty agile and
responsive process setup.&lt;/p&gt;

&lt;p&gt;I had an amazing time at Involver and grew so much personally and
professionally.  I was a part of some major projects and instrumented a
lot of change.  Our Operations team was top notch and put out of a lot
of stuff considering it was only 3 people.&lt;/p&gt;

&lt;p&gt;Going forward, have some goodies I'll hopefully be working on and open
sourcing.  There are a lot of interesting things in the works and hope
to post about them over time.&lt;/p&gt;

&lt;p&gt;And by the way, Demandbase is hiring.  Hit me up
&lt;a href=&quot;http://twitter.com/krobertson&quot;&gt;@krobertson&lt;/a&gt; or shoot me &lt;a href=&quot;http://scr.im/2e1e&quot;&gt;an email&lt;/a&gt;.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Announcing Gemstache</title>
      <link>http://invalidlogic.com/2011/06/30/announcing-gemstache/</link>
      <pubDate>Thu Jun 30 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/06/30/announcing-gemstache/</guid>
      <description>&lt;p&gt;Pleased to announce &lt;a href=&quot;http://gemstache.com&quot;&gt;Gemstache&lt;/a&gt;, a new service to enable teams and companies to build and distribute their own private gems with security and ease of use in mind.&lt;/p&gt;

&lt;p&gt;Gems are an incredibly simple way to package up code and distribute it, making it available to multiple code bases or just a great way to encapsulate functionality.  However, the way gems are traditionally distributed doesn't lend itself well to securing the gems and controlling access.  The default &quot;gem install&quot; command you run doesn't provide any support for authentication against the gem source, so most sources are open to the public.&lt;/p&gt;

&lt;div style=&quot;text-align: center&quot;&gt;&lt;img src=&quot;http://invalidlogic-blog.s3.amazonaws.com/2011-06-30-gemstache.png&quot; width=&quot;399&quot; height=&quot;323&quot; /&gt;&lt;/div&gt;


&lt;p&gt;Gemstache works by giving you your own private gem source you can use.  In order to download any gems from it, you must have the accompanied &quot;gemstache&quot; gem installed locally or on your servers.  When talking to your private gem source, it interlaces to add authentication to the request as well as ensuring it is happening over HTTPS.  With this, your gems are only downloaded over SSL and any interaction requires authentication.&lt;/p&gt;

&lt;p&gt;To make managing your gems easier, the gem adds the ability to easily upload a gem to your private gem source and make it available.  From your command line, just run &quot;gem stache [your gem file]&quot; and it is uploaded and ready for use.&lt;/p&gt;

&lt;p&gt;Within the service, you can give users varying roles to define whether they can just download gems, are able to publish new gems, and are able to yank/delete gems.&lt;/p&gt;

&lt;p&gt;Gemstache was born out of a need we had been facing at &lt;a href=&quot;http://www.involver.com&quot;&gt;Involver&lt;/a&gt;, where some of our own internal code is enclosed in gems and used between a few of our codebases, as well as we have some gems we have forked to either add customizations or our own fixes.  Traditional methods left them exposed and also more painstaking to release.&lt;/p&gt;

&lt;p&gt;We're just about ready to launch a public beta.  Visit &lt;a href=&quot;http://gemstache.com&quot;&gt;gemstache.com&lt;/a&gt; and sign up to be notified.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Beware of error handling with fibers in an evented context</title>
      <link>http://invalidlogic.com/2011/05/26/beware-of-error-handling-with-fibers-in-an-evented-context/</link>
      <pubDate>Thu May 26 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/05/26/beware-of-error-handling-with-fibers-in-an-evented-context/</guid>
      <description>&lt;p&gt;One of the more interesting developments in Ruby lately has been the interesting things being done with Ruby 1.9.2, Fibers, and EventMachine.  Whether you look at it being applied to existing libraries with &lt;a href=&quot;https://github.com/mperham/rack-fiber_pool&quot;&gt;rack/fiber_pool&lt;/a&gt;, or &lt;a href=&quot;https://github.com/postrank-labs/goliath&quot;&gt;Goliath&lt;/a&gt;, it packs a punch and proving interesting for high performance evented applications.&lt;/p&gt;

&lt;p&gt;Recently when reworking one of our backend applications to use rack/fiber_pool with EventMachine, I ran into a gotcha when it came to exception handling.  Asynchronous applications makes heavy use of callbacks, where the context of when an operation is completed is not inline with when it began.  Fibers work to make it easier to write asynchronous code look like synchronous, where you make a call, and it returns a result.&lt;/p&gt;

&lt;p&gt;The problem is that this can play a trick on your eye.  You think you are executing something in line, but the context it is operating within jumps without you being necessarily aware of it.  Take the following example:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;eventmachine&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;em-synchrony&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fiber&amp;#39;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;doit&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Fiber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;EventMachine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_timer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;uhh ohh&amp;#39;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Fiber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yield&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;EM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;synchrony&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;beginning&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;doit&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;end&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ERROR: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Have a nice day&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;EventMachine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;From looking at the main block, you have the call to doit wrapped in a begin/rescue, so it seems logic that if an error was raised within it, the rescue block would capture it and handle the error.  Unfortunately, the error it being raised outside the context of the fiber, so it isn't caught.  You are outside the context of the fiber in the time between when &lt;code&gt;Fiber.yield&lt;/code&gt; is called and &lt;code&gt;f.resume&lt;/code&gt; is called.&lt;/p&gt;

&lt;p&gt;Why is this context important?  Because when we built applications, we want them to be resilient.  For instance, if a web request encounters an error, we want it caught, reported either to a log or a service, a response returned to the user, and then it be ready to handle the next request.  However outside the context of the fiber, the error handling we've built in won't get called and the application can exit.  Even if the application is monitored with god, existing connections will get closed out and connections won't be served while it is restarting, and the valuable information within the error is lost.&lt;/p&gt;

&lt;p&gt;Once the fiber is resumed, the error handling functions as expected.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;eventmachine&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;em-synchrony&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fiber&amp;#39;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;doit&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Fiber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;EventMachine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_timer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resume&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Fiber&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yield&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;EM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;synchrony&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;beginning&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;doit&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;uhh ohh&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ERROR: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Have a nice day&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;EventMachine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;In this case, the exception will be caught and handled, and you will make it to the &quot;Have a nice day&quot; message.&lt;/p&gt;

&lt;p&gt;In order to handle the error, you can add some exception handling within the main context, or the root fiber.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;EM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;synchrony&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;beginning&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;doit&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;end&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ERROR: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Have a nice day&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;EventMachine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Exception&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;We caught something outside a fiber!&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;However, I haven't yet figured out how to have the same thing done in the context of a web app.  So far, I've just ensured I have proper error handling in the callbacks before the fiber is resumed.  Trying to put a begin/rescue block in the config.ru doesn't seem to have any effect on rescuing an error.&lt;/p&gt;

&lt;p&gt;The moral of the story is when using fibers, be conscious of error handling outside the context of the fiber.  Unhandled exceptions there can cause the entire application to exit.  Be aware you have proper error handling when doing something that yields a fiber, and whether they fiber-enabled libraries you are using have error handling outside the context as well.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>MySQL Read/Write Splitting in JRuby</title>
      <link>http://invalidlogic.com/2011/05/16/mysql-read-write-splitting-with-jruby/</link>
      <pubDate>Mon May 16 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/05/16/mysql-read-write-splitting-with-jruby/</guid>
      <description>&lt;p&gt;I was rather surprised about the lack of information out there about how to do read/write splitting with MySQL and Rails on JRuby.  This is a pretty key part of our infrastructure, and has been a major point of our attention when performing large platform upgrades.&lt;/p&gt;

&lt;p&gt;Having recently gone through one such upgrade and subsequent breaking of our read/write splitting, I had to dive into the code that was doing it more and get a better understanding of how it works.&lt;/p&gt;

&lt;p&gt;With JRuby, there are two things to be aware of when trying to enable read/write splitting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does it route the queries to the right box?&lt;/li&gt;
&lt;li&gt;Does it do it without sucking all available connections up on MySQL?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The second one sounds weird, however we have actually seen it and had it cause major issues.  I am not totally sure what to attribute it to, but somewhere between ActiveRecord, ActiveRecord-JDBC, and the MySQL JDBC driver, there is some weird connection handling going on where a connection will still be established, however viewed as dead and a new connection will be opened up.  Eventually, it just sucks up all available connections to MySQL.&lt;/p&gt;

&lt;p&gt;This is a pretty big problem, but can work around it.  Most of the existing information out there about how to do read/write splitting with ActiveRecord doesn't always apply cleanly to JRuby.  In particular with one, we ran into the connection-sucking issue while in the benchmarking process.&lt;/p&gt;

&lt;p&gt;Fortunately, there isn't a whole lot that needs to be done to enable splitting.  The MySQL JDBC driver &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-replication-connection.html&quot;&gt;already has support for it&lt;/a&gt; with its ReplicationDriver, you just need to enable it when using Rails.  Then you can leverage a plugin which sets a &quot;read_only&quot; property on the raw connection when it recognizes a 'SELECT' query.  When read_only is flagged, the driver knows it can send the query to servers other than the master.&lt;/p&gt;

&lt;p&gt;Steps to configure read/write splitting:&lt;/p&gt;

&lt;h3&gt;1) Get activerecord-jdbcmysql-adapter&lt;/h3&gt;

&lt;p&gt;If you're going to use MySQL on JRuby with ActiveRecord, this is rather a given.  We're currently using v1.1.1 and happy.  All the JDBC adapters are basically rolled up in &lt;a href=&quot;https://github.com/nicksieger/activerecord-jdbc-adapter&quot;&gt;one repo&lt;/a&gt; which produces multiple gems.&lt;/p&gt;

&lt;h3&gt;2) Get my version of the active-record-jdbc-mysql-master-slave plugin&lt;/h3&gt;

&lt;p&gt;There is a plugin that takes care of setting the read_only property on the connection for 'select' queries.  The &lt;a href=&quot;https://github.com/mccraigmccraig/active-record-jdbc-mysql-master-slave&quot;&gt;original version&lt;/a&gt; of the plugin was originally written for Rails 2.2 and hasn't been updated in 2 years.  We originally used it on Rails 2.2.2 and had a lot of success with it.&lt;/p&gt;

&lt;p&gt;It doesn't work on Rails 2.3 through, primarily because of the load order changing.  It previously worked by alias_methoding the initializer on JdbcAdapter, and in its initialize, would alias_method the _execute method if using mysql.  However, load order changed in Rails 2.3 and the database connection is initialized before the plugin is loaded, causing its own version of initialize to not run.  I've &lt;a href=&quot;https://github.com/krobertson/active-record-jdbc-mysql-master-slave&quot;&gt;updated it&lt;/a&gt; to use a slightly different method to ensure it happens regardless of load order.&lt;/p&gt;

&lt;p&gt;To install the plugin, can just use ./script/plugin:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;$ ./script/plugin install git://github.com/krobertson/active-record-jdbc-mysql-master-slave.git
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h3&gt;3) Ensure active connections are reset in ActiveRecord&lt;/h3&gt;

&lt;p&gt;You can still experience some issues with stray connections.  The best way we have found to combat this is through an after filter on controllers that does some cleanup.  Add this portion to your ApplicationController:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;after_filter&lt;/span&gt;  &lt;span class=&quot;ss&quot;&gt;:clear_database_connections&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;clear_database_connections&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;clear_active_connections!&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;By calling &lt;tt&gt;ActiveRecord::Base.clear_active_connections!&lt;/tt&gt;, it ensures connections are reset.  It is best to try and ensure it is the last after_filter defined.&lt;/p&gt;

&lt;h3&gt;4) Configure your database.yml&lt;/h3&gt;

&lt;p&gt;The key in the database.yml is to set up activerecord-jdbc to use MySQL's replication driver and to configure the &quot;url&quot; for it.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;erb&quot;&gt;&lt;span class=&quot;x&quot;&gt;production:&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  adapter:  jdbcmysql&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  username: myuser&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  password: secret&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;vg&quot;&gt;$0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/(rake|irb)/&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;-%&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  host:     masterdb&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  port:     3306&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  database: myapp&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;-%&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  driver:   com.mysql.jdbc.ReplicationDriver&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  url:      jdbc:mysql://masterdb:3306,slavedb:3306/myapp?roundRobinLoadBalance=false&amp;amp;autoReconnect=true&amp;amp;failOverReadOnly=true&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;-%&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;You may be looking at it and thinking I've got erb in my yaml... and yes.  Rails lets you mix the two, and the reason in this case is because we opt to disable the read/write splitting in the Rails console (irb) and when running rake.  Two very important reasons to. First, in console, we've had it suck up all connections just when doing simple debugging.  Not fun.  The normal adapter doesn't do it.  And second, we want it off in rake for when we deploy and it does db:migrate.  We don't want to allow replication delay in there, such as when querying the schema_migrations table.&lt;/p&gt;

&lt;p&gt;For the read/write splitting part, the bulk of the settings are in the &quot;url&quot;.  The first host specified is the master, and any others are slaves.  It is &lt;em&gt;supposed&lt;/em&gt; to support multiple slaves and have the option to load balance between them, though we found in practice it never really worked.  Instead we direct our web app and background processing to separate slaves.  After the hosts comes the database name, and the query string parameters are a number of the driver options.&lt;/p&gt;

&lt;h3&gt;How the stuff works&lt;/h3&gt;

&lt;p&gt;At first, looking at the code for the plugin seemed rather confusing.  Less than 100 lines of injecting into ActiveRecord did our read/write splitting?  But the truth is it is fairly simple, as most of the work is handled by the underlying driver (MySQL's JDBC driver).  All we really need to do is populate that read_property on the driver's connection.  Shortened up, it does this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:_execute_without_master_slave&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:_execute&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:_execute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:_execute_with_master_slave&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# if we&amp;#39;re in auto-commit mode and about to execute a select statement, &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# then set the connection in read-only mode for the duration of&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# the query... which will permit the query to be load-balanced&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# amongst the slaves by the mysql connector/j ReplicationDriver&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;_execute_with_master_slave&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# Need to set the read_only option on the raw connection&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# to tell the underlying driver whether the request can&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# go to slaves.&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cro&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;raw_connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_only&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;raw_connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_only&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
      &lt;span class=&quot;n&quot;&gt;raw_connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;auto_commit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;JdbcConnection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;nb&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_execute_without_master_slave&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sql&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
     
  &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;raw_connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_only&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cro&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;To sum it up, the adapter has an _execute method which does the real execution and is passed in the raw SQL.  The plugin injects itself in the middle.  First, it captures the current read_only value, because after it executes the given query, it wants to ensure it is set back to that.  Next, it sets the read_only property based on whether MySQL itself has auto_commit on and if it is a 'select' query.  It then calls the original _execute method, and after it runs, sets read_only back.&lt;/p&gt;

&lt;p&gt;The actual plugin has several additional things, like allowing you to run some statements within a block to ensure it goes to the master, and to only work with the MySQL adapter.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Transparency and status</title>
      <link>http://invalidlogic.com/2011/04/29/transparency-and-status/</link>
      <pubDate>Fri Apr 29 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/04/29/transparency-and-status/</guid>
      <description>&lt;p&gt;One thing that I think can really be highlighted from the recent AWS issues is the value of a status dashboard for your platform/service..  However, simply having one isn't quite enough.  Plenty of services already do.  What really matters is how effectively it is used.&lt;/p&gt;

&lt;p&gt;Just think why a customer would be coming to your status dashboard and what they'd be looking for.  If they're coming to it, it is likely because they're having a problem.  What they'd be looking for is confirmation that the company is aware of the issue and a rough idea of when it would be fixed.&lt;/p&gt;

&lt;p&gt;This sounds quite simple and plainly put, however rarely done.  I don't know if its some management/PR intervention of not wanting to sound unstable or unreliable, or if it is just that level of transparency isn't encouraged/practiced at these companies, but simple information often never makes it public, or seems to after the fact.&lt;/p&gt;

&lt;div style=&quot;float:right; margin-top: 5px; margin-left: 10px; margin-bottom: 5px&quot;&gt;&lt;a href=&quot;http://invalidlogic-blog.s3.amazonaws.com/2011-04-28-aws-large.png&quot;&gt;&lt;img src=&quot;http://invalidlogic-blog.s3.amazonaws.com/2011-04-28-aws-small.jpg&quot; width=&quot;68&quot; height=&quot;400&quot; title=&quot;holy cow that sucker's long&quot; border=&quot;0&quot; style=&quot;border: 0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;


&lt;p&gt;One our major gripes with Amazon when we were hosted with them was how we'd become aware of an issue, but in some cases it would be hours before an &lt;em&gt;acknowledgment&lt;/em&gt; of it went onto the status dashboard.  The 1am EBS outage of last week has repeated itself before, and interestingly around 1am several times.  It affected Reddit just a month or so ago, and it affected us back in October.  One of our other guys was up at 1am, aware immediately of the EBS issue since it was impacting our master database server.  It took Amazon &lt;em&gt;two and a half hours&lt;/em&gt; to post about it on their status site, even stating it began the same time we were paged.&lt;/p&gt;

&lt;p&gt;An additional aspect often missed is the value of the post-mortem.  When you have a major issue, customers lose confidence.  The post-mortem is a chance to try and gain some of that back.  It doesn't need to divulge every single detail and shouldn't look at it as an embarrassment.  When I think of a post-mortem, I look for 3 things: what happened, why it happened, and how it won't happen again.  It can very effective at reassuring users if you can clearly show that you understand what went wrong and have a solid plan to ensure it won't happen again.  Glossing over the chance by simply saying &quot;we've fixed &lt;em&gt;it&lt;/em&gt;&quot; (without saying what &lt;em&gt;it&lt;/em&gt; is, in some fashion) can simply detract users even more.&lt;/p&gt;

&lt;p&gt;Example of a post-mortem done wrong?  Look at &lt;a href=&quot;http://staff.tumblr.com/post/2127872280/downtime&quot;&gt;Tumblr's downtime in December&lt;/a&gt; or their &lt;a href=&quot;http://staff.tumblr.com/post/3959106211/update-regarding-security-issue&quot;&gt;security leak in March&lt;/a&gt;.  Look at the majority of AWS issues.  Typically, they don't do them.  They only do them when they &lt;a href=&quot;http://aws.amazon.com/message/65648/&quot;&gt;majorly&lt;/a&gt; &lt;a href=&quot;http://status.aws.amazon.com/s3-20080720.html&quot;&gt;screw up&lt;/a&gt;.  And when they do, there is an air of &quot;architect for us&quot; attitude.&lt;/p&gt;

&lt;p&gt;Here are a few quick things that would make any status dashboard serve its purpose well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update early, update often.&lt;/li&gt;
&lt;li&gt;Don't downplay the severity.&lt;/li&gt;
&lt;li&gt;Give ETAs on resolutions.&lt;/li&gt;
&lt;li&gt;Be very generous with ETAs (go worst case).&lt;/li&gt;
&lt;li&gt;Choose a good layout!  Look at the image to the side for Amazon's site during their issue.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Above all though, look at the status site from the perspective of their users.  Think about why they would come there and what information they're looking for.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Talk Cloudy To Me</title>
      <link>http://invalidlogic.com/2011/04/27/talk-cloudy-to-me/</link>
      <pubDate>Wed Apr 27 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/04/27/talk-cloudy-to-me/</guid>
      <description>&lt;div style=&quot;float:right; margin-top: 5px; margin-left: 10px; margin-bottom: 5px&quot;&gt;&lt;img src=&quot;http://invalidlogic-blog.s3.amazonaws.com/2011-04-27-talk-cloud.jpg&quot; width=&quot;180&quot; height=&quot;119&quot; /&gt;&lt;/div&gt;


&lt;p&gt;I will be talking at the &lt;a href=&quot;http://www.meetup.com/cloudcomputing/events/16701362/&quot;&gt;Silicon Valley Cloud Computing Meetup&lt;/a&gt; this Saturday, April 30th.  If you are interested in the topic and in the area, please come out!  So far there are about 500+ people plus registered to view panels discussing a wide variety of cloud-related topics throughout the day.&lt;/p&gt;

&lt;p&gt;I will be speaking on the panel titled &lt;strong&gt;&quot;What are public clouds still missing?&quot;&lt;/strong&gt;  Will be talking about what areas the public clouds still fall short in and where the road ahead will hopefully take us.&lt;/p&gt;

&lt;p&gt;Other speakers who will be there include notable people from VMware, including some of the &lt;a href=&quot;http://www.cloudfoundry.com/&quot;&gt;CloudFoundry&lt;/a&gt; engineers, Netflix, Cisco, Microsoft, and Rackspace.&lt;/p&gt;

&lt;p&gt;Definitely come and check it out!  Saturday starting at 1pm, hosted at the Microsoft Mountain View offices.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
    <item>
      <title>Amazon and what it means to you</title>
      <link>http://invalidlogic.com/2011/04/22/amazon-and-what-it-means-to-you/</link>
      <pubDate>Fri Apr 22 00:00:00 -0700 2011</pubDate>
      <guid>http://invalidlogic.com/archives/2011/04/22/amazon-and-what-it-means-to-you/</guid>
      <description>&lt;p&gt;Unless you were under a rock, you probably heard about the major issues in Amazon's US-East region yesterday.  Needless to say, a lot of businesses had a rough day yesterday.&lt;/p&gt;

&lt;p&gt;One of the most interesting aspects of yesterday was realizing how big Amazon's reach is.  Numerous well known startups and businesses were down, but beyond that, services not even on Amazon themselves were affected.  We &lt;a href=&quot;http://invalidlogic.com/2011/02/11/how-we-did-a-datacenter-migration-with-no-downtime/&quot;&gt;moved off EC2&lt;/a&gt; back in December, however we integrate with APIs from several other services, including some that are running on EC2.  We still felt the impact and were closely watching Amazon tracking status.&lt;/p&gt;

&lt;p&gt;The event lead to some interesting discussions though.&lt;/p&gt;

&lt;div style=&quot;width: 100%; text-align: center; margin: 10px 0;&quot;&gt;&lt;a href=&quot;http://twitter.com/#!/rtomayko/status/61132582489817088&quot;&gt;&lt;img src=&quot;http://invalidlogic-blog.s3.amazonaws.com/2011-04-22-rtomayko-tweet.jpg&quot; width=&quot;588&quot; height=&quot;260&quot; border=&quot;0&quot; style=&quot;border: 0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;


&lt;p&gt;There has been a lot of blame going back and forth, with some leaning on the side of &quot;you should have planned for it&quot;.  While it can be particularly harsh, in that most best practices for Amazon stressed leveraging multiple availability zones, while yesterday, it was nearly an entire region that was out.  There is an element of truth in the argument... &lt;em&gt;have a plan&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Typically that is known as a Disaster Recovery plan.  They easy to be overlooked until you realize you need one.  They're always one of those &quot;we should do that someday&quot; or maybe even something a company doesn't think its big enough to need.&lt;/p&gt;

&lt;p&gt;I am no expert on disaster recovery (and there are plenty of consultants out there to help build a professional one), but there are some pretty basic things you can look at to at least have &lt;em&gt;a plan&lt;/em&gt; rather than &lt;em&gt;no plan&lt;/em&gt;.  Some services recovered pretty well yesterday, albeit with partial functionality, but they got something back up.  Others realized they were at the mercy of another provider and were stuck until then.&lt;/p&gt;

&lt;p&gt;There are some simple questions you can begin to answer for yourself for a simple plan:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What data is important?&lt;/strong&gt;  Your service runs on code, but it is powered by data.  What data is it dependent on?  Image assets, file uploads, databases?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where does my data live, and how can I have it in multiple places?&lt;/strong&gt;  Take regular database backups and store them off site.  Keep a backup of assets.  It is important for them to be in more than one location since if that location disappears, you are SOL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much data loss is acceptable?&lt;/strong&gt;  If stuff goes down, you may lose some data.  If you want to limit the loss, you need to keep fresher copies of data.  More frequent backups, perhaps a live DB slave hosted somewhere else.  You need to either accept that some data loss is acceptable, or architect so that you won't have any data loss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How fast can you provision servers and where?&lt;/strong&gt;  Geo distribution all the time can be expense and not necessary (unless you deem it is), but being able to have somewhere to quickly set up emergency servers is a major plus.  If you use AWS East, then maybe use AWS West for DR.  Make sure your account limits give you enough capacity, and have scripts and basic stuff in place and ready to be used.  We leverage Chef for all our systems, so we can quickly launch some new servers and get right to work configuring them pretty quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is your order of priorities?&lt;/strong&gt;  A service is often comprised of many smaller components.  Know which ones are the highest priority.  Know which functionality without your app is most important.  You'll be racing against the clock and have only so many people.  This lets them focus their attention to help get core functionality up as quickly as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do a fire drill.&lt;/strong&gt;  This is something I think we'll be doing pretty soon.  Out of the blue one day, do a mock fire drill.  You are down, your datacenter disappeared.  Get the service back up in an alternative place.  How long does it take you?  What were the pain points?  Beyond simply having a plan, you need to know the plan will work.&lt;/p&gt;

&lt;p&gt;And lastly, &lt;strong&gt;know your application&lt;/strong&gt;.  Know its requirements, constraints, and understand its bare minimums, most important pieces, etc.&lt;/p&gt;
</description>
      <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
    </item>
    
  </channel>
</rss>
