Author: Qiu Yuchen

foreword

With the continuous development of serverless architecture, various cloud vendors and open source communities have deployed the serverless field. On the one hand, cloud vendors have launched serverless versions of traditional services/businesses, or serverless computing platforms; Gradually enriched, whether it is platform-based, tool-based open source projects, or framework-based open source projects, they are all growing rapidly like mushrooms after a rain.

Behind such prosperity and development, any technology will be rapidly upgraded and iterated, and the serverless architecture is no exception. From the development process of Alibaba Cloud's FaaS products, it is not difficult to see that the serverless architecture is constantly scene-based on the road of improving efficiency and reducing costs. Specialization; the product form is also becoming more and more complete and unified. Although there is still a certain distance from the "Road to Simplicity", it is only a matter of time.

From idea to product upgrade

The serverless architecture is constantly developing, and both product form and technical architecture can be described with each passing day.

The change of serverless spirit

Initially, the serverless architecture refers to the combination of FaaS and BaaS. It is believed that developers can focus on more valuable business logic instead of spending more energy on underlying resources such as servers. This is also the point emphasized in the article "Serverless Architectures".

However, with the development of time, everyone found that the description of the serverless architecture is too thin, and it does not highlight the technical dividends that the serverless architecture brings to the business, nor does it show the mentality delivered by the serverless.

Therefore, UC Berkeley further defined the serverless architecture in "Cloud Programming Simplified: A Berkeley View on Serverless Computing": services/products considered to be serverless architectures also need to have the characteristics of pay-as-you-go and elastic scaling, and believe that long-term The operating mode of -run is not in the spirit of Serverless.

The development of cloud computing-related technologies often has a characteristic: cloud manufacturers are very driven, because cloud manufacturers are often the first to perceive universal user needs and have enough data to support them to make reasonable judgments and innovations. Therefore, the innovation of serverless architecture is often driven by manufacturers; with the development of event-driven and function computing, manufacturers gradually find that the mode of "short-term operation" of function computing cannot meet the demands of more users. Serverless computing services in the long-run mode are gradually being hatched. So far, the serverless architecture has gradually improved from its initial thinness. Through "self-innovation", it has completed a new round of self-enrichment of business capabilities and self-improvement of product functions.

As the long-run mode is gradually recognized by developers, the definition of traditional serverless architecture is a bit "incompatible": it can neither cover the latest serverless product latitude in the mode, nor describe the characteristics of serverless in form.

At this point, the definition of the serverless architecture is naturally upgraded, for example:

  • Serverless should be FaaS + BaaS + CaaS,
  • Serverless should be FaaS + BaaS + Others,
  • Serverless is Server + Less, that is, the form of server-free operation and maintenance/low operation and maintenance is the real Serverless architecture.

So far, the serverless architecture has realized the upgrade of product form and the change of serverless spirit at this stage.

From functions to more serverless

Through Alibaba Cloud's official website, it is not difficult to find that its serverless product form is relatively complete:

  • Computing platform: from function computing to container image to microservice form;
  • Basic products/services: Serverless forms of storage products, databases and other products;

The popularity of the serverless architecture continues to increase, and each product also needs to make further breakthroughs and innovations through the popularity, so it is inevitable that the word serverless will be "indiscriminately used"; each team has its own characteristics, and based on the serverless architecture, it is also necessary to improve and change its own capabilities. The only way for product development is just like the development of databases to cloud databases, then to cloud-native databases, and then to serverless databases;

Therefore, the serverless architecture needs a "glue" to further link various serverless products, so that it is not "some products mixed in many products", but "specific functions that can be combined to solve a problem. ”, in other words, combining different products together to provide developers with scenario-based support from the application dimension, which is also the only way for the serverless architecture to develop from resources to applications and then to business.

Launched the "application concept", trying to use the computing platform and core, through the linkage of BaaS products, to gradually make the "cluttered garden" become regular and organized; It becomes a scenario-based recommendation and a process-based guidance.

