How Yuque Scaled from Prototype to Cloud‑Native Service with Serverless Function Compute
This article chronicles Yuque's evolution from a low‑cost prototype built on internal BaaS services to a fully commercialized, cloud‑native knowledge platform, highlighting the shift to IaaS, micro‑services, and serverless function compute to improve scalability, stability, security, and cost efficiency.
Prototype Stage
In 2016, Yuque was created as an internal documentation tool for Ant Financial Cloud, using the cheapest options: internal BaaS services (Object storage, File storage based on OSS, and DockerLab) and the Egg framework for a monolithic Node.js web application with a React‑based markdown editor built on CodeMirror.
Internal Service Stage
By 2017, Yuque expanded to serve all Alibaba employees, adding a rich‑text editor with formulas, diagrams, and a three‑layer knowledge structure (team, knowledge base, document). The BaaS services could no longer meet the growing needs, so the backend migrated to Alibaba Cloud IaaS (MySQL, OSS, cache, search) while retaining the Egg framework and introducing an ORM for clearer code layers. The editor moved from CodeMirror to a forked Slate, and a custom content format was created.
Commercialization Stage
In early 2018, Yuque opened to external users. New features such as tables, mind maps, and real‑time collaboration increased CPU‑intensive workloads. To handle these, the architecture evolved: core services remained a large Node.js monolith, while independent functions (e.g., PlantUML, Mermaid previews) were offloaded to Alibaba Cloud Function Compute, providing sandboxed execution, dynamic scaling, and pay‑per‑use billing.
Alibaba Cloud Function Compute is an event‑driven, fully managed service that runs code without server management and charges only for actual execution time.
CPU‑heavy tasks like markdown conversion, image generation, and video/audio transcoding (using FFmpeg) were moved to Function Compute, eliminating the need for a dedicated task cluster, reducing memory leaks, and improving security by isolating user code. process.exec was previously used to invoke third‑party tools, but this approach posed stability and security risks under high concurrency.
Key Takeaways
Serverless is ideal for CPU‑intensive, low‑latency‑tolerant operations, offloading the main service.
It provides a secure sandbox for executing user‑submitted code.
It handles unstable third‑party software by isolating it.
Dynamic scaling meets bursty demand while reducing costs.
Yuque now runs a monolithic core application complemented by microservices and serverless functions, demonstrating how a JavaScript full‑stack can evolve with cloud services to meet product growth, stability, and cost requirements.
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.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
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.
