Hacker News new | ask | show | jobs
by desmondl 2086 days ago
I understand where you're coming from, but I'm going to play devil's advocate and think through everything that needs to be considered for a simple, "back in the day" solution that involves apache, php, and a mysql database:

1. Provisioning the server, either via VPS or setting it up on your local machine and exposing port 443.

2. Installing Apache on your operating system

3. Installing a cert, getting it signed by an authority

4. Installing php, enabling it in apache

5. Installing mysql

At this point you'll have to write your php from scratch or use something like wordpress. Assuming we want to keep it as simple as possible and write php from scratch, you'll want to consider file permissions so your database credentials aren't accidentally leaked.

6. Creating the schema and tables on your database

7. Distributing your site's static content through a CDN

And this doesn't even involve automated deployments, which these services give out of the box.

My point is that a "traditional" approach can appear just as overengineered and convoluted if we want to replicate the scalability, stability and security of solid PaaS services like Vercel and Fauna.

I get that a hit counter is very simple, but I assume the point of this article is to provide a simple "hello world" example that uses these PaaS services, which again, provide a lot of benefits over manually configuring infrastructure.

1 comments

Your point is valid, but only in cases where you don’t already have everything you listed set up.

I think the OP’s comment was coming from a perspective of someone adding a hit counter to an app that already has app servers, etc, already in place.

if that's the case then the OP's comment should take into consideration the perspective of someone who already has most of the things listed in those steps setup.

In which case - as an example - you don't need to set up a serverless account and have several hundred loc for that because you've got that in your app already, and probably only need 1 loc to call what you need.

Now I'm arguing on the side of serverless, sheesh.