Hosting an infinite number of apps in the cloud for free, on your own domains.
Longer title: Building and hosting an infinite number of scalable secure web apps on custom domains, with no vendor lock, only using skills I already have, for free.
Sometimes I talk myself into the seemingly impossible. While writing a stubborn paragraph of my book (Your First Product... go sign up!), I wanted to know just how cheaply I could host a custom web app in the infamous cloud.
For example, could I do it for free?
Cheap is good, cheap is wonderful, but FREE is magical. If you can host apps for free, then you can host as many apps as you dream up. Whoosh! Bing! Blam! Another thought? Another app!
Once I'd realized what I was attempting to achieve, I put it in tweet form as this:
How to create scalable secure web apps, cheaply, with no vendor lock in, only using skills I know.— Leon Bambrick (@secretGeek) March 5, 2016
And promptly gave up on the idea, as it was clearly BONKERS. Or at least I tried to give up on it. My mind kept turning the idea over... there must be a way to have it hosted for zero dollars, without vendor lock in.
Sometimes if you set up a system with a lot of constraints, you see that it's impossible. And you then need to work out which constraint to relax. (This is called "engineering")
So I did what any true engineer does, I used a spreadsheet. I put all the constraints in their own column, and listed different solutions on each row, then checked which constraints they broke.
Anything involving Azure cost too much, and was too likely to lead to vendor lock in. Heroku had a lot going for it, but relied on technology I don't use. GitHubPages had a lot of advantages -- but don't permit any kind of server-side code. At the same moment as I started looking into 'Parse' I heard that it had been shutdown.
Finally I stumbled on an architecture that suited my needs. It was a hybrid, like that mythical beast with the head of a lion and the belly of a zebra, or however those old myths used to run. They were pretty popular back in the day.
Here's what I came up with.
That's right. As befits a zero-dollar architecture diagram, I have resorted to the use of Comic Sans.
http://guessaguid.apphb.com/ but that's okay: this is just a back-end which the customer never need see.
AppHarbor is a great way to host the back-end of a site, because I can deploy to it from the commandline, by just pushing to a repository. I don't want the backend code to be public, so I need a private repository. Private repositories at github cost money. For one low monthly price you get unlimited private repositories... but that's not good enough for my constraints, nuh uh. Fortunately, bitbucket gives you unlimited private repositories for a single user, and appharbor integrates just as nicely with bitbucket as they do with github.
So there we have it. GitHubPages front end, appharbor+bitbucket back end. A way to host an unlimited number of small applications, on custom domains, in the cloud, without learning any new tech or getting slugged with fees from anyone.
(One thing I didn't solve was the 'secure' part. I wanted to have the whole thing encrypted end to end, using the mystical glory of Let's Encrypt, a new certificate authority who are ushering in a golden age of https everywhere. The most commonly suggested way to do this is to use cloudflare with a custom domain in front of github pages, though there's also a kloudsec solution. I haven't tried either, so can add nothing of value on the topic. The 'free tier' of AppHarbor includes 'piggyback SSL' which I think might be sufficient for this example.)
And here's the app:
Guess A Guid ← Can you guess a GUID? Try it and see for yourself!Next → ← Previous
My book "Choose Your First Product" is available now.
It gives you 4 easy steps to find and validate a humble product idea.