The Cheapest Software
Developers are cheap. Notoriously cheap. We always seek the cheapest option for any hobbyist project, whilst at the same time demanding Visual Studio and MATLAB licenses at work. That's not a matter of greed, it's simply capitalism at work. Nothing new under the sun.
But noting this fact about cheapness, someone should make a complete guide to the architectural jungle of web-hosting. And it's not gonna be this post, I'm far too lazy to make something comprehensive. This whole post is an 100% anecdotal rant that would neither hold in court nor a heated argument on the streets of stackoverflow.
::::::::::::::::::::::::::::::::::::::
Personally, I've only used GCP (Google Cloud Platform) so far, with confusing terms for being free and total crapshit documentation, so I'm probably jumping ship soon to AWS EC2 for some year, then starting up another throwaway mail to keep the free trials going.
Below follows a non-comprehensive guide to the cheapest options in software development. Go to the list item that fits best to you.
-
I'm developing a stateful, collaborative web app (multiplayer game)
- If you are gathering email-addresses or other GDPR things, use some cloud hosting with AJAX. Something like this:
axios.post('/update', { email: email, psw: psw, }).then((data) => { console.log(data) })
- If your data has no secretary (and don't mind getting hacked some day by a F12-inspect-element kool-kid), use Google Firebase with some client-side Javascript for managing global state. Something like:
<script src="https://www.gstatic.com/firebasejs/7.14.2/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/7.14.2/firebase-database.js"></script> <script> // Your web app's Firebase configuration var firebaseConfig = { //config provided by google } firebase.initializeApp(firebaseConfig); var db = firebase.database() //read game_state db.ref('game_state').on('value', s => { console.log(s) }) //write game_state db.ref('game_state').set('some_value')
-
I'm developing a stateful, non-collaborative web app (single player game)
- Use localstorage to store a single users state, and host the static files on Github Pages.
-
I'm using no javascript at all
- Simply host everything on Github Pages
Github Pages§
free and easy
This is the pinnacle of simplicity/uptime/cost. Just enable github pages in the settings for some repository, and your static files will be hosted. I've experienced absolutely no downtime with GH. They are simply perfect, even if they're owned by the evil Microsoft thesedays.
Google Firebase§
free and easy
Google Firebase is to be used in tandem with github pages. The combo makes it a very low-maintenance and stable configuration. No downtime. Just use this configuration:
{
"rules": {
".read": true,
".write": true
}
}
As you can clearly see, I have no regard for security or ipsec for my (hobby) projects.
Cloud Hosting§
hard to get for free and maintainance is a pain in the ass
If you need data secretary or use some program that is not written in javascript, you'll need some type of cloud hosting. This is a shithole where you throw in hours and get little back. You'll spend endless hours troubleshooting HTTPS with Certbot and nginx configurations. It's also hard to leech a free server without checking it every second week.
I have many things running on a GCP Machine running some Ubuntu on the smallest "always free"-tier f1-micro. Every once in a while, it goes down. Guess what Google does? Not a shit. They send exactly 0 emails telling me something is wrong. Even Cloudflare, not even responsible for the health of my systems, is able to detect the downtimes sometimes. This answer on serverfault simply states that resetting the VM solves this problem. That's what I do once a week on my GCP server too. And I'm getting pretty tired of sitting on-call doing that. Resetting the VM requires you to go into the Cloud Console. Here, I'm greeted by the amazing message:
ew. No please, capitalist-swine Google. I want to keep muh free server free. I guess they have to do this "mystical server shutdown" to push people towards higher priced tiers. Otherwise people would stick with f1-micro and forget about it. My historical CPU utilization graph had topped out at 40% before the shutdown, so I really don't see the problem here.
My warmest recommendation is to not put anything critical on a free GCP server. I'm considering Amazon, but their 1 year plan is offputting.
Self Hosting§
If you have too many hours on your hand, then be my guest and show off your Raspberry Pi cluster that does pihole, minecraft server and filesharing. Please, let me see it. (not)
Now, it seems relatively cheap to self host, (around 1.44kWh per month = $0.25) but that gain quickly diminishes in the light of the burden of having blinking LEDs in your wardrobe and having to never unplug anything network related in your home. Suddenly, you have a device that always needs to be connected.
Sure, you can live with it some year, but some day you'll move, grow up, get kids, switch ISP. Do you really want to tie your semi-important things to a device that some toddler can unplug easily? I'd rather sleep well in the nights, but we're all different. Just leave hosting to companies that have dudes checking on the machines 24/7 to ensure 99.99999% uptime.
Conclusion§
The cheapest and by far most reliable option is not utilizing server things and just use static html for your project, doing as much as possible client-side. I'd imagine that webassembly will take binary
If you need server things, either bite the bullet and pay $5 a month on Digital Ocean or check on your $0 GCP server every two weeks. Don't self host. The only people that needs to self host are alt-people that have questionable agendas, or have some kind of problem with big companies. This dude on ycombinator said it better than I possibly can:
If only Google were my 10th biggest problem. Try to get Exxon, Shell, et al out of your life who aren't violating abstract principles but are literally killing the planet. Then let me get unethically farmed or raised foods out of my life (which, thanks to the US preoccupation with corn and the nitrogen it requires, are frequently overlapping with petroleum). Then let me get Oracle and Microsoft out of my life. Then let me get the Murdoch empire out of my life. Then let me get Facebook out of my life. Then let me buy a consumer good that isn't designed for obsolescence. Then let me get intermediate middlemen in the healthcare system in the US out of my life. Then I'll take an eye at Google.