Introduction: Graphite document uses function calculation to build real-time document editing service. The intelligent scheduling system based on function calculation automatically allocates execution environment to deal with the peak load caused by multiple users writing documents at the same time. The dynamic capacity of function calculation ensures reliable operation of the application.

The author | Jin Zhongqian

For graphite documents, “user experience, cost consumption, on-line speed” is an important factor to determine whether it can emerge in the vast sea of business. It requires a set of resilient, highly available, distributed services to handle document editing conflicts in real time: both at an acceptable cost and smoothing out peak loads in the event of a load spike, enabling millisecond synchronized document responses.

On July 20, 2021, a heavy rainstorm broke the tranquility of Henan province and touched the hearts of people across the country. That night, a large number of information about the torrential rain in Henan began to spread rapidly on various social media, including “list of rescuers to be rescued”, “information on rescue site”, “information on accommodation and transportation materials”…… Online documents carry life-saving information. Graphite documents in the first time to the flood front government departments, medical institutions, public welfare organizations, social volunteers to provide free advanced version of products and services.

Within two weeks, more than 1,600 disaster coordination documents were created across the country, providing online coordination services for millions of equipment, making on-site relief, material transportation, medical and volunteer organizations more efficient. At the same time, the IT system behind the graphite document faces great challenges, especially: how to ensure the smooth operation of the system.

Only when the system runs smoothly, can more people participate in the document collaboration, sort out, edit and summarize all kinds of life-saving documents in the first time, so that life-saving information can be transmitted in time.

Graphite document withstood the test of extreme flow. Behind it, an intelligent operation and maintenance system was built on Ali Cloud five months ago, which opened up the whole link of the system to observe data, and realized unified management, intelligent alarm and pre-check in advance.

As soon as the disaster occurred, the graphite document team engineers received an alarm call, and the voice automatically announced that the graphite online K8S (Kubernetes, container control system) cluster resource utilization rate soared, PV (Page View, Page View) increased by more than 200% year on year; The number of access requests to some service interfaces increases suddenly, and multiple resources are about to reach the threshold. The cause is that the number of read/write attempts and access requests to multiple documents increase abnormally.

As short-term access Numbers soared, and unable to accurately judge the trend of subsequent rise, engineers quickly to coordinate several times the past ali cloud computing resources in infrastructure on a large scale expansion, to ensure the disaster relief document collaboration, at the same time in the thousands of millions of people to browse circumstances can maintain a stable and smooth experience, to ensure relief work go smoothly. In the end, the graphite document did a great job as an “information carrier” and was consistently available.

The ability to quickly cope with extreme flow pressure also depends on the technical accumulation of graphite documents. Since its establishment in 2014, Graphite documents has served more than 200,000 enterprises in total, facing two major challenges in IT.

First, multi-user real-time collaboration. In order to support multiple user terminal real-time online writing, graphite document technical team OperationalTransformation algorithm for the very deep exploration and modify, solved a text by multiple clients at the same time change caused by the conflict.

But this presents a second challenge, which is the enormous strain that multi-user real-time editing puts on the server. It only takes a few milliseconds for a user to type a word by tapping the keyboard, but if a large number of users are writing documents on graphite documents at the same time, it is easy to have uneven data distribution in a very small period of time, which is an intuitive embodiment of “write serial”.

For graphite documents, “user experience, cost consumption, on-line speed” is an important factor to determine whether it can emerge in the vast sea of business. It requires a set of resilient, highly available, distributed services to handle document editing conflicts in real time: both at an acceptable cost and smoothing out peak loads in the event of a load spike, enabling millisecond synchronized document responses.

To this end, Graphite documents and Ali Cloud in-depth cooperation, with the help of public cloud Serverless architecture to deal with traffic challenges.

Function computing is the Serverless service provided by Aliyun. It dynamically allocates the execution environment according to the number of requests and schedules computing resources at the millisecond level to ensure a stable delay when the load is high and a high resource utilization rate when the load is low. Moreover, it only pays for the computing resources used when the code is running.

Graphite document uses function calculation to build real-time document editing service. The intelligent scheduling system based on function calculation automatically allocates execution environment to deal with the peak load caused by multiple users writing documents at the same time. The dynamic capacity expansion and shrinkage of function calculation ensures reliable operation of the application.

By virtue of the resource scaling capability of function calculation at millisecond level, graphite document solves the problem of computing resource expansion with sudden increase of peak load. Compared with self-built computer room maintenance server, IT saves 58% of IT cost. At present, graphite document calls function calculation more than 3 billion times per month.

In the cloud native era, the gradual improvement of IT infrastructure enables enterprises to carry out digital innovation more efficiently.

Not only is development stability improved, but projects are iterated and brought online at a faster pace by eliminating load balancing for CPU-intensive computing. As the first enterprise office service software supporting cloud collaboration in China, Graphite Document realizes the real-time online collaboration of multiple members and terminals with millisecond synchronous response speed. The powerful and stable technology supports the efficient and stable service experience of the platform, which is also inspiring greater imagination space.

With the help of Ali Cloud function computing extreme elasticity, graphite document release “remote office edition”, for enterprises to bring a series of remote office templates. These templates are easy to use, and realize online real-time office for many people. Further, on December 1st, under the theme of “Reshaping online Office”, Graphite Document officially launched graphite Office, a domestic enterprise-level cloud Office for enterprises and organizations, taking a key step towards a broader market.

Graphite team has been constantly innovating around the needs of corporate document collaboration, which has made an important exploration for the future office collaboration model.

The original link

This article is the original content of Aliyun and shall not be reproduced without permission.