Cloud Computing 14 min read

How Midway-FAAS Reinvents Serverless: A Scalable, Vendor‑Neutral Architecture

This article explains how Alibaba's Midway‑FAAS framework abstracts multiple cloud function providers into a unified, vendor‑lock‑in‑free, flexible and cost‑effective serverless architecture, detailing its standardised serverless.yml, runtime extensions, TypeScript support, and real‑world deployment experience.

Node Underground
Node Underground
Node Underground
How Midway-FAAS Reinvents Serverless: A Scalable, Vendor‑Neutral Architecture

Community Background

Many cloud vendors—Amazon, Microsoft, Google, Alibaba Cloud, and Tencent Cloud—offer their own function services, each with distinct standards, APIs, and runtime behaviors, making cross‑platform selection and migration challenging for users.

Tools like the Serverless Framework use a serverless.yml file to describe multi‑cloud capabilities, but existing plugins often lack uniformity and depend on vendor‑specific support.

Vendor Lock‑In Prevention

Different providers expose different parameter signatures (e.g., Alibaba Cloud uses req, res, context while others use event, context, callback), causing friction for developers.

Midway‑FAAS aims to standardise the serverless.yml format and unify code‑level input/output parameters across clouds.

Standardise serverless.yml to generate provider‑specific configurations from a single definition.

Wrap callbacks into Promises (async) and introduce a unified FaaSContext that abstracts event and context data.

Expose the unified context as the first argument, with the original event as the optional second argument, allowing developers to write plain async functions without vendor‑specific boilerplate.

These wrappers enable seamless deployment to multiple providers (currently Alibaba Cloud and Tencent Cloud) while keeping the code unchanged.

Flexibility

Midway‑FAAS extends flexibility by allowing functions to be horizontally or vertically aggregated, enabling multiple routes to map to independent functions or combine several logical units into a single function instance.

This approach reduces cold‑start overhead, lowers cost, and supports high‑density deployments where configuration changes in serverless.yml drive scaling without code modifications.

Development Efficiency

By converting traditional Event and Context fields into a unified FaaSContext and providing TypeScript‑friendly interfaces, developers gain better tooling, autocomplete, and type safety.

Midway‑FAAS, built on TypeScript since 2017, offers IoC, decorators, and other modern patterns while preserving compatibility with existing FaaS workflows.

Runtime Extension

Midway‑FAAS defines a four‑stage lifecycle—RuntimeStart, FunctionStart, Invoke, Close—with before/after hooks, enabling custom middleware, unified monitoring, and governance without altering user code.

A lightweight runtime-engine manages this lifecycle, while a LightRuntime adapts it to each cloud provider. Additionally, reusable “Layers” provide shared capabilities such as monitoring and metrics.

After nearly a year of iteration, the framework has migrated Alibaba’s Taobao guide business and other BU services to this serverless model, passing large‑scale production tests.

The project is open‑source on GitHub and slated for a v1.0 release in January, inviting community contributions.

cloudflexibilityvendor-lockin
Node Underground
Written by

Node Underground

No language is immortal—Node.js isn’t either—but thoughtful reflection is priceless. This underground community for Node.js enthusiasts was started by Taobao’s Front‑End Team (FED) to share our original insights and viewpoints from working with Node.js. Follow us. BTW, we’re hiring.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.