Web Assembly is changing the way we build, deliver, and extend apps
Photo at the courtesy of Unsplash.com. Probably not much related to the topic ;)

Web Assembly is changing the way we build, deliver, and extend apps

The first idea on Web Assembly for me was seeing the QuakeJS and JS-DOS running in the browser. From that time on W3C consortium including Google and Microsoft support made WASM global available in virtually any mainstream web browser.

It means even right now you can deliver the compiled, binary, computation-heavy apps fully integrated with JavaScript and DOM to the users. Right now.

As cool as it might sound for some of us I didn't rather find many use cases I could use web assembly on a daily basis, because plain JS apps are doing a great job and in most cases are sufficient. Until the latest Shopify Unite event.

They announced a lot of new features (by the way - including a React-based storefront app) - but what struck me most is the way they implemented the new backend-extensibility feature. Shopify is SaaS, but they're providing developers with a way to safely deploy the backend extensions. Using Web Assembly. Serverside.

It was an eye-opener for me because I haven't seen it this way before. In the end, Web Assembly is a unified binary format/bytecode format delivering the lower level instructions for the end-user CPU. It means the code can be (probably) better optimized using multi-phase compilers of virtually any programming language including C++, Python, Rust, Rails, etc.

The code is sandboxed and executed by a kind of Virtual Machine isolating the code from the Operating System and hardware by the WASI (Web Assembly System Interface)

There are first run times available running WASM apps outside the browser. One of the products I like most is Wasmer.

Microsoft is doing a great job with its Blazor. It let the devs create the Client apps leveraging the .NET framework and C# (or any other supported language) being delivered to the client as wasms. For me - having still some memories from 200x - building C# Web Form Apps - it sounded pretty scary, like Web Forms for Single Page Apps. However, when you closely look at how the code is being optimized and smartly delivered to the browser it could be a thing. It shows WASM is a standard and it's here to stay.

OK. So what's that exciting in Web Assemblies that I've written this blogpost? I just wanted to share some ideas on how it could be used to change the way we deliver and extend the apps I feel is still not much explored.

Serverless with no boot-time and Edge Computing

Folks from Shopify mentioned the other reason (other than security) they bet on WASM is the boot time - which is counted in ... microseconds (instead of milliseconds or seconds) for other techniques. How about creating the Serverless functions using WASM? It's pretty much similar to the way Cloudflare Workers leverage on Isolated JS however it lets you use any programming language which could be compiled to WASM.

Fastly is using their own Runtime for Edge computing scenarios executing user programs at the CDN Edges.

Safely extending SaaS products

Actually, there's nothing more to add to the original Shopify Engineering post. I was quite excited about how commercetools is using Lambdas to extend their SaaS platform. This is another way to go - probably super viable for small-footprint hi-frequency injection points like marketing and promotion engines or .... blockchain smart contracts (?)

Local Servers and smart-caching

I can even imagine the Web Assembly Serverless functions being ... cached and ran in the Web Browser. For multiple cases like offline, satellite connections could be a thing. We've seen cases like this before, using the Service Workers - however without the support for actually running the byte/native code on the device.

Marcin Zabawa

Leadership in Software Development Services

3 年

Reading about those 2 methods of extending SaaS backends was very informative ?? thanks Piotr

回复
Rafa? Makara

Engineering Manager at Docplanner | Writing at SorryEngineering.com

3 年

Pawe? Burniak have you dug more into WebAssembly since 2018? I remember you were an early adopter? :)

要查看或添加评论,请登录

社区洞察

其他会员也浏览了