Product and feature experience

This event is an evaluation of Alibaba Cloud Serverless Function Computing, so this article only provides an experience of Function Computing and its related products, including Function Computing itself (including three main modules: basic module services and functions and upper-layer encapsulation module applications and tasks), Serverless work Streams and the open source project Serverless Devs.

Alibaba Cloud Function Computing

Services and Functions

The functions of functions and services are shown in the following figure:

 title=

The product form of function computing is a two-layer structure: service and function.

  • Service: A logical relationship that represents a collection of functions and some public configurations; that is, a collection of functions with specific properties;
  • Function: An exact resource or business logic; consists of code, triggers, and related configuration;

The two-layer concept of function computing brings certain convenience to development:

  • Clearer business division: It allows developers to more clearly divide the same type of business/function under one service, which not only makes the page clearer, but also makes management (including resource allocation, authority division, billing, etc.) more convenient;
  • Make the environment division easier: After classifying the business through services, it is helpful to divide the environment based on services. The division of different environments through services is more convenient and acceptable than the division of environments for functions;

The process of getting started with function computing is relatively simple. Through the function computing document, you can see the overall process:

 title=

That is, developers only need to complete the development and deployment of the code to realize the elastic scaling of the business and the blessing of the pay-as-you-go capability, which is also in line with the specification of the serverless architecture process defined by the CNCF in the white paper. You can quickly experience this process through the Alibaba Cloud Function Compute console. Click the "Services and Functions" option to see the list of services:

 title=

At this point, you can create services and functions as needed:

 title=

After completion, you can edit the code and test online:

 title=

So far, the function calculation has been completed. During the whole process, there are several obvious feelings:

1. The process of starting from scratch is relatively smooth. As long as you pay more attention to the label information and have some R&D experience, you can quickly create services and functions;

2. Alibaba Cloud's function computing functions are relatively comprehensive, including single-instance multi-concurrency, reservation, version & grayscale, observability, etc., which can meet most application scenarios, even if some frameworks are lost due to serverless architecture Some features can also be solved through the capabilities provided by the product side;

3. The observability is relatively complete. Starting from trace, log, metrics and other aspects, it can meet most of the observability needs of developers. In addition, the real-time log function of the console page is worthy of praise. Debugging is very helpful; the log search function needs to be strengthened, for example, if you want to quickly find out the context of the log, you need to further rely on the log service, etc.;

4. WebIDE is very powerful. You can write code and build projects online through the allocation of computing resources. However, the environment of WebIDE and the environment of function computing are still unreasonable. If you do not study and experience carefully, you will be misunderstood. Debugging in WebIDE is just Debugging in function environment;

5. The HTTP functions unique to Alibaba Cloud Function Compute can easily migrate and deploy web applications to the serverless architecture, but HTTP functions and time triggers cannot be configured together;

6. The environment variables of Alibaba Cloud Function Compute do not have the Secret capability; environment variables often involve sensitive information, and whether the output can be encrypted is a manifestation of security;

7. Alibaba Cloud Function Compute has many code directories that are restricted from reading and writing, but not all runtimes are restricted from reading and writing. This kind of misalignment will make developers more confused, although many other manufacturers are like this. designed, but no one said the reason for this design;

8. Alibaba Cloud Function Computing has many functions/configurations, from services to functions, to modules such as observables and custom domain names. At present, it is difficult to quickly find some functions during use. For example, the configuration entry for reserved instances is often not found.

Task

In addition to services and functions, Function Compute has another module: tasks.

 title=

In the summary of the description of the task page, it is not difficult to see that it is actually a variant of the function:

 title=

Through the process of creating a task, and creating a task end page:

 title=

It can also verify the idea just now: the essence of the task is still function calculation, but:

  • The concept of service is weakened, and task creation can be completed through simple configuration;
  • The essence is another expression of functional asynchronous tasks, which abstracts asynchronous tasks into a function that allows developers to quickly create and publish tasks;

