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.
Community comments
Supported programming languages?
by Chris Richardson,
Re: Supported programming languages?
by Daniel Bryant,
Re: Supported programming languages?
by Chris Richardson,
Re: Supported programming languages?
by Sergio De Simone,
Re: Supported programming languages?
by Daniel Bryant,
Re: Supported programming languages?
by Chris Richardson,
Re: Supported programming languages?
by Daniel Bryant,
Re: Supported programming languages?
by Chris Richardson,
Re: Supported programming languages?
by Daniel Bryant,
Re: Supported programming languages?
by Chris Richardson,
Re: Supported programming languages?
by Matt Butcher,
Performance
by Amir Shitrit,
Re: Performance
by Sergio De Simone,
Re: Performance
by Matt Butcher,
Re: Performance
by Matt Butcher,
Supported programming languages?
by Chris Richardson,
Your message is awaiting moderation. Thank you for participating in the discussion.
Interesting but a brief discussion of supported programming language would have been helpful.
Re: Supported programming languages?
by Daniel Bryant,
Your message is awaiting moderation. Thank you for participating in the discussion.
Hey Chris, I hope all is well! Yeah, this is a good point. In theory, any language that can be compiled to Wasm with WASI support will work on the platform.
This webpage contains some interesting context and additional links:
www.fermyon.com/wasm-languages/webassembly-lang...
Performance
by Amir Shitrit,
Your message is awaiting moderation. Thank you for participating in the discussion.
Fast startups are a great thing, but wouldn't WASM run a (very) bit slower than native code?
I guess that since serverless functions run for a very brief duration, it's not necessarily a problem, but for a medium to long duration, does this trade-off worth it?
Re: Performance
by Sergio De Simone,
Your message is awaiting moderation. Thank you for participating in the discussion.
Hi Amir, that's an interesting point. A lot of code in the Cloud is written in Python, Node, so that would possibly define the arena where Wasm is competitive or a very good option. On the other hand, I know the world of benchmarks can be tricky, but from this one here (programming-language-benchmarks.vercel.app/go-v...), I gather that Wasm is not always so much worse off than Go -- although in some cases it is.
Re: Supported programming languages?
by Chris Richardson,
Your message is awaiting moderation. Thank you for participating in the discussion.
Sure.
But what about the Spin framework? That seems primarily Go and Rust.
Perhaps I'm #lazy but a sentence or two about whether it's truly practical to run Java (or .NET) - ie. enterprise languages - on Fermyon would have been very useful. Or is it just some exotic tech. that simply sounds cool?
Re: Supported programming languages?
by Sergio De Simone,
Your message is awaiting moderation. Thank you for participating in the discussion.
Hi Chris, thanks for your comments. I have amended the article and included a brief mention to supported languages on the Fermyon platform, so future readers will get that information right away. Turns out Java is not supported, but .NET languages seem to be.
Re: Supported programming languages?
by Daniel Bryant,
Your message is awaiting moderation. Thank you for participating in the discussion.
Many thanks, Sergio!
@Chris -- I would class this as "innovator" rather than "exotic" :) It looks like the Fermyon folks are targeting the Go and Rust ecosystem, which makes sense with adoption. Us Java folks are typically late adopters!
Re: Supported programming languages?
by Chris Richardson,
Your message is awaiting moderation. Thank you for participating in the discussion.
Awesome. Thanks for doing that!
Re: Supported programming languages?
by Chris Richardson,
Your message is awaiting moderation. Thank you for participating in the discussion.
Perhaps you could describe it as the Java community being late adopters.
Alternatively, you could view it as a new technology failing to support a major language ecosystem.
:-)
Re: Supported programming languages?
by Daniel Bryant,
Your message is awaiting moderation. Thank you for participating in the discussion.
Yeah, I take your point. I'm curious to see how the Java/JVM Wasm story proceeds in general (and a quick Google pointed me to another of Fermyon's page -- their SEO game is strong! www.fermyon.com/wasm-languages/java )
Re: Supported programming languages?
by Chris Richardson,
Your message is awaiting moderation. Thank you for participating in the discussion.
Here's another random thought:
Does Java/JVM even need server-side WebAssembly?
Java class files are portable. The JVM is an excellent runtime. Multiple services can run in the same JVM process. For example, OSGI bundles are are a relatively ancient tech that provided these capabilities.
Re: Supported programming languages?
by Daniel Bryant,
Your message is awaiting moderation. Thank you for participating in the discussion.
This is a great question, Chris! I remember OSGI (fondly? :)) from my days working with app servers. Wasm also makes me think of Applets, and we all know how that turned out, lolz
I hope your Thanksgiving was good!
Re: Performance
by Matt Butcher,
Your message is awaiting moderation. Thank you for participating in the discussion.
We've actually gotten some great performance numbers on WebAssembly execution time. Part of this is because Wasm is pretty fast. And part of this is because we can do optimizations on the Wasm binary when we receive it to deploy. For example, we can run wasm-opt and then AOT-compile on the deployment target.
Re: Supported programming languages?
by Matt Butcher,
Your message is awaiting moderation. Thank you for participating in the discussion.
We have some "tier one" SDKs for Rust, Go, C#, Java, and soon JS. But any language that does Wasm32 + WASI will work with Spin and Fermyon Cloud. Part of our Finicky Whiskers game, for example, is written in Ruby.
Re: Performance
by Matt Butcher,
Your message is awaiting moderation. Thank you for participating in the discussion.
The sorta frustrating thing (to me) about Wasm benchmarking is that it is runtime stack dependent. If the Wasm code is run through wasm-opt, wizer, and the like, this changes the performance profile. And if it's executed on Wasmtime vs. V8 vs. Wasm 3, this also changes the performance numbers. On Fermyon Cloud, we do a lot of pre-execution optimization (including AOT compiling).