How Flutter + Serverless Unifies Mobile and Backend Development for Faster Delivery
This article explains how Alibaba's Xianyu team combined Flutter with a Serverless architecture to unify Android, iOS, and backend services using Dart, dramatically improving development efficiency, reducing coordination overhead, and enabling a three‑tier integrated workflow.
Serverless, hailed as the next generation of cloud computing, has gained popularity for accelerating delivery and cutting costs. Xianyu’s client, built with Flutter, evolved its architecture to combine Flutter and Serverless, aiming to resolve heavy coordination among roles, low overall development efficiency, and the growing gap between mobile and business logic.
Evolution of R&D Architecture
Early PC internet development lacked a clear front‑end/back‑end split; a single developer handled both. As complexity grew and mobile exploded, separate front‑ends (Android, iOS) and back‑ends emerged, leading to inefficiencies. Teams introduced BFF (Backend‑For‑Frontend) to aggregate data, but BFF development introduced new challenges.
Cloud‑Integrated Technical Solution
Serverless consists of BaaS (Backend as a Service) and FaaS (Function as a Service). BaaS provides databases, message queues, etc., while FaaS runs business logic. Xianyu’s FaaS environment supports Java, Kotlin, Swift, Dart, Node.js, etc. By using Dart on Android, iOS, and FaaS, the team achieved language unification, protocol unification, and engineering unification.
Language Unification
All three tiers—Android, iOS, and FaaS—are written in Dart, eliminating the learning curve for FaaS languages.
Protocol Unification
A unified framework hides communication details, allowing front‑end code to call FaaS services like local functions.
Engineering Unification
Developers work within a single project; Dart’s hot‑reload enables rapid development and debugging across tiers.
Order Page Integration Practice
The Xianyu order page demonstrates the three‑tier integration. Previously, the client requested five APIs and performed data aggregation locally. After integration, all aggregation and business logic moved to FaaS, returning a ready‑to‑render ViewModel to the client.
Interaction operations that previously altered payment amounts on the client now invoke FaaS for validation and data updates, removing all client‑side calculation logic.
Integrated Development Framework
Key components include:
Nexus Framework : Flutter‑based UI framework.
Logic Engine : Flutter‑based communication and scheduling framework.
Nexus Server : Dart‑Runtime based backend framework.
Code examples (illustrated in images) show client‑side initialization and the corresponding FaaS handling, both using a shared BinderAction and identical state types to hide communication details.
Benefits and Outcomes
The integrated architecture increased overall development efficiency by about 30%, enabled faster business feedback loops, and shifted developers from pure UI focus to full‑stack technical ownership, allowing backend teams to concentrate on domain services.
Challenges
FaaS development experience needs improvement; debugging currently relies on GAIA logs, with plans for local log capture and remote debugging.
Operational costs rise due to increased responsibilities for issue tracing, load testing, and security.
Conclusion and Outlook
Flutter + Serverless three‑tier architecture solves the coordination and efficiency problems of previous setups, but challenges remain in tooling and operations. Ongoing work focuses on refining the technical solution to address these issues.
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.
Alibaba Cloud Developer
Alibaba's official tech channel, featuring all of its technology innovations.
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.
