Yuque is a professional cloud-based knowledge base for team collaboration in documentation. It is an essential tool for Alibaba employees to write documents and accumulate knowledge, and is commercially available since 2018.02
Yuque uses Node.js to implement the entire server-side logic. In some scenarios, a large number of CPU resources may be consumed or processes may be blocked due to infinite loops. Take the conversion of user input data from another format to the Markdown format as an example. Conversion code is automatically generated based on user input data. In this case, low-quality input data may lead to bad conversion code, which will cause low conversion efficiency or infinite loops. Node.js has existed for only about a decade. So far, no perfect solutions have been found to resolve the preceding issues. Even a programming language that supports multithreading, such as Java, is unable to provide a solution. Therefore, abnormal CPU usage of Yuque is an issue that sorely needs to be resolved. After all, CPU is a very important resource for web applications.03
Why Alibaba Cloud
It requires highly professional IT staff and a large budget to build a serverless platform from scratch. In addition, a mature service ecosystem is a must to implement a serverless architecture. Alibaba Cloud provides a stable serverless infrastructure that is composed of the X-Dragon architecture, sandboxed containers, Apsara Distributed File System, and Apsara Cloud Network System（luoshen）. It also provides a wide variety of serverless cloud services and developer tools, such as Function Compute, EventBridge, Serverless Workflow, the developer Framework, command-line tools, and Web IDE. Among them, Function Compute is recognized by Forrester Wave as a Strong Performer.04
The video transcoding service is CPU-intensive. Self-built video transcoding clusters will waste a large number of resources. The use of ApsaraVideo VOD means high costs, and resources that can be managed are limited. Function Compute integrates with FFmpeg in the Application Center to provide audio and video processing capabilities. It also works with Log Service to implement monitoring and data analysis. After the audio and video processing service of Yuque is migrated from ApsaraVideo VOD to Function Compute, the compression ratio is increased and unnecessary transcoding is reduced. This way, Yuque reduces costs by 80%.05
After Yuque migrated its audio and video processing service to Function Compute, the architecture of Yuque is centered around a monolithic application. Independent features are implemented in microservices or serverless architectures based on scenarios and capability requirements. To determine the architecture of an application, the staff composition and business forms of the application users must be taken into consideration. As the infrastructure and cloud services improve, the development team of Yuque is presented with more choices and will constantly improve the architecture of Yuque.