Search

Enter a search word or two and press return to see the search results.

Who am I?

Hi, I’m Graeme and these are my notes, from my messy desk. I started this blog because Google proved to be more useful at finding content than anything else I’ve used.

So I started adding my own content in the hopes that Google would index it and allow me to find things again in the future.

It works.

You can find out more about me here, and you should follow me on Twitter here.

Keeping up

You can automatically receive new content here by subscribing to the “Blog RSS” (link below). This is the easiest way to keep up with what I write here.  See this BBC article for a good introduction on RSS and keeping up with the goings on of the Internet more easily.

Wednesday
04Nov2009

PragProWriMo

I’ve committed to getting involved in PragProWriMo, which is piggybacking on top of NaNoWriMo, the National Novel Writing Month. The concept is simple: write 4 pages of prose every day for the month of November. By 1st December, you should have about 50,000 words towards a book. Or you won’t, and you’ll have a better idea of how much effort is involved in writing the book you’ve always promised to write.

I’ve always wanted to write a book (actually, what I want  is to have a book published and available for sale in the local Borders, but the writing is a necessary prerequisite). I’ve even approached the Pragmatic Programmers in the past with a couple of ideas. (Their response has always been, “sounds interesting, write a proposal”, which has been enough to weed me out so far.)

I’ll keep you up to date with progress throughout the month, but for now I wanted to share the background to the book I’m planning to write.

The Pitch

The concept behind the book is “The Internet: How it works”. I’m aiming it squarely at software developers; in particular web developers, because that’s who I’ve been working with most often lately, but I’m sure most other species of developer will get something out of it too. The book should be direct and to the point, and it should help developers have a better understanding of how the technologies they use actually work. A broad understanding of all the parts of the tools you’re using will make you a better developer. Chances are you’re using/building on top of the Internet a hell of lot. :-)

Some of the topics I’d like to cover include:

  • How the Domain Name System works, including what happens when you look up a DNS record. From here, you’ll understand practical things like when to use a CNAME or an A record, and why propagation delays occur.
  • An overview of the full network stack, from your web browser, down through the TCP/IP stack, to the physical Ethernet layer and back up.
  • TCP/IP itself. As web developers in particular, we rely on the underlying TCP/IP protocol to provide us with a (relatively) resilient, stable, bi-directional, in-order stream of bytes from a source IP to a destination. The details are a little more complicated. From here, you’ll have an understanding of TCP vs. UDP, how TCP gives you a (relatively) reliable connection and what happens when Good Streams Go Bad.
  • Internet routing. The Internet’s a funny place. Your TCP/IP packets go out of your network card, off to your broadband router, through this fluffy cloud (the Internet is always represented as a cloud in network diagrams, sometimes bearing the phrase “here be dragons”) and magically arrives at its destination. It’s not that simple. Routing decisions are made for technical, commercial and political reasons. Here you’ll learn more about what happens to the traffic in the cloud, an overview of routing protocols and some background to the routing decisions made.
  • Email. How email works. The roles of mail transfer and mail delivery agents. How SMTP, POP and IMAP fit into the world. What Mail Exchangers are all about. Spam and spam fighting mechanisms.

That’s all I’ve got so far. Chances are it’s enough to keep me busy for the month. :-)  But I’d like to know, what are you, the software developer (my target audience) would like to learn? I’m looking to help you develop better software by better understanding the stuff you’re using under the hood. What are the concepts, protocols and tools that you use every day, but you don’t know the details of how they work?

 

Wednesday
04Nov2009

Switching to Squarespace?

If you’re reading this, I think I’ve successfully moved my Wordpress blog across to Squarespace after it was recommended by a few folks on Twitter.  If you’re not reading this, please let me know. :-) I’ll switch the RSS feed across shortly, too, so apologies if you see a bunch of (really old) repeated articles in your feed reader.

If Squarespace doesn’t work out, there’s no harm, I’ll be back to Wordpress again without any loss. But it’s worth a try. The main lossage right now seems to be that I’ll want to recode all the code examples that are kicking around and, unless I want to manually syntax highlight with HTML, I’ll have to find an external service to do it. GitHub’s gists are probably the way forward if I need an external service, right?

Meantime, if you could all kick the tyres, leave some comments and let me know the new place is working out OK for you, that would be awesome. :-)

Tuesday
27Oct2009

*tap* Is this thing still on?

