Author | Not a senior technical expert of Alibaba Cloud
Reading guide: The two lines of user needs and cloud development have promoted the rise, development and large-scale application of cloud native technology. This article will mainly discuss what is a cloud local application, what is a cloud local application, and what is serverless computing, as well as how serverless computing can simplify technical complexity, help users cope with rapidly changing needs, and achieve flexible and highly available services, which will be illustrated through specific cases and scenarios.
Nowadays, all walks of life are talking about digital transformation, especially new retail, media, transportation and other industries. Digital business has become the mainstream, gradually replacing traditional business forms. In other industries (such as industrial manufacturing), although the business form of enterprises is not shown in the form of digitalization, under the concept of digital twins, making full use of data technology to optimize production and operation is becoming a research hotspot and industry consensus.
Enterprises carry out digital transformation from four aspects: means of production, production relations, strategic planning and growth curve:
Means of production: data becomes the most important means of production, demand/risk changes at any time, and enterprises face great uncertainty;
Production relations: fixed production relations that are not based on processes and rules and are data centric. The network effect enables the production relations to span the time and space constraints, and various connection modes have expedited the birth of new businesses and varieties;
Strategic planning: make decisions based on data to quickly respond to uncertain business environment;
Growth curve: The ability brought by digital technology reaches a large number of users, which can bring breakthrough growth. From the perspective of cloud service providers, the evolution trend of the cloud, in the cloud 1.0 era, the cloudization of infrastructure is its theme. With cloud hosting mode, applications under the cloud remain compatible, and traditional applications can be directly migrated to the cloud. The core value of this method lies in the flexibility of resources and low cost; After the infrastructure provides massive computing power, how to help users make better use of computing power and speed up enterprise innovation becomes the core capability of the cloud.
If the basic application is still built on the server, the cost of R&D will be very high, and the management will be very difficult. Therefore, there is Cloud 2.0, which is the cloud native era. In the cloud native era, cloud service providers provide rich hosting services to help enterprises transform and innovate digitally. Users can build applications based on various cloud services like building modules, which greatly reduces R&D costs.
Cloud native application elements
Cloud local applications have three key elements: microservice architecture, application container and serverless, and agile software delivery process.
1. Microservice architecture
The single architecture and microservice architecture have their own characteristics, as shown in the following figure. Generally speaking, the single architecture moves quickly, but it is difficult to maintain and deploy the microservice architecture, but it is more independent and agile, and more suitable for cloud native applications.
Monolithic architecture vs microservice architecture
2. Application container and serverless
Container is the most popular way to package code. With the help of K8s and its ecological capacity, the management difficulty of the entire infrastructure is greatly reduced. And the container provides excellent flexibility and portability in program support. More and more users begin to use containers to encapsulate the entire application. Server less computing is another form. It has done a lot of end-to-end integration and cloud service integration, greatly improving research and development efficiency. However, the compatibility with traditional applications is not as flexible as containers, but it also brings great tidiness. Users only need to focus on the coding and innovation of business logic.
3. Agile Application Delivery Process
The agile application delivery process is a very important element, mainly including process automation, focusing on function development, quickly finding problems, and quickly releasing online.
Serverless computing
1. Alibaba Cloud function computing
Server free is a new concept, but its connotation already exists. The first cloud service of Alibaba Cloud or AWS is object storage, which is actually a serverless service in the storage field; In addition, serverless refers to a product system, not a single product. At present, most of the new functions or products launched by cloud service providers in the industry are serverless. Alibaba Cloud serverless product system includes computing, storage, API, analysis and middleware. At present, cloud product systems are becoming serverless.
The functional computing of Alibaba Cloud serverless computing platform has four characteristics:
Seamless integration with the cloud: various services in the cloud are seamlessly integrated with functional computing in an event driven manner. Users only need to focus on the development of functions, and the triggering of events is completed by the service provider;
Real time elastic expansion: the system automatically completes the elastic expansion of function calculation, which is very fast. Users can use this ability in online applications;
Sub second metering: sub second metering provides a complete on-demand metering mode, and the resource utilization rate can reach 100%;
High availability: The functional computing platform has done a lot of work to help users build high availability applications. So, how to do Alibaba Cloud function computing
How about four o'clock? The product capabilities of Alibaba Cloud function computing are shown in the following figure. First, function computing products are based on Alibaba's infrastructure services, and the computing layer above them has been greatly optimized. Then we developed a large number of capabilities and tools in the application layer. Based on the above product capabilities, we provided users with complete solutions in a variety of scenarios. Only then did we have the entire excellent function computing product. Function computing is a very basic cloud product of Alibaba Cloud. Many products and functions of Alibaba Cloud are based on function computing. At present, Alibaba Cloud function computing has provided services in 19 regions around the world.
Alibaba Cloud function computing product capability map
2. Serverless helps users simplify the complexity of high availability design and implementation of cloud native applications
The high availability of cloud native applications is a systematic project, including many aspects. The construction of a complete high availability system requires a lot of time and effort. So how does Serverless computing help users simplify the complexity of designing and implementing cloud native applications with high availability? As shown in the figure below, the points to be considered in the construction of a high availability system include the infrastructure layer, the runtime layer, the data layer and the application layer, and each layer has a lot of work to do to achieve high availability. Function calculation mainly focuses on fault tolerance, flexibility, flow control and monitoring to achieve high availability. The functions corresponding to the blue dotted box in the figure below are implemented by the platform, and users do not need to consider. Although the blue solid wireframe platform has done some work to simplify the difficulty of users' work, it still needs users' attention. The orange solid wireframe represents some functions that users need to be responsible for. The combination of functions provided by the platform and part of the user's energy input can greatly reduce the difficulty of users in building a high availability system.
Function calculation highly available
Function computing has been optimized in many aspects to help users build high availability systems. The following figure shows the capability of function calculation in disaster tolerance of the zone. It can be seen from the figure that the function calculation has done the corresponding load balancing, which has greatly improved the disaster tolerance capability.
Function to calculate multi zone disaster tolerance
The following figure shows the asynchronous processing of events by function computing. Its processing pipeline mainly includes three phases: event queue, event distribution, and event consumption. Each phase can be scaled horizontally. One of the key points is that the event distribution needs to match the downstream consumption capacity. In addition, users can easily and dynamically adjust the consumption speed of different types of events by specifying different amounts of computing resources for different functions. In addition, you can also customize the error retry logic, and have back pressure feedback and flow control, so that the next service will not be overwhelmed when a large number of requests are generated in a short time.
Asynchronous processing of function calculation events
In terms of the observability of function calculation, it provides log collection and query functions. In addition to the default simple log query function, it also provides advanced log query, which makes it easier for users to perform log analysis. In terms of indicator collection and visualization, function calculation provides a wealth of indicator collection capabilities, as well as standard indicators, overview information and other views, making it easier for users to carry out operation and maintenance work. The following figure is a schematic diagram of application delivery. In the entire application delivery process, only when every link is well done can an agile application delivery process be built. Its core is automation. Only when automation is achieved can the efficiency and agility of the entire pipeline be improved.
▲ Agile application delivery process
The following figure shows the specific tasks of the automated application delivery pipeline in each link. What needs to be noted is that the infrastructure, namely code, can be used for template definition and automatic setting of the application running environment, so as to achieve automated continuous integration.
Automated application delivery pipeline
After the automated delivery of applications, it will greatly help the overall R&D efficiency. On the serverless application, Alibaba Cloud provides a variety of tools to help users implement infrastructure, that is, code. The serverless model has a very good ability, that is, the same template can pass in different parameters to generate definitions of different environments, and then manage these environments automatically.
For the delivery and grayscale publishing of different service versions of the application itself, function computing provides service versions and service aliases to provide corresponding services. The grayscale publishing process of the entire application can be simplified into some API operations, greatly improving business efficiency. Through these capabilities provided by the Serverless computing platform, the automation of the delivery pipeline of the entire software application has been greatly improved.
Function calculation also has a very useful function - compatibility with stock application. With Custom Runtime, it can adapt to many popular frameworks and traditional applications, making it easy to adapt to the Serverless platform. The console provides a series of services such as application creation, deployment, associated resource management, and monitoring.
In addition to function calculation, serverless workflow can also be used to arrange different application links and different functions. The workflow can be defined by descriptive language, and each step can be executed reliably, which greatly reduces the difficulty of users in arranging complex tasks.
Application Scenario Case
There are several typical application scenarios for function computing. One is the Web/API back-end service. Alibaba Cloud has many successful applications, including Graphite Document, Weibo, and Century Hualian.
Another application scenario of function computing is large-scale data parallel processing. For example, uploading a large number of images, audio, text and other data to OSS can trigger functions to do custom processing, such as transcoding, frame truncation, and so on. Successful cases in this regard include Hupu, Focus Media, Baijia Internet, etc.
Another application scenario of function computing is real-time streaming data processing. For example, when messages and logs generated by different devices are sent to pipeline services such as message queues, functions can be triggered for streaming.
The last application scenario is the automation of operation and maintenance. Functions are called to complete operation and maintenance tasks through timed triggering, cloud monitoring event triggering, process choreography, etc., greatly reducing the cost and difficulty of operation and maintenance. Typical successful cases include Tucson Future.
Tucson Future is an AI enterprise focusing on the R&D and application of L4 level driverless truck technology, providing the world with driverless truck technology that can be commercialized on a large scale, enabling the global logistics and transportation industry. A large amount of data will be generated during the road test, and the processing flow of these data is complex and changeable. Even for the same batch of data, different business groups will have different use and processing methods. How to effectively manage different data processing processes and reduce the frequency of human intervention can significantly improve production efficiency.
The characteristics of road test running irregularly make the running time and running time of the process scheduling task extremely uncertain. It is difficult for the local computer room to establish a process management system alone to maximize the utilization of the machine, resulting in a waste of resources. In the future, Tucson has many local unit business processing scripts and applications, but due to various restrictions, it is unable to fully migrate to the cloud, which also poses challenges to how to rationalize the use of cloud services.
In view of the above situation, Tucson will begin to explore the automation of the data processing platform in the future. Alibaba Cloud Serverless workflow is billed according to the number of times of execution and scheduling. It has many advantages, such as easy to use, easy integration, simple operation and maintenance. It can solve the problems encountered in the above scenarios very well, and is very suitable for such offline task scenarios that run irregularly.
Serverless workflow also supports the task of arranging local or self built machine rooms. In the future, Tucson will use the message service MNS, which is natively supported by Serverless workflow, to solve the problem of data connection between cloud and cloud, so that the original local tasks can be well arranged and managed.
In addition to scheduling, Serverless workflow also supports the maintenance of task status and data generated during execution. In the future, Tucson has effectively managed the life cycle of each task in the process and the data transmission between them by using the task input/output mapping and status reporting mechanism.
In the future, with the expansion of business scale, Tucson will continue to optimize the operation efficiency and automation level of offline big data processing process in the future. Through various explorations, Tucson will further improve the efficiency of the engineering team and invest more energy and funds in business innovation in the future.
summary
Serverless workflow is a key part of Alibaba Cloud's serverless product system. Through serverless workflow, users can organize multiple AliCloud services such as function computing, visual intelligence platform, or self built services into workflows in a simple and intuitive way, and quickly build elastic and highly available cloud native applications.
Since the function calculation was launched in 2017, the service has expanded and shrunk flexibly in real time and intelligently according to the change of application load, completing the scaling of tens of thousands of instances in one minute and ensuring a stable delay. At present, it has supported the key applications of users such as Weibo, Mango TV, BGI, Tucson Future, and Graphite Technology to easily cope with business peaks.
Course recommendation
In order for more developers to enjoy the dividends of Serverless, this time we gathered 10+Alibaba Serverless technical experts to create the most suitable serverless open class for developers to start, so that you can learn and use now and easily embrace the new paradigm of cloud computing - Serverless.
Click to watch the course for free: //developer.aliyun.com/learning/roadmap/serverless
“ Alibaba Cloud Native focuses on technology fields such as microservices, Serverless, containers, and Service Mesh, focuses on popular technology trends of Cloud Native, and large-scale landing practices of Cloud Native, so as to become the public account that best understands the developers of Cloud Native. "