Since tasks are often asynchronous, it is very important to connect the entire link from upstream to downstream after being processed by functions. This is also a test of cloud vendor service consistency and observability.

Through the experience of the task, the overall feeling is relatively smooth. Through the abstracted productization capabilities, the creation process and steps of the task are more streamlined, which can help "specific developers to use quickly"; but it will also affect some novice users. Dilemma: What is the relationship between applications, tasks, services, and functions? What is the difference between a task and a function?

application

Like tasks, applications are built on services and functions; unlike tasks, applications are not just function computations. It can be considered that an application is a portal for linking other products or a management platform for serverless applications in function computing.

Through the application creation page, you can quickly experience serverless applications:

 title=

It can be seen that the big difference between applications and tasks, services and functions is that an application is a module with a very clear scenario, and all the creation and import processes are building a “scenario” mind.

Through the application creation page, you can see that there are applications in multiple scenarios such as framework, audio and video processing, and take the image compression as an example to experience:

 title=

Application creation can be completed quickly through guidance, and the entire process is the most streamlined. After the creation is complete, you can get the final experience page:

 title=

In the experience page, you can experience the functions of the current application.

The emergence of applications is undoubtedly a manifestation of the gradual "fighting" of multiple products in the serverless architecture, that is, developers manage applications instead of separate management of code and resources. Through application modules, developers can

1. Quickly experience serverless architecture; easy to learn and research serverless architecture;

2. Resource linkage can be carried out, and resources can be managed according to the application latitude, the permissions can be divided, and the business can be operated and maintained;

It is worth noting that the application function has a standard set of GitOps configuration by default. After deploying the application based on the code repository, it can be found that the application itself is implemented based on the Serverless Devs developer tools, which fully integrates the online platform and offline tools. Linkage can further ensure the consistency of developer experience to a certain extent. Also, after experimenting with the app module, some ideas arise:

1. As the product linkage entrance, the application module needs to involve other resource input. How to ensure that the resources of the application module can gradually "self-operate" will become one of the key points for the success of the application module (the so-called self-operation refers to the need for A fixed team actively improves the number and quality of applications, but more participants can do this work spontaneously);

2. The application module should belong to serverless to a certain extent, not just function computing, otherwise too small scope will limit the sustainable development and ecological evolution of the module;

3. As an application with standard GitOps configuration, the current CI/CD capability is too thin;

4. The function is not perfect, and the user experience after creation needs to be strengthened. For example, post-deployment "how to apply" guidance, observable how to do it...

Serverless Workflow

Serverless workflow can be regarded as an upgraded expression of task module to a certain extent. That is, the simple task module is based on function calculation and is asynchronous. On this basis, the serverless workflow increases the orchestration capability:

 title=

Tasks enabled by Serverless Workflow will:

  • Ability to orchestrate services;
  • Support long-running processes;
  • Process status management is possible;

After experiencing the Serverless workflow, there are also some thoughts:

1. Like the application module, if the scope defined by the serverless workflow is too small, it may only be the arrangement of function computing, which will make this function lose its competitiveness;

2. The overall experience of the workflow is relatively smooth. If the functions can be continuously optimized, the ease of use of the workflow will be higher;

Serverless Devs

There are three processes for getting started with Alibaba Cloud Serverless Devs:

  • Tool installation and configuration
  • Project initialization
  • Project development and deployment

Since the Serverless Devs project is published on Npm, developers need to configure the Node.js development environment before installation, and then install the tools through the npm tool. After the installation is complete, you can configure the key information through the s config command:

 title=

You can use the s init command to initialize the case code:

 title=

After completing the initialization, you can directly deploy the business:

 title=

After the deployment is complete, you can open the project through the browser and preview it:

 title=

Also based on these three processes, Serverless Devs can also be quickly integrated with common pipelines. Currently, the officially provided cases include Github Action, Gitee Go, Jenkins, and cloud effects, etc. But after reading the relevant documents, it is not difficult to find that, Even other pipelines are the same operation process.

