thumbnail

A 2020 Technology Stack

4 min read from development on 2020-01-07

With the new decade here, I’d like to talk about what kind of technology stack I would want to build in. For the past year or so, I’ve been playing around with a variety of frameworks for fun, akin to my childhood of Linux distro-hopping, so I think I have a decent idea of what the industry space is like and what’s available.

To be clear, I’m going to mainly focus on a stack for commercial software as a web application. So nothing overly complicated or specific, more like a social network or CRM.

But first I’d like to give my thoughts on the stack du jour. Choosing a tech stack can be subjective, so knowing my opinions on the current state of the web (as well as what I think is) can help you understand why I chose the stack I want to use.

Currently it seems like most applications use ReactJS + NextJS for the client, an Express + Apollo GraphQL server for the backend and MongoDB/Firebase/Amazon DocumentDB as a database. Normally this would be hosted on AWS and will sometimes use Serverless.

I don’t mind this stack that much be honest. React with NextJS is simple to use and a GraphQL server is a good fit for a NoSQL document database. Even though I prefer a SQL DB over NoSQL (even if it isn’t Web Scale), I would be able to easily work with this stack.

So anyway, back to what I actually want to use: Svelte + Sapper for the client, Elixir + Phoenix for the server and PostgreSQL as the database. This can all be hosted on a VPS of your choice.

Let’s start with Elixir.

I’m going to be honest, I dislike OOP. I dislike it very much. When I write in Python, I only use classes to help organise my modules. When I write in Java, I throw my PC out the window because Java sucks ass. I also dislike using JavaScript for the backend because it’s a terrible language. TypeScript is no different, it’s just JS… but with static types, that only fixes like 40% of the problems (a big amount, but not enough).

I chose Elixir because I wanted to get away from the normal web server languages like Python or Ruby. OO languages (in my opinion) become unwieldy when the project becomes big, they’re a huge mess of dependencies. Functional programming solves a lot of OOP’s problems and more!

I won’t go into too much detail here, but immutability helps immensely. Code written in a functional style is much easier to understand. If I want to know what a given piece of code does, I know that I will only have to look at that particular code, and not worry about how state in other parts of the program might affect it.

So then if I like functional programming so much, why Elixir over something like Haskell? That's because it scales well. Extremely well. Elixir is pretty much made for web applications and its scalability is scary. "The Soul of Erlang and Elixir" by Saša Jurić is an amazing talk which goes through this and introduced me to the advantages of Elixir, I highly recommend you watch it.

Next up is Svelte.

You might wonder if I’m already using Phoenix then why not use Phoenix LiveView (especially since I seem to hate JS so much)? That’s because I don’t think the ecosystem is quite there yet as well as the fact that it’s yet another thing to learn (this applies to WASM as well). Svelte is really cool in the fact that you barely have to learn anything if you already know HTML/CSS and basic JS.

It would be unfair if I had this crazy niche tech stack that I expected someone else to help me with, so I wanted something that you could get into quickly. I also weighed up React, but decided Svelte was worth it even if they knew React instead of Svelte as the learning curve is that flat.

I think choosing PostgreSQL should be self-explanatory.

And finally: hosting on a VPS instead of something like AWS (or even Heroku (which is also technically hosted on AWS)).

This one is super simple: AWS costs too much. I don’t need the majority of things AWS provides, and the ones I do need are very simple to set up myself. And with the insane scalability of Elixir, high traffic shouldn’t be too much of an issue for the infrastructure.

That’s about it from me. Hopefully I’ll get to be able to build something on this stack soon (I have some plans). But if this is the first time you’ve ever heard of any of this stuff, I recommend you check it out.