Quantcast
Channel: Gen X Design | Ian Selby » PHP
Viewing all articles
Browse latest Browse all 10

More On Cloud Computing For PHP Developers

$
0
0

A while back, I wrote an article on the importance of cloud computing. A few people posted some good comments and feedback, but last night I got such a long and well thought out comment that I thought it deserved it’s own post. So, without further adieu, here are the thoughts of Daniel Kadosh.

Sharing my experience with a PHP app on EC2, which receives thousands of XMLs daily, parses them into a database, and has a web GUI to produce reports and graphs.

If you have a simple website, why go Cloud?

If you have a single-server setup and don’t want/need all the scalability you should at least price out a cloud provider. To me, having FULL backups being a no-brainer (Amazon can take filesystem snapshots in under 3 seconds), and being able launch a new server — in case the current one dies — within 3-15 minutes (my experience) are the biggest benefits. How long would that take with a dedicated hosting provider while your customer(s) are yelling at you on the phone? And restoring a dump, tar, rsync or mysql dump once your new server is up?

There are 2 key tools I use to manage my servers on Amazon.
ElasticFox:
You’ll want the ElasticFox plugin for Firefox to help you see and control stuff on Amazon, as it’s a bit better than the AWS GUI — for most things. Also overlaps in basic functionality with RightScale (below), but is more real-time.
RightScale:
To help with ALL sysadmin stuff, you can get and use for production a free “developer” account with RightScale, which puts together Linux images and has all sorts of startup scripts for common LAMP setups, great wikis, the works. It’s 3/4 of the way between “install Linux yourself” and cPanel-based shared hosting systems. They support Amazon, GoGrid and I think Rackspace too.

Why Amazon?

In my research, Amazon still remains, BY FAR, the most advanced (in features) IaaS cloud provider. Couple it with RightScale and you get pretty much all the automation you need, including logging, alerts, auto-scaling (spin-up or down servers based on load), etc. Amazon keeps on adding features, seemingly on a monthly basis, and they very much listen to what customers want. They recently added “huge” servers with up to 64GB of RAM and 8 CPUs, and the ability to hold your root partition on non-volatile storage (used to be that once you shut down your machine, you lost the contents of root — not a big deal to work around anyways, since my data is on persistent EBS disk volumes).

One of my requirements was to be able to host things in Europe, to address EU privacy legal issues — “EU data must be hosted in the EU” — so Amazon is one of the few (only?) cloud providers that has a datacenter there.
I was also concerned about disaster recovery, and Amazon seems to have more geographically-disperse datacenters than others. Couple that with their S3 storage redundancy and available from anywhere, and you’re covered.

Re-think your architecture in a cloud:

Just from scaling purposes, you need your applications to be able to recover/redirect things appropriately when adding or removing a database or web server from your deployments. The same can be said to address high-availability or disaster recovery. I had to re-think many assumptions about a given server being up, or even at the same IP address, so can’t hard-code these things. There are “always available” services that a cloud provider gives you to store these settings — Amazon has SimpleDB, or their storage service S3, both of which are highly redundant & available.

Scale horizontally (add more servers), not vertically (add more RAM/CPU) is the key mantra in cloud computing. It’s a different mindset to have in architecting your application. You can, and sometimes should, take it to the extreme of making each server do just 1 thing, particularly if you have to process a lot of data. The typical example of this is a website that allows users to upload video, which has to be down-scaled and put into a database or better yet into the cloud storage service (like Amazon S3). So you’d have a queue system (see Amazon SQS for a solution) that has your front-end web server put the raw video in the queue, sends a message to the processing server, which all it ever does is “check queue, process item if found, repeat”.

Yes, there are some quirks to work around in cloud providers, but they’re worth it for me if nothing else for peace of mind. I wish I could have >1 IP address per server on Amazon.

About the Author
As I said, this post is actually a comment contributed by Daniel Kadosh. Daniel works for Affinegy, Inc., a software company in Austin, TX
http://www.affinegy.com

What are your thoughts? If you’ve got an opinion, share it, and I may even give it the same attention I did for Daniel :)


Viewing all articles
Browse latest Browse all 10

Trending Articles