How Midway Serverless Redefines Cloud‑Native Backend Development with React‑Style Hooks

This talk walks through Alibaba's Node.js Serverless landscape, introduces the Midway Serverless framework and its new cloud‑integrated development model, and details its functional R&D, hook‑based APIs, performance optimizations, and real‑world adoption, highlighting future open‑source plans.

Alibaba Terminal Technology
Alibaba Terminal Technology
Alibaba Terminal Technology
How Midway Serverless Redefines Cloud‑Native Backend Development with React‑Style Hooks

In late August, Alibaba Cloud presented a text version of their Midway Serverless system at the Alibaba Cloud Native Microservices Conference, introducing a new React‑Hooks‑style Serverless development approach.

The speaker, a front‑end architect from Alibaba's Taobao tech division, shared the "Midway Serverless, a new generation cloud‑integrated development framework" and explained how to break down the wall between cloud and client.

Outline

Alibaba Node.js Serverless construction status

Midway Serverless introduction

New generation cloud‑integrated development solution

Future roadmap

Alibaba Node.js Serverless Construction Status

In 2019, Alibaba's front‑end committee identified four technical directions: building services, Serverless, intelligence, and Web IDE.

Over 1,600 Node.js applications have low CPU utilization (<10%, many <5%). Maintaining Node.js apps involves Docker, rate limiting, logging, cross‑language calls, leading to high costs. Serverless can improve utilization, reduce costs, and support Alibaba's middle‑platform strategy for rapid business delivery.

Midway Serverless Achievements

After about a year of practice, Serverless was deployed across multiple BUs (Taobao, New Retail, Fliggy, ICBU, Tmall Genie), achieving ~30% cost reduction for traditional services and ~87% for middle‑back‑office services, with ~48% improvement in developer efficiency and zero incidents during peak periods.

Midway Serverless System

The system consists of three parts: toolchain, framework, and standardization.

Toolchain: local trigger simulation, debugging, multi‑platform publishing.

Framework: data mocking, environment configuration, request adaptation, component extension, IoC.

Standardization: unified YML, front‑end call standards, runtime and integration standards.

New Generation Cloud‑Integrated Development Solution

The solution addresses three main problems: high learning curve, front‑back separation, and high R&D cost. It proposes a cloud‑integrated development model where front‑end and back‑end share a single repository and dependencies.

Midway Serverless Cloud‑Integrated Features

Functional R&D Solutions: functions act as interfaces, reducing boilerplate.

Integrated Calls (Api not required): import functions directly like normal calls.

Hooks (Using Node.js like React Hooks): hook‑style development for Node.js.

Progressive Development: supports both simple and complex scenarios via IoC reuse.

Unified Call Experience

Functions without parameters become GET endpoints; functions with parameters become POST endpoints, allowing developers to write and invoke APIs just like regular JavaScript functions.

Get interface call
Post interface call

Hooks Implementation

Hooks provide request context without manual parameter passing. The API const ctx = useContext() retrieves the context, solving stability and performance issues of Node.js Async Hooks.

Performance Optimization

Async Hooks caused significant performance overhead, so Midway uses a compile‑time transformation to bind this and pass context efficiently, leveraging a custom compiler (mwcc) for source‑map support.

IoC Integration

Midway’s IoC framework follows SOLID principles, enabling function‑style development to reuse enterprise‑level best practices via the useInject hook.

Internal Adoption

Since early 2020, Midway Serverless has been iteratively adopted across multiple business units, with a roadmap extending to open‑source contributions, front‑end frameworks, SSR, and mini‑programs.

Future Outlook

The cloud‑integrated solution is now publicly available on GitHub; the team invites the community to star the repo, contribute ideas, and help shape the next generation of development experiences.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeServerlessNode.jsMidway
Alibaba Terminal Technology
Written by

Alibaba Terminal Technology

Official public account of Alibaba Terminal

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.