American Express has opted to use WebAssembly for its internal Function as a Service (FaaS) platform. This represents what could be the largest large-scale adoption and use of WebAssembly in a commercial application to date. The open source WebAssembly tool of choice was wasmCloud, which recently achieved incubation status, as announced at the recent KubeCon + CloudNativeCon event in Salt Lake City.
Both Amex’s adoption of WasmCloud for its FaaS and wasmCloud achieving Cloud Native Computing Foundation (CNCF) incubation status represent significant engineering and talent that help to illustrate what WebAssembly is designed to do.
One of the primary reasons behind this adoption in Amex’s case is that WebAssembly demonstrated superior performance metrics compared to containers. This validates years of WebAssembly development and the excitement surrounding its potential. Previously, WebAssembly was seen primarily as a theoretical alternative to containers, filling in gaps where containers were not always the ideal solution.
In this case, American Express prioritized security, aiming to implement a sandbox-like environment that provides lightweight, low-latency functionality. During a live demo at KubeCon’s Wasm Day, American Express’s senior architect showcased WebAssembly’s benefits, particularly highlighting its speed and sandboxing capabilities — built by platform engineers to run underneath the hood for developers to get their work done through the Faas with minimal learning curves to use.
“Our goal as a FaaS platform is to offload all the responsibilities from the developers,” Ritesh Rai, a staff engineer at American Express Company, during his talk at the WasmCon event that was co-located with KubeCon+CloudNativeCon North America. “Developers in our company should be only responsible for writing function code which consists of business logic, everything else should be taken care of by our platform.”
One of the main reasons Amex adopted Wasm for its FaaS platform was because simply compiling any code to and running efficiently “is not feasible in all scenarios,” Rai said during his WasmCon talk “Elevating Serverless Platforms with Wasm Components” that he gave with Vamsi Sangavarapu, vice president of engineering, American Express.
When code needs to interact with a relational database and manage connection pools effectively, writing that code as a native binary is more appropriate, Rai said. WasmCloud makes this approach possible, Rai said. “Database-specific code can be written as a native binary, while remaining compute-intensive function code can still be compiled with WebAssembly,” Rai said. “Wasm allows function code to interact seamlessly with native binary components. This flexibility enables future replacement of native binary components with WebAssembly components once the ecosystem reaches a level where such a transition becomes viable.”
Platform Engineering Plus
From a platform engineering perspective, Rai described how modern environments cover multiple and diverse data sources, including legacy data sources that impose certain limitations, such as connection constraints. The platform engineers enable independent scaling of components like data source IO, separating these responsibilities from functional code developers create. This reduces the size of functions by offloading tasks like data source connections, allowing for increased density of functions and more instances, as Rai described it.
“Given these benefits, the decision was made to build a FaaS runtime on top of wasmCloud. This approach enables maintaining a single runtime with enhanced density while ensuring functions are fully sandboxed and isolated,” Rai said. “wasmCloud provides additional features like composition and modularity, making wasmCloud a natural choice for the platform.”
Building an Enterprise-Ready Runtime
@AmericanExpress‘s FaaS has open source #Wasm and #WebAssembly components: “Elevating Serverless Platforms with Wasm Components” – Ritesh Rai, American Express Company & Vamsi Sangavarapu, American Express at #WasmCon today. pic.twitter.com/C0sZ1Jb1qW
— BC Gain (@bcamerongain) November 12, 2024
During the development of a custom FaaS runtime, the need for core ecosystem features tailored for WebAssembly became apparent, Rai said. While exploring options, open source projects were considered to accelerate development. Instead of building everything in-house, wasmCloud was leveraged to form the foundation of the platform, Rai said.
For the FaaS American Express is developing, code is written and pushed to a repository, as Rai described the process. The deployment pipeline compiles the code into a WebAssembly component, referred to as the function. A security decorator is added to the component, incorporating security filters and credentials. This secure component is further wrapped in a platform component that enables multiple interfaces for invoking business logic, Rai said.
During the development of a custom FaaS runtime, the need for core ecosystem features tailored to WebAssembly became apparent. While exploring options, open-source projects were considered to accelerate development. Instead of building everything in-house, wasmCloud, a standout open source CNCF project, was leveraged to form the foundation of the platform.
In this system, function code is written and pushed to a repository. The deployment pipeline compiles this code into a WebAssembly component, referred to as the function. A security decorator is added to the component, incorporating security filters and credentials. This secure component is further wrapped in a platform component that enables multiple interfaces for invoking business logic.
Features of the wasmCloud-Based Platform
The platform component is deployed on wasmCloud, transforming standard business logic into an enterprise-ready WebAssembly platform. wasmCloud provides key features such as secrets management, project management, and multi-interface accessibility, allowing seamless invocation of functions. Additionally, the platform offers a development SDK to function developers, enabling interactions with other functions or WebAssembly components, much like using a library.
Custom wasmCloud components extend platform functionality. Extensive contributions have been made to the open source ecosystem, enhancing existing capability providers and creating new ones tailored to specific needs.
Cosmonic CEO and founder Liam Randall and Kevin Hoffman — previously Cosmonic CTO — during their time at a top 10 US bank, the CNCF said in a statement. The project is currently led by Cosmonic CTO and Bytecode Alliance Technical Steering Committee member Bailey Hayes, who is CTO at Cosmonic. WasmCloud was designed to solve the friction that application teams face in every enterprise when writing software and it has grown in popularity since being accepted into the CNCF Sandbox; it is now being deployed and maintained by engineers working in a host of organizations including Adobe, Orange, MachineMetrics, TM Forum member CSPs, and Akamai.
Adobe also relies on wasmCloud for its use of WebAssembly. As Colin Murphy, senior software engineer at Adobe, described how his team uses wasmCloud for its latest project during his talk “Unleash the Power of Open Source WASM on a Hyper-Distributed Cloud, with Douglas Rodrigues, senior architect at Akamai Technologies, during WasmCon before KubeCon+CloudNativeCon, Wasm not only works but is in use, which covers Kubernetes environments. Speaking about WebAssembly in general, Murphy said during his talk: ‘The takeaway is that what we couldn’t do before, now we can do it.”
While significant, the American Express and wasmCloud projects should lead to greater Wasm things, as the American Express engineers continue to contribute to the project. With Wasm showing particular promise for serverless as Fermyon has shown with its SpinKube project, Wasm as a container replacement — at least for serverless applications — should continue to take shape.
The post Amex’s FaaS Uses WebAssembly Instead of Containers appeared first on The New Stack.