In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you what is Serverless, the content is very detailed, interested friends can use for reference, hope to be helpful to you.
What is Serverless?
Today I'm going to take you to learn more about Serverless and see what it is.
What problem can Serverless solve?
From the literal meaning, Serverless contains two parts: server and less. Server here refers to the server, which is the boundary of Serverless to solve the problem; while less can be understood as less care, it is the purpose of Serverless to solve the problem, so, together, Serverless means "less care about the server".
What is the server?
Let's take a look at Server first. Here I use Web to apply the classic MVC architecture as an example.
The MVC architecture is mainly divided into the front end and the back end, the front end is responsible for the experience of the customer terminal, that is, the View layer; the back end is responsible for the business logic and data processing of the business, namely the Control layer and the Model layer. If you have some development experience, you should know how your code flows when developing and debugging locally.
Usually we start a port number on our own computer, such as 127.0.0.1virtual 3001. By accessing this address, the browser can call and debug its own code. But if we want to deploy this Web application to the Internet and provide it to Internet users, we need the operation and maintenance knowledge of the server.
If you want to consider disaster tolerance and fault tolerance, you can deploy multiple Web application instances to ensure more activity in different places. In order to enable multiple Web application instances to switch traffic stably in disaster-tolerant and fault-tolerant scenarios, we need to use load balancing service and reverse proxy service. Load balancer service, as its name is, is responsible for evenly distributing traffic to various application machines; the common reverse proxy is Nginx, which parses domain name information from the request and forwards the request to the listening address of the upstream upstream.
The boundary of the server, which is the entire blue part of the image above, is the online operation and maintenance that is responsible for the application or code. The boundary that Serverless solves the problem is the boundary of the server, that is, the operation and maintenance of the server.
Server-side operation and maintenance history, from Serverfull to Serverless
We can first look at the concept of Serverfull, and then compare the difference between Serverfull and Serverless. I believe this will deepen your understanding. Serverfull means that we are responsible for the operation and maintenance of the server, while for Serverless, we are less responsible for the operation and maintenance of the server, and most of the operation and maintenance work is left to automation tools.
Maybe that's a little abstract. Let me give you an example.
Suppose I own an Internet company and my product is the "ToDoList" Web app-records management of each user's to-do list. For the research and development of this website, we are simplified to two independent roles: the R & D engineer Xiao Cheng and the operation and maintenance engineer Xiaosu.
As a research and development engineer, he is a full-stack engineer proficient in front and rear, but he is only concerned with the business logic of the application. Specifically, Xiao Cheng is responsible for the development, upgrade and problem fix of Web applications of the entire MVC architecture. The small server in charge of operation and maintenance is only concerned with the server operation and maintenance affairs of the application. For example, it is responsible for deploying Web applications, binding domain names and log monitoring. Expand the capacity of the application when the user visits are large; reduce the capacity of the application when the user traffic is small; restart or change the server when the server is down.
In prehistoric times, Serverfull
At first, the small server of the operation and maintenance engineer promised to cover all the matters of operation and maintenance, and Xiao Cheng did not have to care about anything related to the deployment of operation and maintenance. As a result, every time Xiaocheng releases a new application, he will call Xiaofu to deploy the latest code online. Xiaosu should manage the release of iterative version, merge branches, put the application online, and roll back if you encounter problems. If there is a fault on the line, we should also grab the log on the line and send it to Xiao Cheng to solve it.
Through the arrangement of job responsibilities and tasks, Xiaocheng and Xiaosu completely separate R & D from operation and maintenance. The benefits are obvious: the division of labor is clear, and Xiaocheng can concentrate on doing his own business; the defect is also obvious: Xiaosu has become a tool person, trapped in a large number of operation and maintenance work, dealing with a variety of release-related chores.
In this era, R & D and operation and maintenance are isolated, and the service-side operation and maintenance are all handed over to Xiao Fu alone, purely human processing, that is, Serverfull.
In the farming era, DevOps
We can stop and think that, in fact, tasks like releasing versions and dealing with online failures should be the responsibility of Xiao Cheng, not all assisted by small servers, right?
In fact, Xiaofu gradually found that there are many repetitive tasks in daily life, especially when releasing a new version, instead of waiting for small-range calls every time, and catching logs and sending them every time there is something wrong online, which is very inefficient, it is better to do a set of operation and maintenance console OpsConsole by yourself, and let Xiao Cheng handle the work of deployment online and log crawling.
Just do it. After the launch of OpsConsole, the small service is indeed a little easier, but optimizing the structure to save resources and expand the capacity of the resource plan still requires regular review of small services. In addition to the task of development, Xiaocheng has to deal with it on the OpsConsole platform every time he releases a new version or solves an online failure.
This era is R & D and operation and maintenance DevOps, Xiao Cheng also served as part of the work of small service, small service will be part of the server operation and maintenance work tools, they can do more professional things.
Compared with prehistoric times, the small clothes of the farming era have already turned part of the human work into tools, and as a result, the efficiency has become higher. At this time, there has been a trend of Serverless.
Let's think about whether we can further improve the efficiency, so that Xiao Cheng can not even use the OpsConsole platform.
In the industrial age, Serverless
Xiaofu found that resource optimization and capacity expansion solutions can also be solved by performance monitoring and traffic estimation, so Xiaofu further optimized the OpsConsole system based on the development process of Xiaocheng, and helped Xiaocheng do a set of automatic code release pipeline: code scanning-testing-grayscale verification-online. Now small programs do not even have to log in to OpsConsole, as long as the latest code is merged into the develop branch specified by the Git warehouse, and the rest will be automatically processed and released by the pipeline.
In this era, R & D does not need operation and maintenance, which is exempt from operation and maintenance NoOps. The server-side operation and maintenance work of Xiaosu has been fully automated, and Xiaocheng has changed back to the beginning. You only need to care about your own application business.
It is not difficult to see that in the development history of server operation and maintenance, for Xiao Cheng, the role of small service is getting weaker and weaker, and the things that need to be involved in small service are less and less, which are replaced by automation tools.
When you come here, you must think, since the server has been exempted from operation and maintenance, is Xiaosu changing its own life and losing its job?
The future
The realization of operation and maintenance-free NoOps does not mean that small services will lose their jobs, but that small services will be transformed to do lower-level services, infrastructure construction, and provide smarter, more resource-saving and more thoughtful services. Xiao Cheng can not be bothered by the operation and maintenance at all, rest assured to boldly rely on Serverless services, focus on doing a good job of his own business, enhance user experience, and think about business value.
The exemption of operation and maintenance NoOps does not mean that operation and maintenance on the server does not exist, but covers all the needs of R & D deployment through omniscient and omniscient service, so that R & D students have less and less perception of it. In addition, NoOps is ideal because we can only approach NoOps infinitely.
In addition, you need to know that most Internet companies, including first-tier Internet companies, are still in the DevOps era. It's just that the concept of Serverless has been put forward, and the era of NoOps is coming.
According to the above decomposition, Serverless can be called server-side operation and maintenance-free, which is the problem that Serverless wants to solve.
What exactly is Serverless?
To sum up, there are two meanings of Serverless:
First: narrow Serverless (most common) = Serverless computing architecture = FaaS architecture = Trigger (event driven) + FaaS (function as a service) + BaaS (back end as a service, persistence or third party service) = FaaS + BaaS
Second: generalized Serverless = server-side operation and maintenance-free = cloud services with Serverless characteristics
Let me use pictures to illustrate these two concepts.
Although you can see that the broad sense of Serverless contains more things and has a wider range of applications, the Serverless that we often mention in our work generally refers to the narrow sense of Serverless. There are historical reasons for this. In November 2014, Amazon launched its first real Serverless FaaS service: Lambda. The concept of Serverless has just entered the vision of most people, so Serverless was once equal to FaaS.
There are some strange nouns in the picture. Let me explain them to you first. FaaS (Function as a Service) is a function as a service, and BaaS (Backend as a Service) is a back-end as a service. XaaS (X as a Service) is an X-as-a-service, which is a popular naming method used by cloud service providers, such as SaaS, PaaS and IaaS that we are familiar with.
Let's start with FaaS, a function as a service, and it's also called Serverless Computing, which allows us to create, use, and destroy a function anytime, anywhere.
You can think about the usual process of using a function: it needs to be loaded from the code into memory, that is, instantiated, and then executed when it is called by other functions. The same is true in FaaS, where the function needs to be instantiated and then called by the trigger Trigger or other functions. The biggest difference between the two is in Runtime, that is, the context of the function, the context in which the function is executed.
The Runtime of FaaS is preset. The functions and resources loaded in Runtime are provided by cloud service providers, which we can use but cannot control. You can understand that the Runtime of FaaS is temporary. After the function is called, the temporary Runtime is destroyed together with the function.
After the function of FaaS is called, the cloud service will destroy the instance and reclaim resources, so FaaS recommends stateless functions. If you are a front-end engineer, it may be easy to understand that functions are immutable Immutable. To explain it briefly, that is to say, as long as the parameters of a function are fixed, the result returned must also be fixed.
Take the Web application of our MVC architecture as an example, the View layer is the content presented by the client, which usually does not require the computing power of the function; the Control layer is a typical usage scenario of the function. In MVC architecture, a HTTP data request will correspond to a Control function. We can use the FaaS function instead of the Control function. When the data request volume of HTTP is large, the FaaS function will automatically expand the capacity of multiple instances to run at the same time; when the data request volume of HTTP is small, it will automatically scale down; when there is no HTTP data request, it will also scale down to 0 instances, saving money.
At this moment, you may be a little confused. Runtime is uncontrollable, the FaaS function is stateless, and the instances of the function are constantly expanding and shrinking. What if I need to persist and store some data? what about the Model layer in MVC?
At this point, I would like to introduce another guest-BaaS.
BaaS is actually a collection, which refers to the back-end services with high availability and flexibility, and free of operation and maintenance. To put it simply, it is a service that specifically supports FaaS. FaaS is like the front of a high-speed train. If our back-end service is still an old green train car, it will definitely fall apart, and BaaS is a high-speed train car specially prepared for FaaS.
The Model layer in MVC architecture requires us to use BaaS to solve it. In the Model layer, we take MySQL as an example. In the back-end service, it is best to package the commands of the database operated by FaaS into the OpenAPI of HTTP, provide them to FaaS calls, and control the request frequency of this API and the current limit and degradation. The back-end service itself can be optimized through connection pooling, MySQL clustering, and so on. The major cloud service providers are also transforming their own back-end services, and the collection of BaaS is also growing.
Based on the Serverless architecture, we can transform the traditional MVC architecture into the combination, reconstruction or implementation of BaaS+View+FaaS.
From this point of view, the meaning of Serverless in a narrow sense is not difficult to understand.
First: narrow Serverless (most common) = Serverless computing architecture = FaaS architecture = Trigger (event driven) + FaaS (function as a service) + BaaS (back end as a service, persistence or third party service) = FaaS + BaaS
There is no doubt that Serverless is popular and recognized because of the FaaS architecture. So our most common Serverless refers to Serverless Computing architecture, that is, applications composed of Trigger, FaaS and BaaS architecture. This is also my definition of Serverless in a narrow sense.
So what is Serverless in a broad sense?
Push the narrow sense of Serverless to the broad sense, with the following characteristics, is the Serverless service. You can recall the work of Xiaosu, what conditions should you have to achieve NoOps?
Job responsibilities of Xiaosu:
There is no need for users to care about the server (fault tolerance, disaster tolerance, security verification, automatic scaling, log debugging, etc.).
Pay by usage (number of calls, duration, etc.), low cost and high performance in parallel, saving money in most scenarios.
Fast iteration-trial and error capability (multi-version control, grayscale, CI&CD, etc.).
In a broad sense, Serverless, which means that the server is free of operation and maintenance, is also the main trend in the future.
To sum up, when we talk about Serverless, we basically refer to the narrow sense of Serverless, but when we mention the Serverless of a service, we often refer to the broad sense of Serverless.
In the narrow sense, Serverless refers to the application developed with the Serverless architecture of FaaS+BaaS; in the broad sense, Serverless is a cloud service with Serverless characteristics. Now cloud service providers are actively Serverless various cloud services they provide.
On what is Serverless to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.