So, it's been kinda quiet around here lately. My desk is as messy as ever, but the notes never seem to make it here (mostly because I made a decision back in January to make this the "Rubaidh Company Blog" which put up a barrier of sorts to posting stuff regularly).

Expect service to resume shortly. In the meantime, you can always find me as @mathie on Twitter.

Having shaken off the binds of being the official company blog, Notes from a Messy Desk is looking somewhat ... plain. I'm looking for somebody to design a new, shiny, theme (and associated Wordpress setup) that will make the most of the content here. Any volunteers? (Preferably Edinburgh-based, as I like to chat through designs and ideas face-to-face, but I'm open to trying out working remotely if you think you can make it work.)
Monday
19Jan2009

Video of "Ruby (and Rails) is Awesome"

As I mentioned at the tail end of last week, I presented Ruby and Rails is Awesome at the local Edinburgh Tech Meetup. The video of the presentation has just been uploaded to Vimeo, which you can watch right here:



Or you can see the video of Why Ruby (and Rails) is Awesome at Vimeo if you’re attempting to read this through a feed and the embedded version looked like tag soup. :-)

I need to practice my presentation skills *a lot*. Too many “errrrrrr”s and way too much time spent looking at the speaker notes on my laptop!

Friday
16Jan2009

Why Ruby (and Rails) is Awesome

I was invited to give a short introduction to Ruby on Rails at Tech Meetup in Edinburgh a couple of days ago. I'd been racking my brain for days on what to talk about -- 15 minutes is too short for me to give a meaningful introduction to Rails -- and eventually settled on telling a few stories.



The slides don't make much sense on their own, so I've included the "script" of what I talked about too. I deviated quite a bit from the script as I got into it, so hopefully I should be able to provide audio (or, dread the thought, maybe even video) of the talk in due course.

Intro



I’m Graeme. I’m the Managing Director of Rubaidh Ltd, and have been developing Ruby on Rails applications professionally for 3 years now.

Telling Stories



To be honest, I didn’t know what my audience this evening was going to be like. I wasn’t sure if you’d all be business folks in suits, or whether you’d all be hardcore geeks that know more about web development than I could ever hope to. So I didn’t want to have slides full of code showing the technical prowess of Ruby. And equally, I didn’t want a bunch of pie charts showing the return on investment you can make from choosing Ruby on Rails as your strategic development platform.

Instead I’m going to tell you a few stories. These are stories that shaped my decisions and represent some of the things that make me realise the power of Ruby on Rails. They are all true stories. They all happened to me. I may have changed the odd detail to protect the guilty parties, though.

I hope that, in imparting these stories to you all, not only will you appreciate my choice, but you will also reflect upon the choices you could make to improve your current (and future) business.

Migrations



I used to have the pleasure of working full time on an open source email response management system. It was the first open source business in Scotland to receive VC funding and was a fantastic product with huge potential. (It still is, I’m sure, but I don’t keep up with development these days.)

As is always the case, there were a few skeletons in the development cupboard. One was migration. The first prototype of the product used an object database back end. This database did not scale well. In order to meet the scalability requirements of the hosted service for the business, we shifted to a SQL-based backing store. We also made the decision to support multiple SQL databases – primarily MySQL and PostgreSQL, though there was demand in the open source community for MS SQL Server support too.

And there’s where we hit our major problem. There was no database-agnostic layer between the application and the back end database. It was a problem to maintain the slightly different SQL queries for different databases, particularly since a major part of the application was full text searching and we delegated that task to the database.

However, the biggest trouble we ran into was migration. Migrating people from the object database back end to either PostgreSQL or MySQL. Migrating people from one SQL schema to another. Or, in the case of one client, migrating from the PostgeSQL back end to a MySQL one. Our home grown solution was flawed and wound up with a number of client installations having subtly different database schemas (my fault!). So, in addition to having to cope with different database back ends, the problem had grown exponentially into having to deal with different schemas. Yeuch.

When I first looked at Ruby on Rails, one of the features that caught my eye was its built in support for database migrations. In a back end-agnostic manner, it will allow you to plot the course of a database schema through the versions of an application, gracefully (and consistently!) moving from one version to the next. This totally blew my mind after a day of dealing with a customer who’s database schema didn’t quite match my expectations...

Deployment



This is another horror story about the very same application. What can I say? It’s what eventually made me jump to Rails.

The hosted service, at this point, was spread across two servers. We had sharded the data -- free accounts on one server and paid accounts on the other. This at least meant that when the free trial server got overloaded, at least the paid accounts didn’t suffer.

