Live data from Hacker News

Four ways to build web apps

tomhummel.com

21–30 of 181 posts

Re: Four ways to build web apps

#22
post #18

Why not PHP on a shared or dedicated hosted server?

I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language.

Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok.

But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stops support for older versions. You need some sort of protection layer that shields you from all of this. So you might end up with something that is way more complex and slow than it needs to be.

Re: Four ways to build web apps

#23
post #15

Earlier quoted context omitted.

> I mean honestly “HUGO static sites”…how about a directory of html files hosted by nginx or Apache? Whether you put HTML files on the mentioned services or have a build step with a static site generator is not the point. Where does your nginx server run, how do you keep it up and running, how you do provision it, how do your files end up on the server? You can write a bunch of shell scripts and do all of this on a c…

Free, for now. Once the higher interest rate environment becomes more normalized, I would not be surprised to see many services become paid.

They may cut the extent of a free offering, but I suppose they won't drop it. An ability to make a quick proof of concept, to just try something and play with it, is very important for bringing in paying customers. People tend to buy with more confidence things they already know and comfortable with. People tend to pay for things that are widely known, with tons of examples and explanations online; free services generate much more of these.

Re: Four ways to build web apps

#24

So sad. So the choice is closed source platform lock-in, a single Linux server with SQLite as database, or kubernetes? -an old man yelling at the cloud.

Not sure why the author insists on "exactly one" server. You can easily also host a SQL server in the same datacenter (or even run a SQL server on the same server!). This was how most web apps were built before the other options existed.

It is trendy nowadays to just use SQLite for a single server claiming speed advantages, but there are disadvantages as well. In my last startup, our SQL server was not directly connected to the Internet, isolating it from potential hackers.

Re: Four ways to build web apps

#25

Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…

I read it differently. It looks like a good outline of 4 basic approaches to building and hosting web sites. I would word them as:

1. Stateless static site. There is a variety of ways to build it (such as React or Svelte or purely by hand) and a variety of ways to host it (such as a directory of HTML files hosted by nginx).

2. Function services like Cloudflare workers, AWS Lambda, Google Cloud Functions, Azure Functions, etc. This is a way to store state without having to manage servers.

3. Single conventional Linux server.

4. Distributed containers.

All web developers should familiarize themselves with these 4 basic approaches and prefer them in approximately the order given. It's good to avoid jumping to distributed containers if you can get away with functions, a single Linux server, or even static HTML. It's also important to move down the list as the app grows rather than reinvent K8s.

Re: Four ways to build web apps

#27
post #22
post #18

Why not PHP on a shared or dedicated hosted server?

I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stop…

> Plus it's a language that breaks backwards compatibility way too often

Do you have examples of such compatibility breakages?

I noticed Nextcloud and WordPress both seem to lag behind the last version of PHP a bit. But on the other hand I also see such thing in the Java World where people are stuck on Java 8 or 11, when backward compatibility is one of the strength of the language.

I also have PHP scripts I wrote for PHP 5.1 and still work unchanged on PHP 8.2, 12 years later. Well, I had to fix some warnings for completely dumb things I did like putting mandatory arguments after optional arguments and I'm not sure why it was working, but the upgrades have been painless for me.

Plus, I find the latest PHP version quite pleasant, with the type annotation and other new features of the language, and the execution model where your app doesn't run all the time, its php files are just called by the web server (though php-fpm). No Tomcat or uWSI or unicorn and virtualenvs to manage.

But I guess I'm a person who is "already invested/emerged in the language" :-)

(I'm also invested in Python, Java and Node.js though)

Re: Four ways to build web apps

#28

Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…

I agree with you here. I find that certain kinds of "hosted" services have their own home grown techno-babble and they rely on the ignorance of their potential customers to lure someone in. They sound like they are hiding some insanity level complexity made easy for consumption... but really all one needs is to run a single linux instance + nginx + some files.

Scale up from there as required.

Re: Four ways to build web apps

#29

I could do this, or I could just throw good old React or a derivative framework at whatever UI I have to build and be done with it.

> and be done with it

That's how I feel when I write a bunch of HTML and CSS files and send this to prod.

Less so with an app written with a JS framework of which I now need to maintain the dependencies.

Post reply on HN