Abstract: Serverless architecture does not eliminate servers, but relies on the third-party cloud service platform. The server logic runs in stateless computing containers, and the state of its business level is recorded by the database and storage resources used by developers.

What is Serverless

We ask the question in the title, does the Serverless architecture not require servers? To answer this question, we need to know what Serverless is.

Serverless architecture has frequently appeared in the titles of some technical architecture conferences in recent years. Many people just take Serverless architecture literally, but what it really means is that developers don’t have to think too much about servers anymore, but it doesn’t mean that servers are completely eliminated. However, we rely on the third-party resource server backend. Since 2014, after so many years of development, all major cloud service providers have basically provided Serverless service.

How did the architecture evolve to Serverless?

Look at the evolution of cloud computing over the past few decades. In general, the development of cloud computing can be divided into three stages: the emergence of virtualization, virtualization in cloud computing applications and the emergence of containerization. The rapid development of cloud computing is concentrated in the past decade.

To summarize, there are the following milestones:

  • The virtualization technology is used to virtualize a large physical machine into a single VM resource.
  • Move the virtualization cluster to the cloud computing platform and perform simple O&M.
  • Each VM is divided into thinner Docker containers according to the principle of minimizing the running space.
  • Build Serverless architecture based on Docker container without managing any runtime environment and only need to write core code.

From the deployment application of bare metal machines, to the division of Openstack architecture and virtual machines, and then to containerized deployment, typical of which is the popularity of Docker and Kubernates in recent years, which further develops into a micro-service or micro-function to respond to a client’s request. This approach is the natural progression of cloud computing.

IT is also an evolution of IT architecture through a series of generational technological changes that slice resources more finely, make operations more efficient, and make hardware and software easier to maintain. The evolution of IT architecture has the following characteristics:

  • The granularity of hardware resource usage becomes smaller
  • Resource utilization is increasing
  • Operation and maintenance work gradually reduced
  • Business is more focused at the code level

Components of the Serverless architecture

The Serverless architecture is divided into Backend as a Service(BaaS) and Functions as a Service(FaaS). Serverless is a server logic implemented by developers that runs in stateless computing containers. It is triggered by events and is completely managed by third parties.

What is the BaaS?

Baas backend is a service. Its application architecture is composed of a large number of third-party cloud servers and APIS, so that the logic and status of the server in the application are managed by the service provider. For example, our typical single-page application SPA and mobile APP rich client application, the front and back end interaction is mainly RestAPI calls. You only need to invoke the API of the service provider to complete corresponding functions, such as common authentication, cloud data/file storage, message push, application data analysis, etc.

FaaS is what?

FaaS can be called function as a service. Developers can directly deploy the service business logic code and run it in a stateless computing container provided by a third party. Developers only need to write the business code without paying attention to the server, and the execution of the code is triggered by events.

The application architecture of Serverless is a combination of BaaS and FaaS. Users only need to pay attention to the business logic code of the application, write functions for granularity to run it on the FaaS platform, and integrate it with BaaS third-party services, and finally build a complete system. The entire system process does not need to pay attention to the server.

Serverless architecture characteristics

In summary, the Serverless architecture has the following characteristics:

  • Fine – grained computing resource allocation is implemented.
  • No pre-allocation of resources is required.
  • With a real sense of high capacity expansion and flexibility.
  • On demand, charge on demand.

Due to the decoupling of Serverless applications and servers, resources of cloud service providers are purchased, which reduces the o&M pressure of Serverless architecture and eliminates the need to estimate and purchase server hardware.

The Serverless architecture allows developers to focus more on the implementation of business services, with middleware and hardware server resources hosted to cloud providers. This also reduces development costs, scaling and billing on demand, regardless of infrastructure.

Serverless architecture also brings convenience to the front end, the cost of the large front end to the business end is reduced, the developers only need to pay attention to the business logic, and the front end engineers easily become full-stack engineers.

What are the application scenarios of Serverless?

Application scenarios are closely related to the characteristics of Serverless architecture. According to these general characteristics of Serverless, the following typical application scenarios are summarized: elastic scaling, big data analysis, event triggering, etc.

Elastic scaling

Due to the event-driven and single-event nature of cloud functions, cloud functions support high concurrency through automatic scaling. According to the actual number of events or requests, the cloud function automatically elastic appropriate processing instances to bear the actual traffic volume. When there are no events or requests, there are no running instances and no resources. For example, the audience of live video broadcasting is not fixed, so moderate concurrency and flexibility should be considered. Livestreaming is impossible to be online 24 hours a day, and there are obvious business access peaks and valleys. Livestreaming is the scene of events or public explosion. The update speed is fast, version iteration is fast, and the technology upgrade of new hot spots needs to be completed quickly.

Big data analysis

The statistics themselves require very little computation, and off-line calculations generate graphs. Data is processed when it is idle, or when there is no delay to consider.

  • Developers write code, currently supported languages Java, NodeJS, Python and other languages.
  • Upload the code to the function calculation through the API or SDK, the console page, or the command-line tool Fcli.
  • Function computed execution can be triggered by the API&SDK, as well as by the event source of the cloud product.
  • During the execution of function calculation, the function calculation will be dynamically expanded according to the amount of requests requested by users to ensure the execution of peak requests. This process is transparent and unaware to users.
  • The function completes.

Events trigger

Event triggering means that cloud functions are driven by events, which can be defined as specified HTTP requests, database binlog logs, message push, etc. Through Serverless architecture, event source notification is configured on the console and business code is written. When the business logic is added to the function calculation, the function calculation will scale dynamically at peak times without managing the hardware and software environment. Common scenarios, such as videos and OSS images, are filtered, converted, and analyzed to trigger a series of follow-up operations, such as invalid content and capacity alarms.

summary

To return to the title of our article, the Serverless architecture does not eliminate servers, but relies on a third-party cloud service platform. The server logic runs in a stateless computing container, and its business-level state is recorded by the database and storage resources used by developers.

The Serverless architecture has its application scenarios, but it also has limitations. In general, the Serverless architecture is not mature enough and has many imperfections. Serverless relies on the infrastructure provided by cloud service providers. Currently, cloud service providers cannot achieve true platform high availability. Serverless resources are cheap, but building an application in a production environment can be complex.

As cloud computing continues to evolve and infrastructure services improve, developers will become more focused on implementing business logic. Cloud computing shifts the responsibility of platform, middleware, and O&M deployment, and reduces cloud costs for smes. Let’s look forward to the future of the Serverless architecture.

This article is shared from huawei cloud community “[Huawei cloud experts original] Serverless architecture does not need a server?” , author: Aoho.

Click to follow, the first time to learn about Huawei cloud fresh technology ~