"Function Compute (FC) meets the needs of online programming education and supports our multi-dimensional teaching mode. After students type in their code, FC can immediately return the execution results, achieving interactive learning."
01About Lagou
Lagou Education is a sub-brand of Beijing Lagou Network Technology Co., Ltd., one of the largest job-matching platform in China. Lagou Education is dedicated to helping IT professionals improve their communication and technical skills. As a practical university for those working in the Internet industry, Lagou Education provides two learning methods: columns and bootcamps. The courses cover fields such as R&D, product, design, operation, and marketing.
02Challenge
Lagou Education offers programming courses as part of its education programs. The programming courses are supplemented with images, text, audio files, and video files. The most attractive feature of the programming courses is interactive learning. This feature allows students to acquire knowledge and master skills through hands-on practices. At the core of the programming courses is a system that can return execution results in real time after students type in code online. In order for this to work, the system must have the following three features:
1. The system must support multiple programming language runtimes. Lagou Education provides courses for a rich variety of programming languages and technical frameworks. Therefore, the system must be able to: first, support the runtime of multiple programming languages, and second, extend the supported runtime languages in a quick and convenient way.
2. The system must support large numbers of concurrent requests. Lagou Education gathers a large number of excellent teachers and students. In each class are tens of thousands of students. Therefore, the online programming system must be able to handle massive concurrent requests.
3. The system must be secure. It must not break down or affect other business areas due to malicious code or poorly written code that might be submitted, such as those that contain endless loops.
03Why Alibaba Cloud
Lagou Education chose Function Compute (FC), a serverless service developed by Alibaba Cloud, to address the critical pain points of its system. With FC, students only need to write code in one of the supported programming languages to implement execution logic and upload the code. FC instances can also be triggered by HTTP requests or events to execute the logic and respond to the requests.
What's more, FC is seamlessly interconnected with other Alibaba Cloud services, including Object Storage Service (OSS), API Gateway, Log Service, Message Service, and Tablestore. This helps Lagou Education quickly build systems.
04Architecture
1. FC supports multiple programming language runtimes, including Java, Python, Node.js, PHP, and .Net Core. It can also build the runtime of other languages by using custom containers, such as custom Go runtime, custom Ruby runtime, and custom PowerShell runtime.
2. FC provides elastic scaling and high availability. To support high concurrency in systems that are built on traditional servers, the only method is to add more machines. This method is not flexible to address traffic surges or traffic varies over time. FC eliminates the need for cold boot by using reserved instances and the pay-as-you-go billing method. An instance can start within milliseconds. You can also configure only one FC instance to process concurrent requests. The instance can be scaled to handle sudden traffic surges with ease.
3. FC has a thorough security protection mechanism. For FC, security enjoys the highest priority in every aspect of the service and system design. FC provides the same isolation protection level for programs as Elastic Compute Service (ECS). FC runs on virtual machines, not in containers. In addition, FC provides robust protection against DDoS attacks and attacks on the network, data, and code.
05Looking Forward
Function Compute (FC) meets the needs of online programming education and supports multi-dimensional teaching mode of Lagou Education. After students type in their code, FC can immediately return the execution results, achieving interactive learning. In the future, Lagou Education will continue to explore new opportunities to apply serverless solutions to online programming.