The author | mountain hunting

In recent years, Serverless has been growing at a high rate and showing increasing influence. Mainstream cloud service providers continue to enrich the cloud product system, providing better development tools, more efficient application delivery pipeline, better visibility, more delicate integration between products, but it is just beginning.

Some large domestic companies have some mature Serverless application cases, and some start-up companies have also begun to join the Serverless camp. If Serverless solves any problems, the core is to save costs and energy.

Blue Ink is a high-tech company founded by American students who have returned to China. It focuses on new technology research and platform operation in the field of digital publishing and mobile learning in the era of mobile Internet. Relying on the core technology system of blue Ink mobile interactive digital teaching materials independently developed, For publishers, schools and teachers to provide mobile interactive digital textbooks, campus mobile learning platform and teachers self-help digital publishing solutions.

Since its establishment in 2012, Blue Ink’s technical team has great enthusiasm for some open new technologies and is willing to apply fast iterative new Internet technologies to ensure the stable operation of its business systems. In early 2020, demand for online education exploded during the pandemic. In order to cope with the high traffic, Blue Ink has increased its efforts to integrate high-quality course resources in the industry and continuously expand its business boundaries. While winning opportunities, the technical team has also faced unprecedented challenges.

Facing the challenge

As a teaching platform, Blue Ink has to deal with a large number of video teaching materials every day, which involves a series of complex technical work such as video editing, segmentation, combination, transcoding, resolution adjustment, client adaptation and so on. The video processing related business is one of the biggest challenges facing blue Ink’s technical team. Through several years of technical practice, blue Ink technical team has established a set of independent and controllable video processing mechanism through FFmpeg and other technologies, which supports the rapid development of business. However, lanmo’s technical team was not prepared for this year’s business growth. The demand for video processing at peak times was dozens of times higher than in previous years, which overwhelmed the existing architecture and seriously affected the user experience.

Peak demand is difficult to plan, horizontal expansion is difficult to pass

Faced with the challenges, the blue Ink team initially hoped to solve the problem by horizontal scaling, but throughout the day, the demand for video processing has extremely steep peaks and troughs, with a large number of tasks occurring at several peak times and with a certain degree of suddenness. If the system capacity is planned according to the peak demand, a large amount of computing resources will be wasted, and it is difficult to predict the peak demand. If staggered peak processing is adopted, the cost of computing resources can be reduced, but the demand of users can not be timely processed. The horizontal expansion scheme was abandoned.

It is difficult to use third-party video transcoding services due to its own business logic

Another solution is to directly use video transcoding services provided by cloud vendors, similar to BaaS. The advantage of using such a solution is that the problem of capacity planning is not considered at all and cloud services can be invoked based on the actual traffic volume. However, the video processing mechanism of Blue Ink is very fine, including a lot of customized business logic, which needs to be realized by using codes. The third-party video transcoding service cannot meet the requirements at all.

The solution

Knock it down and start again! Blue Ink’s core appeal is summarized in three aspects: cost saving, extreme flexibility, and free operation and maintenance. These are exactly the problems that Serverless is best at solving. After the investigation of Serverless services provided by domestic cloud manufacturers, the blue Ink technical team agreed that Ali Cloud function computing is the most suitable solution for them in the field of video processing.

Ali Cloud Function Compute (FC) is an event-driven, fully managed Serverless computing service. For users, there is no need to manage servers and other infrastructure, but only need to write and upload codes. Function Compute will prepare computing resources and run codes in an elastic and reliable way. Since Ali Cloud function computing is fully compatible with the existing code logic and can support all kinds of mainstream development languages, the blue Ink technical team can migrate the code logic from the original architecture to Ali Cloud function computing in a nearly seamless way, and the cost is very low. By connecting OSS triggers, when a new video source file is uploaded on the OSS, the compute instance of the function can be automatically pulled up to start a video processing service life cycle. By integrating Serverless workflow, the distributed tasks can be arranged uniformly, and the complex operation of parallel processing and final merging of large files after slicing can be realized, which further improves the processing efficiency.

For Blue Ink’s technical team, functional computing is a completely on-demand Serverless solution that takes full advantage of the elastic capabilities of cloud computing.

  • On the one hand, Ali Cloud function computing can quickly mobilize computing resources of tens of thousands of instances in a short period of time to realize the fast execution of video processing tasks;
  • On the other hand, because there is no need to reserve computing resources or maintain the underlying hardware and software, the operating cost can be greatly reduced and the blue Ink technical team can focus more on the implementation of complex business logic.

Compared with the traditional method, the Serverless scheme based on Ali Cloud function calculation can save about 60% of IT cost in video processing scenarios.

After enjoying the great value brought by function computing, Lanmo also actively explores scenarios for Serverless transformation in other business fields other than video processing, and successfully implements the integration of ali Cloud function computing and log service. When logs are continuously written in a stream, The log service automatically triggers function calculation to process data, analyze important information in logs, alarm abnormal events, compress and convert logs according to service rules, and store logs in other media. Function computing integrates a large number of Ali cloud services such as OSS, OTS, MNS, CDN, etc., and also supports integration by other cloud services. Its unique callback mechanism helps Blue ink connect storage services such as OSS, SLS, etc., which conforms to the writing habits of developers and does not need to waste a lot of design and disaster recovery for asynchronous callback.

The person in charge of the blue Ink technical team said that in the future, blue Ink will integrate more scenes with Ali cloud function computing, fully enjoy the technical bonus of cloud native, and improve the combat effectiveness of the whole team. And Ali cloud will always stand together with users, and win the next beautiful battle!

Ali cloud function calculation

Ali Cloud is the first batch of domestic enterprises to launch Serverless computing services, and Function as a Service is the most representative product form of Serverless. It can be said that Blue Ink is not the first enterprise to enjoy the great value of functional calculation FC, Sina Weibo, Graphite Document, Mango TV and other supporters of functional calculation. Not long ago, at the 2020 Trusted Cloud Line Summit, Ali Cloud Function Computing FC passed 21 tests including basic capability requirements, platform observability, service performance, service and service measurement accuracy, and passed the trusted cloud function as service capability certification with full marks. Earlier, in the report released by Forrester, Ali Cloud computing was given a “strong performer” evaluation.

In addition to expanding more diversified product forms, Ali Cloud function computing has also been constantly optimizing user experience, including doing industry-leading practices such as hard disk mounting, reserved instances, mirror acceleration, large-scale instances, and so on. We really put user needs in the first place and set our heart to make more valuable products for users.

Course recommended

In order for more developers to enjoy the dividends brought by Serverless, this time, we gathered 10+ Technical experts in the field of Serverless from Alibaba to create the most suitable Serverless open course for developers to learn and use immediately. Easily embrace the new paradigm of cloud computing – Serverless.

Click to free courses: developer.aliyun.com/learning/ro…

“Serverless public account, release the latest information of Serverless technology, collect the most complete content of Serverless technology, regularly hold Serverless activities and live broadcast and release user best practice. Pay attention to Serverless trends, and pay more attention to the puzzles and problems you encounter in landing practice.”