Deploying a new version of the application was a manual process. We would ssh into each of the servers, stop the front end Apache server (so that nobody could mess with the application while it was in an inconsistent state), stop the application servers, update the code from the subversion repository, perform a number of other tidy-up tasks that I dread to recall, start the application servers, and finally restart the Apache servers. Deployments would take up to an hour.

One nightmare involved a number of complex database migrations because the two servers had wound up with an inconsistent schema. They needed to be made consistent because a free trial customer had just upgraded to a paid account. It took us about 2 days to sort the production platform out. Downtime was about 5 hours in total.

Shortly after that incident, I ran into Capistrano, the deployment tool of choice for Ruby on Rails applications. It gracefully allows you to manage front end web servers, application servers and database servers, running on 1 machine or spread across 20. With Capistrano, deployments are simple, fast and, mostly importantly, reversible. In some of our applications, we’re doing in the region of 10 deployments a day. This means that we are delivering production-ready features to the business users who are requesting them up to 10 times a day. Can you offer that kind of turnaround?

Of course, it’s not just Capistrano’s deployment assistance that allows us that level of efficiency, but it is a key factor.

Velocity



This last story is one from since I started working full time with Ruby on Rails, but it often reminds me why I still feel we made the correct business decision. At the tail end of 2006, the Chief Operating Officer of a start up approached me for a bit of consultancy. They had put together an awesome business plan for an online training platform which needed a large web application to be developed. The COO had done his research and decided that Ruby on Rails was the right development platform and, in particular, that Rubaidh was the right company to deliver the platform.

In order to secure the funding required for the project, the company had put together a detailed specification for the application, including cost estimates and staffing requirements. I believe those estimates showed that it would take 4 developers around 9 months to build the application.

We came in as a full time team of three developers, and we delivered working software to the business every two weeks. After 3 months, the system was complete enough to allow the editorial team to start entering the training courses. And after 5 months, we had a production-ready application which the sales team could use as a demonstration of the system’s potential.

Just to underline the point here. A project that was estimated (by an experienced software engineer and project manager) should have taken 36 person-months to deliver was, thanks to Ruby on Rails (and Agile development practices), delivered in 15 person-months.

JumpStart



With apologies to Sun for stealing their name (and to Thoughtbot for apparently stealing their idea -- we thought of it independently, honest!), what presentation would be complete without pimping our own company a little? We are offering a service to get your next project off the ground fast. We will:

* Start building your dream web application, working as an experienced in-house team, immediately.

* Help you hire, and train, your in-house team.

* Gradually step away and let your in-house team take over, when they are ready.

We’ve already done this once, and it was a major success for both us and client, so we’ve decided to turn it into a service we offer.

Scotland on Rails



Scotland on Rails Conference 2009 is running on 26th-28th March in Pollock Halls in Edinburgh. Keynote speaker, and Rails Core member, Michael Koziarski, recently described last year’s conference as “the best small conference” he’d ever attended. That’s high praise, because he attends a lot of conferences!

This year, we’re featuring keynotes from Marcel Molina Jr, long time Rails Core team member, and Michael Feathers, an early adopter of Extreme Programming and Agile development practices, who is probably best known for his book, “Working Effectively with Legacy Code.”

We also have presentations from big names in the Ruby community, like Yehuda Katz (Merb), Dave Thomas (Pragmatic Programmers), Scott Chacon (GitHub) and Jim Weirich (definitely, without a doubt, a werewolf!).

Tickets are £175 for the conference, though there’s an early bird offer of £150 available until Feb 8th.

Prior to the two day conference, Chad Fowler and Marcel are running an all day charity tutorial. All the proceeds go to the Children’s Hospice Association Scotland. It’s a £75 minimum donation, but considering these folks are both Pragmatic Studio teachers (where the courses are nearly £300/day), it’s an utter steal.

Run, don’t walk, to scotlandonrails.com to sign up.

To close, I’d like to share a story from Jim Weirich, one of our speakers at Scotland on Rails. He was talking a couple of years ago at RailsConf Europe about a financial application he and his team had developed in Java. It took a team of 4 of them about 6 months. As an experiment, they tried a spike of it in Ruby. It took them 4 evenings.

That’s not the impressive part, though. After all, since they now had a deep understanding of the problem domain, naturally they would be able to translate the solution into another language quicker than they could have written it in the first place.

The impressive part? The total number of lines of Ruby code required to implement the application was less than the number of lines of the Java version ...’s XML configuration.

I can haz questions?



So, questions?