Date: 2024.02.21 | create | featured | fsharp | hamstack | hypermedia | moduliths | tech |
DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)
I build a lot of projects. Over the years I've iterated on my technology choices to make it easier for me to build better projects for less cost.
In this post I'll share my latest iteration of the best tech stack for building modern web apps fast and cheap - The HAM Stack.
The HAM in HAM Stack stands for Hypermedia on A Modulith:
This may seem overly simplistic and generic. Afterall, Hypermedia can be built with many different tools and a Modulith is simply an architectural pattern and thus can be built with basically any programming language.
However I think it's useful for realizing that good software (and systems) can generally be built with any technology - it's avoiding the common pitfalls that counts. This stack does that - it is specific enough to avoid common pitfalls while general enough so you can make your own choices for fulfilling it.
I was heavily inspired by HTMX's HOWL Stack (Hypermedia On Whatever you Like) - but felt it was a bit too generalized leading to common pitfalls so the HAM Stack fills in some guidance gaps.
In the rest of this post I'll dive into a bit more of the philosophy behind each layer.
The web is here to stay. It's the best way we've created to connect all of humanity and the best "build once, run anywhere" implementation to reach production and stand the test of time.
Hypermedia is the language of the web (HTML is a Hypermedia). Everything on the web can be simplified down to rendering and updating HTML. Even your favorite SPAs (React, Vue, Svelte, etc) simply abstract this Hypermedia manipulation away from you.
I have a few theories ab the future of the web:
Which leads me to believe that the web is here to stay and will only get more powerful, accessible, and easy to build on.
So Hypermedia is my choice for building frontends - it's a Simple Scalable System that gives you a ton of benefit for v small cost:
I am not too picky on how you build this Hypermedia.
Any of these will allow you to target the greatest interface humanity has ever created.
Personally I've grown to like HTMX and Alpine for building modern web apps. It's very simple with minimal overhead which allows me to build modern apps faster and cheaper - which is the whole goal. Plus it's backend agnostic which gives even more flexibility for your next choice.
Related: HTMX vs AlpineJS - Which should you use for your web app?
A Modulith is a Modular Monolith. Moduliths scale - often way more than your overpriced, underpowered, overly complex alternatives like microservices or serverless functions (nanoservices is a more apt term). Thus Moduliths are a great way to build modern apps.
Thus I'm a fan of Moduliths - they're Simple Scalable Systems for building software for most workloads.
In general I like building with a single Modulith where possible. Multiple Moduliths are okay when necessary (usually separating disparate, specialized, and intensive workloads) but this rarely happens until you've hit hyperscale and even then is often an antipattern.
My current tools of choice are:
But I'm not married to these - they're simply the best tools I've found for the job.
Overall I've been very happy and productive with the HAM Stack. It's made building fullstack apps joyful again and really shames these overcomplicated, overengineered, and underperforming systems I see so often in enterprise.
While I'll likely continue iterating on the specific technologies I implement HAM Stack with in the future, I think the core value system is here to stay as long as the web functions reasonably similarly to how it does today.
My guess: a long time.
Hopefully we can get some enterprises to take note and build some Simple Scalable Systems - it's better for the business and way more fun for us engineers.
If you want to get started with the HAM Stack, checkout CloudSeed - An F# project boilerplate that will set you up with a fullstack HAM Stack implementation in 10 minutes.
If you liked this post, you might also like:
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.