<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">
    <title>ninjakoala</title>
    <subtitle>ninjakoala.com is the website of Neil Prosser</subtitle>
    
    <link href="http://ninjakoala.com/" />
    <updated>2012-01-11T15:37:46-08:00</updated>
    <id>http://ninjakoala.com/</id>
    <author>
        <name>Neil Prosser</name>
        <email>neil.prosser@gmail.com</email>
    </author>
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ninjakoala" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ninjakoala" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
        <title>Looking backward</title>
        <link href="http://ninjakoala.com/looking-backward/" />
        <updated>2012-01-09T00:00:00-08:00</updated>
        <id>http://ninjakoala.com/looking-backward</id>
        <content type="html">&lt;p&gt;&lt;a href="http://blog.marrowboy.co.uk/"&gt;Matt&lt;/a&gt; asked me the other day &amp;ldquo;What&amp;rsquo;s on your &amp;lsquo;learn this in 2012&amp;rsquo; list?&amp;rdquo; It got me thinking that rather than tell someone and not have it recorded anywhere, I should be able to be held accountable for what I said I&amp;rsquo;d do. Welcome to the fruit of that particular bit of thinking. Rather than dive straight in looking forward I thought it&amp;rsquo;d be helpful to take a look back at 2011 and make sense of what I&amp;rsquo;ve picked up during a pretty hectic year.&lt;/p&gt;

&lt;h3&gt;Where we started&lt;/h3&gt;

&lt;p&gt;We started January in the middle of rewriting two of our most important services, at the same time. Our team are responsible for the metadata within Nokia Entertainment. We maintain six services that combine to provide storage, indexing and search functionality which underpins our entertainment platform.&lt;/p&gt;

&lt;p&gt;We hadn&amp;rsquo;t deployed anything more than a hotfix to live for a few months and I get the feeling we were viewed by those around us as a team that weren&amp;rsquo;t really doing anything of value. It took six months of toil to get those services out there but the lessons learned along the way were so helpful and have permeated almost every aspect of our work since. Like those awful motivational posters say: &amp;ldquo;Learning is a journey, not a destination&amp;rdquo;, or something similarly twee.&lt;/p&gt;

&lt;h3&gt;Real developers ship&lt;/h3&gt;

&lt;p&gt;Being a developer and not having anything deployed for users to actually use is a frustrating feeling. Our main reason for doing the rewrite was to add the new functionality that was needed for the continued expansion of our platform. Our original code was written as we were all learning Java and we had made some mistakes that we decided would be too time-consuming to unpick. It would also see us join the 21st century and get on board with our continuous delivery strategy. This would see us going from &amp;lsquo;big-bang&amp;rsquo; deploys of months of work by non-developers to us pushing the button on all of our releases when we decided it was time for a deployment.&lt;/p&gt;

&lt;p&gt;I remember one of the team working on our continuous delivery service asking me what my expectations were. I said that if we were able to have an idea on Monday and have it in production by Friday I&amp;rsquo;d be a happy little developer. It turns out my wishes more than came true. We went from having no control over deployments to being able to write code and get it in front of users within twenty minutes. To say that this was empowering would be a monumental understatement. The bugs that are inevitable in our job can be fixed-forward rather than rolled-back, we can tweak configuration values within minutes if something isn&amp;rsquo;t behaving and most of all we, as developers, are in control.&lt;/p&gt;

&lt;p&gt;This is by no means a new idea, but it&amp;rsquo;s helped us stop thinking in terms of cramming as much as we can into big releases. We can make small iterations and we don&amp;rsquo;t forget what we&amp;rsquo;re about to deploy because it was written weeks ago.&lt;/p&gt;

&lt;h3&gt;Acceptance testing&lt;/h3&gt;

&lt;p&gt;When we were starting out we decided to write our acceptance tests using &lt;a href="http://twitter.com/#!/unclebobmartin"&gt;Uncle Bob&lt;/a&gt;&amp;rsquo;s excellent &lt;a href="http://fitnesse.org/"&gt;FitNesse&lt;/a&gt;. We had the mistaken belief that our product owners might want to write our acceptance tests for us. This wasn&amp;rsquo;t the case. We also made the mistake of wiring our services up to run our acceptance tests (more like integration tests) which made our tests complicated and brittle.&lt;/p&gt;

