2 min read

Why am I obsessed with server frameworks?

There's something that bugs me about the current generation of server development frameworks. There's something about the rote "router that feeds into middleware and a handler" that feels in need of a shakeup.

One of the first things I built in the early days of Suborbital was Vektor, my idea of an ideal Go server framework, with the intention of standardising all of our services into one format. This worked until a point, but we've recently decided to strip back our use of Vektor as the burden of maintaining the framework does not outweigh the upside.

Despite that, I can't help but feel that server frameworks are in need of a step-change, and the main reason for that is the recent popularization of The Edge™️.

I personally define 'The Edge™️' in two parts: Edge Cloud is a network of servers that are geographically positioned to be physically close to end-users, organized in an anycast configuration to allow cloud computing with low latency. Edge Devices are the 'smart' or 'IoT' devices that can perform compute on-site, such as a moisture sensor in a basement or a smart security camera. I generally am referring only to Edge Cloud.

Today's server frameworks are not built to handle the full scope of cloud computing, specifically meaning they don't handle spanning edge and central cloud intelligently. Frameworks like Fresh and Hono can be considered Edge native in that they're built around the constraints of a CloudFlare Workers / Deno Deploy type environment, and people seem to be enjoying using them.

When it comes to the average SaaS application however, existing only at The Edge™️ is rarely feasible. The need for an unconstrained compute environment will arise in applications that need more than just a cache and 'serverless database connection'. Performance requirements, the need for scalable async job processing, and a low-latency connection to a database become needed for anything that grows beyond the basic CRUD application.

This is not to say that I don't believe The Edge™️ is an excellent addition to the cloud computing toolkit. I believe it's a needed optimization, and the existence of true global-scale programmable networks is something I've been talking about for a while. I simply believe that the current generation of server frameworks are not built to take advantage of it.

We need new developer tooling that allows us to build applications that are not just Edge native, we need a something that is "Edge integrated". By this I mean we need to be able to build an application that equally utilizes Edge Cloud and traditional cloud. We should be able to deploy a single codebase that invisibly takes advantage of what The Edge™️ has to offer, and blends it with the scale and capabilities of central cloud.

Such a framework would be super edge-y 😎

If we look at the lifecycle of an API request, an Edge integrated framework should be able to automatically run authentication and caching logic at The Edge™️, intelligently route the request to a central compute cluster, perform business logic where it belongs (next to a low-latency database connection), and then seamlessly route it back out through The Edge™️, without the developer needing to manually orchestrate (or even think about) how any of that happens.

Getting the tangible benifits of phyisical latency reduction and lightweight computing environments mixed with the full-power capabilities of large centralized data centers while keeping developer productivity high and mental overhead low would be a big win. I believe that's the generational leap we need to see in server frameworks, and I hope we start seeing this soon.