At KubeCon/CloudNativeCon 2022, Fermyon launched its microservice-oriented platform for WebAssembly apps, called Fermyon Cloud, which is now available in open beta.
At the heart of Fermyon Cloud is the vision that WebAssembly holds the potential to make the serverless promise a reality, thus overcoming the limitations posed by containers and virtual machines. Fermyon CEO Matt Butcher argues that WebAssembly is superior to VMs and containers on two accounts: start up times and portability across platforms.
All microservices should ideally be stateless and use a stateful service to store their information. And because of those features, then you should be able to start and stop them as quickly as you can. Now imagine, instead of taking several minutes to start up a virtual machine or several seconds or a few dozen seconds to start up a container, you could instantly start up your application and instantly shut it down when it wasn't handling traffic anymore. That's the model we pursued with WebAssembly.
According to Butcher, you can get to execute the first instruction of your app in less than a millisecond, sometimes in the microsecond level. This would make it easier to build applications that scale up fast when there is a request peak and down to zero and no traffic is coming, without wasting CPU or memory. When using containers or VMs, on the contrary, the usual approach to cold boot is to run an instance idle for some time after a request has been served, in case a new one comes quickly in.
The other big benefit of WebAssembly is portability across architectures, down to the executable level:
My interest was being able to take the same compiled artifact, the same compiled bytes, and run those across operating systems and CPU architectures. That was the first thing that was coming from the world of containers where we had a container image and that was bound to an architecture, to a CPU architecture and an operating system, and you needed to have something like multi-arch images to get the same applications run in multiple environments. The fact that you can take the same WebAssembly module and run that in Linux on ARM and then Windows on AMD and then somewhere in the cloud that you don't really care about what the architecture is, was fascinating.
Portability also extends to languages, in that WebAssembly is a supported target for many languages currently available. The main requirement here for a language to be used on the Fermyon platform is WASI support. This means you can use Python, C# and other .NET languages, C/C++, Go, Rust, and others. Notable exceptions are Java, JavaScript/TypeScript, Scala, and others.
Based on Spin, Fermyon's open-source framework to build cloud microservices using WebAssembly, Fermyon Cloud leverages a number of other open-source projects, including Bindle to manage releases, Nomad for orchestration, and others. Instead of using Spin proper to execute apps, though, Fermyon Cloud uses a highly scalable execution environment, which they say is able to run thousands of applications on a five-worker Nomad cluster.
While stacking up WebAssembly and container-based microservices, Butcher is careful not to posit the former as a replacement for the latter. Rather, he sees it as a complementary technology that in some cases will run side by side with containers and VMs.
It's not that virtual machines got replaced by containers and WebAssembly will replace containers. Each time we make a sort of incremental step, it's additive. We're adding one more thing, but we're not subtracting anything else. So virtual machines are a stronger market now than ever before and the tooling for managing virtual machines continues to improve. Likewise with containers and I think WebAssembly will be that next complementary technology.
As mentioned, Fermyon Cloud in now available in open beta, with the only limitation of a maximum number of five allowed spins per developer. If you rather want to run your own platform to host Spin applications, you can use the Fermyon Installer on any of the major Cloud providers, including Azure, AWS, DigitalOcean, and Google.
NOTE: This article was amended for completeness on Nov 23 to include a mention to supported languages.