For the serverless architecture of Alibaba Cloud, the greatest significance and value of the Serverless Devs developer tool should lie in:

1. Larger Scope, leaving more room for imagination;

2. It is the basis of product linkage. Through deployment, arrangement and componentization, more products can be linked;

3. The user experience upgrade can help you develop and experience Alibaba Cloud Serverless products, and quickly get started based on template cases;

From a development perspective, Serverless Devs developer tools address several common pain points in the serverless field:

1. There are many resources and services involved, and it is difficult to arrange and publish the whole in the pipeline;

2. "Pseudo proposition: Serverless does not require users to pay attention to the operating system and other content", but in the actual use process, users have to pay attention to the system, because this will affect the results of project packaging and construction;

3. Because the resources are too scattered and the environment is too independent, the debugging complexity of the Serverless architecture is very high;

Next Generation Serverless Exploration

User experience related

Further "unification"

It may be impossible for the world to be unified, but the outcome of technological development is a trend towards homogeneity.

The same is true for the serverless architecture. With the growing development of cloud native technology, the serverless architecture is no longer a simple product or form, but has gradually developed into an idea.

Based on the spirit conveyed by the serverless architecture, more and more serverless products have appeared. Although today, they are still "alone", but with the development of time, these products are destined to be "bonded" "agent" as the core, unified and consistent service for developers.

From addition to subtraction

Although there is no exact definition of serverless architecture, the mentality he wants to convey must not be more complex.

Therefore, in the future development process, one of the development directions of the serverless architecture is to do subtraction and reduce those "seemingly reasonable but unreasonable capabilities". For example, why reveal the various instance types (elastic, GPU, performance, meter, etc.)? Why do you need to configure reservations and elastic policies?

Perhaps, many reasons seem reasonable now, but from another dimension, it may be unreasonable, so doing subtraction is not only a kind of courage, but also a challenge to technology, and a challenge to the abstraction ability of products. challenge.

function exploration

Cloud development model

What's next for serverless architecture? This is a question that many people think about.

Function computing is just a computing platform. It can be played alone, but not alone. To be more easily accepted, the aggregation and linkage of resources is essential. Although the application module of function computing is linking more resources to a certain extent, this is only at the management level. After developers are exposed to the serverless architecture, development is also a very important part, so the cloud development model is worth considering.

low code mode

The serverless architecture can modularize many functions to a certain extent, and the further development of modularization may be a low-code mode.

The low code based on the serverless architecture is expected to apply the serverless idea to the product construction idea, and the modularized rapid deployment, update, smooth release and offline are also in line with the serverless idea.

Summarize

Serverless architecture, like cloud hosts and container services, will become a new infrastructure in the cloud computing era in the future; on the basis of maintaining infrastructure, providing developers with more scenario-based services is expected to become a breakthrough in serverless architecture. The breakthrough of the bottleneck.

In the future, Serverless will be a technical architecture idea of ​​"not unified in form, but very unified in goals". Developers can quickly use the Serverless architecture to build their own scenario-based applications with a more consistent experience. Of course, here The serverless includes different forms of services, such as databases, gateways, function computing, etc.

In summary, the serverless architecture is constantly developing, and the spirit of the serverless architecture is constantly changing. From function computing to application, from development, operation and maintenance to the whole life cycle, the serverless architecture has many questions to answer and things to do. More.

Author: Qiu Yuchen

Read the original text:

https://developer.aliyun.com/article/984858

1 Minute Serverless Blind Box

1-minute Serverless Blind Box Extraction! Use Alibaba Cloud Function Computing + Serverless Application Center to deploy and complete a scene experience, that is, you have the opportunity to get 1,300 yuan hidden models, mechanical keyboards, Tmall Genie and other surprise welfare blind boxes!

Every day from 8.1-8.12 on weekdays, first come first served!

 title=

Click here to deploy your exclusive blind box platform now!


阿里云云原生
1k 声望302 粉丝