An analogy with Bangkok infrastructure

So I’m in Thailand as part of a parental leave with the family, and the first photo I took was a screenshot of the speed test I did on my phone.

A speedtest in Thailand from a taxi that shows that 5G is as fast as it gets.

5G is everywhere here, and it’s fast, a stark difference from Canada, where 5G is still in its infancy and only available in a few cities. It’s even worse in the USA, which is even more spotty and expensive.

But then you see electricity poles on the side of the street that look like this:

Electricity pole with ton of fiber wires on it even touching ground.

It’s ugly and dangerous, with wires hanging from the top of the pole. It will probably be hard to monitor and repair, but it works and works great from what I’m experiencing right now.

It’s a good analogy for how we build software. We spend much time perfecting things, but it’s always better to ship to clients quickly and iterate on it later. Unfortunately, I’ve seen time and time again individuals, startups and larger companies thinking about the perfect solution, architecture and infrastructure with fictive performance figures that make no sense before shipping anything. It’s a waste of time and money.

Tristan Hume has a great article showing us that the entirety of Twitter could run on a single server. Servers can now have hundreds of cores and terabytes of RAM, with 100Gbps network connections. You can do a lot with a single server before considering distributed infrastructure.

But Carl, why not go serverless? Well, yes, serverless can be deployed quickly. Still, you have another class of problems arising, such as cold start, much harder development, debugging and monitoring on top of problematic cost management. I’ve seen companies going serverless and returning to a more traditional infrastructure a couple of months into a new project because of the issues they were facing.

I’m a big fan of Cloudflare Workers since it eliminates the cold start problem AWS and others have, but I see it as an add-on rather than a replacement for traditional infrastructure. After the free tier, you can spend thousands of dollars monthly on serverless functions to have the same throughput as a single 10$ server.

So what’s the solution? Don’t think about it and start using the Just Ship It Stack™️, aka the simplest and quickest way to ship apps into production. A single executable running on a single server with a single database. It’s not perfect, but it works and will get you to production quickly. Later on, you can iterate on it and add more servers, databases, workers, etc., when needed. You can also put a CDN in front or use serverless functions to do specific tasks.

For me specifically, when building a new project, the stack I will use is an inspiration from a talk from David Crawshaw:

If Needed:

A Github template will be available soon and will be linked here.

Carl St-LaurentByCarl St-Laurent