Thursday, October 25, 2007

Browser Wars 2.0?

Tech Crunch reports that social networking site Friendster has launched a developer platform, with Myspace launching theirs last week and Facebook a few months ago.

As a web developer, I'm already getting a headache just anticipating the fun of trying to write applications for both/all of these environments:-

I can see them having 'identical' methods like "getFriends" with the same function signature.
I can see them having 'similar' methods but differing slightly due to implementation / platform specific difference.
I can see them having 'OMGZCOOL!' methods to "crazy cool methods that make us the best!!!"

Deja vue anyone?

Thursday, October 18, 2007

Dev / Staging / Production servers on a budget?

I like a 3-tier server setup for development:-

  1. Development. This box is where the programmers host their development code. They can map the dev. box file system to their local machine and edit/commit 'locally'.

    If you run mod_vhost_alias you have have paths like /code/richard/projects/project_name/www map to a virtualhost (eg richard.projectname.rjharrison.org) dynamically. Devs create a new project folder, do a subversion checkout and they're off. You can also run trunk/branch/tag virtual hosts.

  2. Staging. This is the "almost live" environment, where you can perform QA and show off the build/release to the client. No one edits on this box and the only way to get code there is by doing an export / build directly from the svn repository.

    Making the build automatic is pretty cool - press a button and you've got a built project on the staging machine; press another and you've deleted it and built a different revision.

  3. Production. This is the live box/es. Again, no one should edit code on this machine. Getting code onto this machine could either be using the same process as Staging, or it could be an rsync from the staging box itself.
The problem of course, is that this is 3 servers. Doing this sort of stuff really requires root access to let you install, configure and tweak as much as you like.

I want my environment to be available online so I don't want them "in my office"; I don't much fancy buying 3 machines and paying for colocation; nor do I want to rent 3x dedicated servers. The solution? Virtual Private Servers (VPS). These are virtual machines hosted on some beefy server, kinda like "shared hosting", but you have virtual machines rather than just a virtual host.

I've just had 3 VPSes setup by Rimu Hosting and can't wait to start getting everything setup "just right".

This means my "live" environment will be a crappy virtual machine (not much memory/cpu, but it should be enough); however it needn't be - I could use 2 VPSes for development and staging (cheap) and then a monster front-end server for live (or load-balanced farm); the beauty of this setup is that my cheap staging server can run exactly the same environment as the "beefy live server", just without the cost as it's on a tiny VPS.

What a difference a year makes.

About 18 months ago a business I started flopped and I had to get myself a "proper job". Since then I've been living the 9-5 dream! Including a stint in London gaining first-hand experience of the joys of rush-hour commuting, gray buildings that block out the sun and a dirty, smoggy city.

It's not all been bad though: I've met and worked with some great people and gained experience within some new contexts. I also took the opportunity to geek it up with PHP London and enjoyed having techie events happening on my doorstep (well, atleast within a 1hr tube ride from my doorstep).

I also learned a little bit more about what motivates me and what I want out of life / what I want to spend my time doing. Of the two jobs I had, neither matched my previous ideal job spec (although some elements were present); but more importantly I think I've identified new things that I look for and value within my work life:-

1) Flexibility over my working day: how, when, where and what I do.
- I really don't enjoy being shackled to a desk between 9 and 5, every weekday.

2) Working towards an outcome that directly benefits me (both now and in the future).
- I'm more motivated to work if it's earning me more money, helping build up a relationship or investing in my future.

4) Screw PHP4. With a big stick.
- Working with globals, tons of files with random functions and all together crappy code does my head in. Give me a nice dev. environment/process and PHP5 any day of the week.

4) Money is great, but it's what you do with it and your time that really matters (along a Tim Ferris vibe).
- Freelance/contract rates being what they are (higher than permanent salary) means one might be able to earn twice as much money... or alternatively the same amount of money but working half the time. I like the idea of 3 months work, 3 months on a beach/skiing/coding my own thing/enjoying myself.

So, about a month ago I quit my job (working for Entrypoint / iBuildings, representing Zend UK) in order to explore new opportunities with both work and in life generally. The decision to leave was difficult and at times I was swinging each way on a daily basis: representing Zend is pretty high up the scale of cool PHP jobs and the people I worked with were great; but if you're not happy with what you're doing, what's the value in a "cool job"?

In the end, not having the freedom over when and where I worked coupled with living in London (which I didn't really enjoy) lead my to saying goodbye to London, and hello to being my own boss again. It's scary, particularly with my empirical knowledge of "when it all goes wrong", but I'm also very optimistic and happy to be where I am.

So what's next? Good question.

I've been working a short-term contract in the West Country which is serving to be a nice introduction to going freelance, but also a reminder that "Contracting" isn't what I want to be doing.

The plan at the moment is to pimp myself out as a developer/consultant and look to take on project-based work and see where I go from there.

I do have some longer-term plans and ideas, like whether being a "roaming freelancer" can be turned into a scalable process/model, but I need to give it all a bit more thought; perhaps when I'm watching over my rods, as I enjoy a quiet mid-week fishing trip :-).