&lt;p&gt;Based on those lessons we now do our acceptance testing with &lt;a href="http://www.junit.org/"&gt;JUnit&lt;/a&gt; against an instance of our service running against (in most cases) mocked dependencies. This approach and the libraries we wrote to help test our REST services spawned my first real experience of open source programming with &lt;a href="http://github.com/rest-driver/rest-driver"&gt;REST-driver&lt;/a&gt;. We&amp;rsquo;re now at the point where someone new to a project can run the tests with two commands (&lt;code&gt;git clone&lt;/code&gt; and &lt;code&gt;mvn verify&lt;/code&gt;). Using JUnit means that we&amp;rsquo;re writing our tests in the same language we use to write our services and the tests are easy to run (meaning there&amp;rsquo;s no excuse for not running them).&lt;/p&gt;

&lt;p&gt;Our FitNesse tests now form an impressive regression suite that we run daily over our services. It&amp;rsquo;s a bit of a chore to edit and even more of a chore to run, down to the way we&amp;rsquo;ve used it not FitNesse itself. It will be retired when the versions of our APIs that it tests are finally deprecated.&lt;/p&gt;

&lt;h3&gt;Performance testing isn&amp;rsquo;t a silver bullet&lt;/h3&gt;

&lt;p&gt;I spent the early part of 2011 banging on to anyone who&amp;rsquo;d listen about the importance of performance testing our services. As a team, we must have spent a month or so solidly working on performance tests for the rewritten services. &lt;a href="http://jmeter.apache.org/"&gt;JMeter&lt;/a&gt; was recruited for hitting the service, &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; was used for some extra scripting and &lt;a href="http://mbostock.github.com/protovis/"&gt;Protovis&lt;/a&gt; was used for customised graph creation. I expected our performance test graphs to be flat lines with a little jump when someone committed some code which was slow and then promptly flattened back out as we spotted the bottleneck and fixed it. What we got was a completely different story. Most of our lines were jumping all over the place. We then proceeded to let our performance tests decay and I don&amp;rsquo;t think they&amp;rsquo;ve been run for months.&lt;/p&gt;

&lt;p&gt;We got some confidence that our services were at least comparable speed-wise to the previous versions but it turns out performance testing wasn&amp;rsquo;t as important as I thought it was.&lt;/p&gt;

&lt;h3&gt;Being able to see what&amp;rsquo;s going on&lt;/h3&gt;

&lt;p&gt;What actually gave us more confidence was the introduction of metrics to our services. Previously to have any inkling of how our services were performing we were limited to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://ganglia.sourceforge.net/"&gt;Ganglia&lt;/a&gt; which gave us &amp;lsquo;metal&amp;rsquo; stats for our servers&lt;/li&gt;
&lt;li&gt;Getting someone to jump on our live boxes and let us browse the log files or asking someone to send us the log files&lt;/li&gt;
&lt;li&gt;A single email notification that someone had scripted for us as a cron job&lt;/li&gt;
&lt;li&gt;Our internal logging service (which has an interface which makes it difficult to use)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Following on from the disappointment of our performance testing and spurred on by a proof-of-concept created by one of the team we found &lt;a href="http://codahale.com/"&gt;Coda Hale&lt;/a&gt;&amp;rsquo;s &lt;a href="http://github.com/codahale/metrics"&gt;Metrics&lt;/a&gt; library. &lt;strong&gt;I can&amp;rsquo;t emphasise enough how important this little library has been to us.&lt;/strong&gt; We&amp;rsquo;ve gone from a position of having virtually no visibility of how our services are acting to having a group of metrics so detailed and up-to-date that we are beginning to get to a position of predicting when something is about to go wrong, or diagnosing problems early.&lt;/p&gt;

