Not another cloud article

Where is the cloud?
Where is the cloud?

Are you hype averse?  Start reading at paragraph number 4.  This is paragraph number 0.

How does one write an article on "the Cloud" without sounding all buzz-wordy? Can it really be true that a technology has lived up to its hype? Well, no, of course not.  But I've been wrapping my head around cloud computing for a little while now, trying to understand what the actual benefits are.  I found some good numbers on the cost savings of cloud computing. They seem to stack up. Even if they're off by a factor of two the cost savings are still very good and the ability to ramp up production machines in a few minutes is really good. I know of several customers who have massive peaks at predictable times and so maintaining a full set up hardware to handle those couple of hours (maybe days) a year would be silly.  Even customers who have known spikes at 7:00pm that last for 78 minutes may not need to have as many machines running throughout the day.

Cloud computing can also help to enforce good standards.  Josh Holmes showed me the Azure interface last week at TEK-X and, I may be wrong about this, but it looks like it forces you to have a staging environment.  That's just plain awesome. The whole package deployment mechanism is also pretty slick (another place where there is not a strong story for PHP).

This summer I am going to be spending a fair amount of time researching the cloud and trying to find ways that can make the cloud practical for you. Simplecloud is a good start for that. But I'm not quite there yet because I don't think that we have quite touched on where the cloud benefits the PHP developer yet.

In my pondering I have tried to think of what the benefits are to the PHP developers on the ground floor. Most of the reasons that I've found when Googling "Benefits of Cloud Computing" are all the same thing.  Lower maintenance costs, it's automated, etc. blah, blah, blah. Most of the benefits are from operational costs being lowered.

However, I think that for the PHP developer there is another, greater, benefit that has not been documented.  Or perhaps it has and I've just missed it. I think that the benefit to the PHP developer is a forced change of mindset.

A PHP developer thinks in terms of request/response, request/response, request/response. Is there an application that is truly request/response? Well, yes, of course there is. In fact, many of them are. However, I have found that the application architecture that many PHP developers subscribe to is often a weak link in the chain when it comes to scaling logic. That weak link is the strong relationship between PHP applications and relational databases while packing as much logic into a request as possible. And the solution is often "Let's cache!!!"

Don't get me wrong.  I am by no means dissing the PHP-SQL relationship. And I also don't think that there is anything wrong with relational databases. However, PHP started by being an interface with an RDBMS for doing simple and that mindset is still very strong among PHP developers except that the queries are more complex (or are they more simple now?  I dunno.  Thanks Active Record :-)). And perhaps it's time to start re-examining how we build our applications as we move more and more into the critical application space.

But what does this have to do with cloud computing? When you look at the nature of the cloud it builds upon two concepts, one of which has been in use in the more "enterprise-y" languages for a while, another which has not.  The one that has not has been the concept of a document storage engine instead of an RDBMS. Most of the cloud services I have looked at have their foundational data access layer being some kind of loosely coupled or completely decoupled storage mechanism. Many organizations grissle at the thought of having de-normalized data, and understandably so.  But at the same time, how many applications truly require fully normalized data?  From the PHP perspective, that number is smaller than what is often believed, in my opinion. To PHP developers' credit, there has been interest in storage engines like MongoDB, which are also part of the picture, but people are still kicking the tires, so to speak (as they should be).

The other part that PHP developers don't often work with is that of messaging and queuing. I have talked with several Microsoft, Adobe and IBM developers and the conversation goes like this.

Me: What is it that you think PHP could do better?
Them: Static typing, threading (and other assorted bull)
Me: What about messaging/queuing?
Them: YES!!! Absolutely!

You may have noticed that I have several articles about the Zend Server Job Queue on this blog. There's a reason for that. Too many developers think along the lines of "What can I all get done in this individual request/response?" Integral to most, if not all, cloud computing environments is the integration of messaging and queuing.  This is also key to building a large scale application. Not necessarily a "high-performance" application, but an application with loads of business logic, loads of dependencies and loads of data. When people try to build complex applications in PHP they often end up calling a Services organization because they run into serious performance issues so someone can "tune" their PHP stack to make it faster (good luck with that) or finding out why it is that their application does not have acceptable response times. Messaging and queuing is key to making this problem go away and both are features that you will find in cloud stacks.

Cloud all of this be done outside of the cloud?  Sure, but my experimantation this afternoon cost Zend 25 cents. It's hard to argue against that. And since virtually all environments have cyclical traffic, having all of your servers turned on all of the time does seem like a waste. I remember working for a company where we could have cycled through 3-10 servers over the course of a day based off of load, with the option to turn on a few more if a spike occurred.  It is nearly impossible to accurately predict load; you can only "mostly guess".

That's it for now.  I will be taking the next while to examine different aspects of cloud computing and looking at the various vendors so you can start Lando coding.

Also, if you have any comments or thoughts, feel free to post them in the comments section or contact me on Twitter or something. 

Leave a Reply

Your email address will not be published.