What do you get if you take a WebAssembly runtime, wrap it in a high-performance web server, and statically compile so it doesn't need any dependencies? You get Sat, a brand new experiment from Suborbital.
If that's all you need to hear, check it out on GitHub and I'll say no more!
If you're hoping for a bit more context, let's get into it. For a while now, the team has been working on different ways to run WebAssembly on the server. We currently have two different approaches, the Reactr scheduler, and the Atmo application environment. These two projects are at the opposite ends of the spectrum. Reactr is very "DIY", requiring that you write a Go application to take advantage of it, giving you a huge amount of flexibility in return. Atmo is "batteries included", and is meant to run an entire application automatically using a declarative configuration.
These are both great, but we have been finding need for a middle ground, so the Sat project came about. Sat is a teeny tiny server that does one thing very well: run WebAssembly functions really really fast.
Sat uses Reactr (along with its brand new support for the Wasmtime runtime), and packages it up into the smallest possible web server. This creates a zero-dependency, small-footprint, single-use server that's extremely well suited for edge compute. Here's a day in the life of Sat:
- Start up, load a WebAssembly function
- Serve requests
It does not get any simpler than that, which is what makes Sat so special. It does have a few tricks up its sleeve:
- Ability to create a mesh with its peers, which will create some interesting opportunities later
- Ability to serve TLS automatically with LetsEncrypt
- Full compatibility with the Runnable API for super powerful functions
- Alpine-based Docker image (it's 4.2 times smaller than Atmo!)
- Statically compiled binary with zero dependencies
Sat can start up and serve a request 3-5x faster than Atmo, and has better performance in many scenarios due to the intricacies of concurrency in Go (we'll do some detailed profiling in a future post!).
We think this tiny server opens up some large new possibilities, including the ability to run a 'constellation' of Sats combined with Atmo’s upcoming proxy mode to get even better performance in highly distributed and edge environments. Sat is still an experiment, but we'd love your feedback so please give it a try and let us know what you think!
P.S. Sat is open for Hacktoberfest contributions, we’d love to see you join in!