&lt;p&gt;We now begin to make performance decisions based on these metrics. Rather than performing outside-in performance testing (such as described above) where our service is called and we measure total response times we&amp;rsquo;re able to get all this and more by building the measurements into our service. Again, this is by no means ground-breaking in the grand scheme of things but, for us, it&amp;rsquo;s an epic win which has changed the way we work and how we are able to indicate to our stakeholders what is going on.&lt;/p&gt;

&lt;p&gt;This metrics-based approach is being adopted by other teams so we&amp;rsquo;re able to overlay the behaviour of communicating services on top of each other, allowing us to interpret trends and help improve the experience for our customers.&lt;/p&gt;

&lt;h3&gt;Making stuff visible&lt;/h3&gt;

&lt;p&gt;It seems strange now to look back at the position we were in a year ago and not be able to get &amp;lsquo;live&amp;rsquo; stats from our services. We had an information radiator which showed our CI status but that was it. We now feed our metrics into &lt;a href="http://graphite.wikidot.com/"&gt;Graphite&lt;/a&gt; and have a comprehensive set of stats and graphs that rotate throughout the day on a big screen in the middle of our team. In some cases spotting impending doom has been as simple as watching for a sudden change in the lines of a graph. All of this data is available to our stakeholders which means that they can hold us to account on how we&amp;rsquo;re doing as well.&lt;/p&gt;

&lt;h3&gt;Going &amp;lsquo;off-piste&amp;rsquo; every so often&lt;/h3&gt;

&lt;p&gt;A by-product of our job is that the truly interesting tasks aren&amp;rsquo;t necessarily what we spend most of our time doing. I&amp;rsquo;m grateful my job throws up more than enough interesting challenges but sometimes you&amp;rsquo;ll find something shiny that you just have to get your grubby hands on there and then. As a result of some of this &amp;lsquo;shiny-following&amp;rsquo; I&amp;rsquo;ve had the chance to scratch my JavaScript and data visualisation itches. I&amp;rsquo;ve seen others doing similar things and more often than not this stuff ends up helping with work eventually. We&amp;rsquo;ve all got jobs that we&amp;rsquo;re paid for but a little distraction can fire-up some enthusiasm or spark something new.&lt;/p&gt;

&lt;h3&gt;Meeting people&lt;/h3&gt;

&lt;p&gt;The change of approach mentioned above hasn&amp;rsquo;t just occurred as a result of browsing the web or coming up with it internally. In March a number of people attended &lt;a href="http://qconlondon.com/"&gt;QCon&lt;/a&gt; and we learned that, as a company, we weren&amp;rsquo;t far off the industry leaders in terms of our continuous delivery strategy but there was plenty of inspiration for how we structure our services and monitor them. This inspiration came back to the office and started to sneak into the things we were doing. I can&amp;rsquo;t really remember any developers attending conferences before QCon 2011 but it has got people keeping an eye out for events to attend.&lt;/p&gt;

&lt;p&gt;Getting out, meeting new people and ranting with them is a great way to start solving problems or to spot problems you might be wandering blindly towards. Plus, it&amp;rsquo;s always nice to go somewhere and geek out with a bunch of like-minded people.&lt;/p&gt;

&lt;h3&gt;Finally, some small ones&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt; &amp;ndash; branches are a fantastic way to prevent toe-treading and I&amp;rsquo;m still amazed by its ability to smoosh things together smoothly.&lt;/li&gt;
&lt;li&gt;Get an SSD &amp;ndash; sitting in front of your machine while it boots or Eclipse fires up is no fun.&lt;/li&gt;
&lt;li&gt;Read &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt; &amp;ndash; I&amp;rsquo;ve found that my focus is moving from the RSS feeds I track using &lt;a href="http://www.google.com/reader"&gt;Google Reader&lt;/a&gt; to Twitter. I&amp;rsquo;ve got lucky and started following a group of people who are feeding me interesting links all the time, and I don&amp;rsquo;t even have to pay them!&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So, with that out the way, I can start looking forward to what I hope 2012 has in store.&lt;/p&gt;
</content>
    </entry>
    
</feed>

