How Ant Group Turned BFF Architecture into Serverless Frontend with SFF
The talk explains how Ant Group’s internal Node.js framework Chair evolved from a heavyweight BFF layer into a lightweight serverless‑for‑frontend (SFF) platform, detailing the challenges of BFF ops, the SFF function model, high‑density deployment, two‑layer scheduling, and the resulting gains in developer productivity and resource efficiency.
BFF Development and Operations Cost
Ant Group’s internal Node.js framework Chair powers many BFF applications, middle‑platform products, and internal tools. While BFF aggregates backend services for the frontend, it creates high communication and coordination costs, complex deployment, and heavy operational burdens for frontend developers who must also handle server‑side issues.
Function Development (SFF)
To address these problems, Ant introduced the SFF (Serverless for Frontend) concept, aiming for "light development" and "no operations". Developers write simple functions without worrying about the triggering protocol; a configuration file declares which functions are exposed and how they are invoked. The runtime provides a unified ctx object, isolating business logic from HTTP or RPC details. OneAPI client abstracts all Ant protocols, allowing frontend code to call a function by method name only.
High‑Density Deployment
Ant built a high‑density deployment architecture to maximize resource utilization. By running functions in 0.5 CPU / 512 MiB containers instead of traditional 4 CPU / 8 GiB pods, they achieve up to eight‑fold density. Two‑layer scheduling separates Kubernetes‑level pod placement from an in‑container function scheduler, enabling rapid (<500 ms) function startup. Alinode Cloud provides lightweight process‑level scheduling and sandboxed function processes, handling resource limits and automatic reclamation of idle functions.
System Architecture
The gateway sits at the traffic entry point, designed without persistent storage or downstream dependencies for high availability and horizontal scalability. It performs protocol unification, routing, and load balancing, delegating requests to the appropriate function via the two‑layer scheduler. Inside each container, a function scheduler tracks live function processes; if a process is missing, it launches a new one via Alinode Cloud. Middleware is offloaded to an egg sidecar, reducing function memory usage and isolating heavy‑weight components.
Summary
By evolving from a monolithic BFF to the SFF model, Ant Group eliminates resource provisioning, load‑testing, scaling, and limit‑rate management for developers. Serverless abstracts away all operational concerns, dramatically improving development efficiency and developer happiness while maintaining high performance through high‑density deployment and fast function startup.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
