tscs37's Blog

The Case for the Boring Software Stack

Before we dive deeper into the topic, it should first be established what a boring software stack is.

It’s rather simple and you probably heard the setup before;

  • Linux as Server OS
  • Apache as Webserver
  • PHP as Backend
  • MySQL as Database

Now that this has been expressed, many modern developers will probably grab the pitchforks for one reason or another. However, before the author of this article is horribly lynched, I shall elaborate. Of course it’s not going to be only Apache. Using Nginx for static files and as a proxy to Apache has been proven rather effective as a Webserver Setup.

PHP itself is not the devil anymore, however, it’s still not all sunshine and rainbows, many complaints can be made and personally I still dislike the heavy reliance on dynamic types, though typehinting has largely fixed this.

MySQL should be replaced by either MariaDB or PostgreSQL, prefering the later. I’m personally convinced that Postgres is never a bad choice for a project. On the other hand, MariaDB is easier to get started with, so if you need to hit the ground running, you should pick that. But the overall point should be clear; use a generic SQL solution and apply JOIN until satisfied.

For the frontend some additional stack software needs to be brought in;

  • CSS
  • HTML5
  • JQuery

CSS is the language for writing websites. However, it’s painpoints are probably obvious and if you don’t like those I do recommend using a preprocessor. My personal project JMMASW can deal with generating inline CSS in a HTML file, so you can resort to templating the CSS. Alternatively and for more “I want actual proven tech” oriented developers there are alternatives like Sass and Less

HTML5 should be obvious, it enables a lot of stuff that was beforehand only doable in Flash or heavy JS out of the box. It should also be noted that any website you design should not 100% rely on Javascript and CSS. A good website can degrade well under a highly secured script blocker and works with text-only browser and reading aids. It is important to make your website accessible to everyone.

JQuery will definitely earn me some pitchfork-stabs. It’s largely bloated library of basically everything you’d ever want to show off in a demo. If you don’t like JQuery that much, you can use more lightweight alternatives, one of which is zepto.js, which has been recommended to me but I’ve yet to try out. Lastly, you can always use vanilla javascript. Hackernews is an excellent example of how to write a JS-light website.

The overall aim of your frontend website should be in degradable user experience and reduction in size. A good website, in my opinion, weighs in with less than 500 kilobytes of auxilary data like images, stylesheets or scripts.

Why would anyone use this?

Now to get to the core of the article; why do this? After all, no self-respecting hypster startup would ever even consider just typing the appropriate yum or apt into the console of a server.

The answer lies in the stack itself. For a while the traditional LAMP stack has been the most popular way of hosting any kind of webapp and I personally see little reason to discontinue it. Of course it’s not perfect anymore but the problems with the traditional stack can be largely fixed by focusing on light-weight or proven technology where possible.

Now, LAMP is probably still one of the more popular ways to write webapps in these days, however alternative stacks are gaining momentum. But if you find yourself asking “Should I write this in Node.js/Go/Python/Brainfuck?” then you should ask yourself “Would a PHP server work too?”

It is not the best stack nor the most efficient, it reminds me more of a 80s car than a modern 2010s family car. PHP isn’t shiny or new, it’s old and beaten but works. MySQL is probably one of the most widely known SQL dialect outside Oracle Contracts.

Writing on a LAMP stack may be considered nostalgia by some, pragmatism by others and pure insanity by the rest but I think it’s a totally worthwhile task, no tool should be left unconsidered just because you’ve got a more shiny one.

Except Node.js, it’s nasty.

In Other News

I’ll try out a new publishing method, my blogposts was online two days in advance on my patreon.

Other posts will follow a similar schedule, going online earlier on my patreon, then launching a bit delayed on the blog.

If you like what I do, consider chipping in with a dollar or two.