Thursday, October 16, 2008
301: Moved permanently
We're now hosted completely on AWS, though we're not yet serving our page images directly from S3. Instead, our old hosting config is replicated almost byte-for-byte on EC2 and EBS (the elastic block store which enables storage to persist between virtual machine restarts).
In the long term there's definitely an argument to be made for moving all the page images onto S3, particularly when Amazon launches its Content Delivery Network on top of S3 later in the year. In the short term it's better to move one step at a time - doing it this way means we don't have to revise our import, logging, mail and hosting systems all at once. The mechanism are in place to migrate content over once we're ready.
So far (crossing all possible fingers) the new hosting is working fine. It's substantially cheaper than our previous arrangement and much more flexible. I've already upgraded the database machine, which involved
- Starting a new machine instance
- Shutting down the db
- Disconnecting the drive from the previous instance
- Connecting the drive to the new instance
- Restarting the db
- Telling the web servers to talk to the new machine
- Terminating the original machine
All in all, 3 minutes' work and all done from the command line - no raising tickets or paying for unused hardware (running instances are billed by the hour). Awesome.
Also very cool are elastic IPs, which enable you to re-map your public IPs between running instances. This enables you to repeat the trick above with a web server. Will be trying that later in the month.
We're now running scheduled "snapshots" of our EBS drives. Every two hours the whole thing gets backed up to S3 - it only stores the deltas so the storage cost is low, and you can create a new EBS volume from any snapshot. Of course, all the snapshots are still within AWS so we still need an external backup.
NB: title is a geek joke. Our URLs haven't changed at all; they're just answered by different machines.
T