Leaving PHP is too expensive

(This is an old blog post I wrote which got pretty popular, so I'm reposting it as I have revived my blog. I am doing primarily ASP.NET stuff today.)

 

Preface

I am a person whose first experiments with programming was with php, I have worked for several companies that have had php as one of the main languages. However, I am not blind to the fact that there exist other languages and php is not my main language today.

I consider myself as a happy person who does not care that much about language design compared with making money and getting stuff done as quickly and painlessly as possible. I recently left my last day job where php was the main thing and my current role is as a frontend developer.

I recently read the complete blogpost of Eevee, PHP: The fractal of bad design which is old but still so painfully true I can't ignore it anymore. But, I have met some obstacles and this is my story on why I have a hard time to leave php behind me.

The economics of spare time projects

I am free. I no longer have to write a single line of php if I don't want to. I no longer work with backend development and unless something drastically changes with browsers, I won't have to for the forseeable future.

However, I do have a bunch of projects on my spare time I want to build and contribute to. I have more than one project. In fact, I am trying to make a bunch of smallish websites to get some sweet passive income (that's my goal however) and I launched my first unnamed website yesterday.

Since this is a project I am paying for myself and I do need a bunch of sites, there is some alternatives that fall away directly, unfortunately. Below I will go through some of them and why I beieve those hosting providers won't work for me or people in my situation.

Heroku

If I could afford it, I would host all of my applications on Heroku. Heroku, from the taste I have of it, is amazing. No hassle hosting or configuration of your own environment. Language agnostic, etc.

The problem with Heroku is their pricing model and while $7 doesn't look like a lot it rockets when you have several projects. Just having 10 applications make the cost go up to $70 which is already too much to put down each month for something that might as well not pan out to anything.

The cost above is not even considering utilizing a database, that's an extra $9 for each 10 million rows. If a project would gain any serious traffic, that would increase the cost for the application as well. Soon we're for sure over $100 each month.

Amazon web services

While AWS pricing seems to be more cheap, I have always felt that it is such an increased complexity on many fronts, both configuration and cost, that it's not really worth the hassle for hosting small sites that has only hundreds visitors each month.

I can't claim I have a lot of experience of setting up AWS, but everything around it just feels and smells like enterprise, with complex applications which I am convinced are the customers they care about.

Maybe it could be worth learning how to host efficiently on AWS, but how simple is it to setup git push deploy? Do I need external services in order to setup that? Can the same instance be ran for many applications? How does the pricing model work? Even reading on their pricing page linked above, I do not understand what part that would be relevant to me. I feel like I have many unanswered questions visiting their website.

Microsoft Azure

At first glance, Azure seems like the savior and while I will most likely be using it for larger projects I have one single issue with them, and it's spelled Google and HTTPS.

 old azure pricing

 
The Azure pricing mode(from my portal, sorry for the Swedish), it is much more sane. If you pick standard, I've read somewhere that you can host up to 50 apps. I would pick standard, which is approx. 580kr each month and that translates to about $70. While that is still expensive, it is nice since I'd recieve all the nice features that I like from Heroku. Sure, it is a tiny bit more complex and the pricing model tends to change somewhat often but it is still good.

The problem is that 5 SNI feature the pricing model say about the standard plan. What it means, from my understanding, is that only 5 sites would get that sweet SSL support. Since Google is basically punishing everyone without a SSL cert and Let's encrypt made it possible to encrypt every site just having SSL on 5 of my sites is not good enough. Note that this is simply my understanding and I find the explanations a bit sparse so I might be wrong. In fact, I hope I am wrong and if I am, please tell me so in the comment section below!

GleSYS, Digital Ocean, Linode, own server etc.

The only real alternative to these prices is to rent a VPS from a service provider like these above. The positve thing about GleSYS for example is that Swedish hosting is available which means lower latency and the data is at no risk to go through American government. I can store user data with confidence.

The pricing is also incredible cheap compared to managed services but at a big cost, you will have to configure and setup everything yourself which is a lot of work and the biggest reason why I wish to choose a manged service. When I am at work, if one of my services would go down, I wouldn't have the time to fix that until I got home which could be up to 8 hours.

The PHP community provide the solution

While Eevee complains about php the language lacking unique features, the community has come up with the most brilliant hosting solution I have ever tried. It just also happens to be the cheapest one I have ever tried.

That solution is Laravel Forge.

If you do not immediately get it by visiting that link, let me explain it to you. Laravel Forge is a service that for $10 a month they will provision unlimited production ready php servers (install, setup and configure) and you can control it all from a web interface. What's more amazing is that I can target ANY VPS provider even if it's easiest with AWS or Digital Ocean. It will help you scale the servers, setup cronjobs, edit environment configurations, enable git push deploy etc etc.

Laravel Forge is a service that gives me all the nice features of Azure or Heroku for an unlimited number of apps (as long as the VPS can handle it). Laravel Forge is not limited to the Laravel framework, any php application works.

To mimic Eevee, if this list doesn't improve your opinion on the php community, nothing will. But on a more serious note, how could anyone with this knowlegde be able to leave this awesome service?

Profit is what counts

I think my story is incredible common. I think I am not alone. There must millions of small business owners world wide that need hosting of their applications. Or people with private projects that just happens to be websites.

A $10 server from Linode together with a $10 cost of Laravel Forge quickly quickly gets cheaper than any alternative when the assumptions are that you don't want to do the ops work of getting the server up and running, installing certs etc.

I have researched the internet for answers and the only compelling alternative is to use some kind of CI-service like Codeship. While that service for sure is nice, it's not unlimited and as soon as you have more than 5 projects (I plan to) the cost immediately grows to $49. While Codeship may provide automated testing and git push deploy it does NOT provide server provisioning and you will still have to setup a webserver, database and configure it.

Maybe there are better alternatives to Laravel Forge out there for other languages, maybe there is not. But my conclusion is that for me and for many others it is too expensive to leave php. Even if I could afford to, it wouldn't make sense.

To quote Eevee once last time

No wonder PHP is so popular