From cloud computing to function computing

Function calculation, your name

Cloud computing is an Internet based computing method in which shared software and hardware resources and information can be provided to various terminals and other devices on demand, using computer infrastructure provided by service providers as computing resources. Therefore, using "cloud" to refer to "network computing resources" is a very appropriate metaphor.

The National Institute of Standards and Technology (NIST) defines three service modes in cloud computing, namely software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS).

Alibaba Cloud's products can fully cover these three service modes. If you take one example, it should be: Itachi (SaaS Accelerator), functional computing FC, and cloud server ECS.

Serverless computing services, which are based on PaaS and different from PaaS, are more often referred to as Function as a Service (abbreviated as FaaS). Functional Computing FC is Alibaba Cloud's event driven fully hosted serverless computing service product. I think the name of Functional Computing Function Compute was born in this way.

Function Calculation, Direct to the Core of Applications

We know that the core of an application is logic and storage, while the code mainly implements business logic and persistence.

The overall function calculation FC is: FaaS+BaaS

Function refers to a calculation function that contains the business logic part, which is implemented by FaaS; Data persistence, message push, and account system are implemented by BaaS.

ECS ? FC ?

The Serverless service is not without servers anymore, but as a new architecture, it has further reduced our work on traditional application maintenance in the past.

Taking a common web service mainly based on cloud servers as an example, there is generally the following process:

During the service process, the server may involve routing rules, authentication logic, and various other complex business codes. At the same time, the development team should not only focus on development, but also devote a lot of energy to the operation and maintenance of the server. For example, always pay attention to the following issues:

• Can the server performance cope with possible sudden user requests, and when will it be expanded?

• How much of the scripts and business code on the server are still running healthily?

• How to ensure data security when external network security threats come?

Faced with many problems, it will indeed cause a big headache, but if we abandon the server based architecture and switch to the Serverless architecture; The process of serving becomes this:

When the client and database have not changed, the server becomes a Serverless architecture. The division of work has undergone significant changes.

For example, the routing module and authentication module that previously needed to be maintained by the development team will be connected to the API gateway system and authentication system provided by the service provider. The development team does not need to maintain the business code of these two parts anymore, just need to continuously maintain relevant rules, and no longer need to worry about application construction; The business code is divided into functional granularity, with different functions representing different functions. According to the request volume, it can also achieve millisecond level expansion; Some security issues and resource scheduling issues outside of the business logic are all handled by the cloud vendor.

In addition to the ease of developing and maintaining products, it can also achieve cost reduction and efficiency improvement in terms of specific implementation costs. Compared to the 24/7 operation of traditional project services, function computing FC is based on event driven, and functions are only activated and executed when a user initiates a request. Running costs are charged as needed, and there is a significant price advantage over cost savings plans.

Functional computing FC: liberating productivity and focusing more on the application business itself

Using cloud servers, we don't have to worry about the operation and maintenance of physical computer rooms and other content under the operating system layer; Using functions to calculate FC, we no longer need to install the operating system, container configuration, and running environment, let alone worry about the environment program hanging up.

It can be seen that after using the serverless architecture of FC to calculate functions, users only need to operate and maintain application related functions, and there is only one thing left to worry about under the ECS architecture:

Functional computing is like a completely new technological revolution. When we use the Serverless architecture of functional computing FC:

The development team no longer needs to maintain the server itself, nor need to worry about various performance indicators and resource utilization rates of the server. The team's operation and maintenance can focus more on monitoring the metrics of the application itself.

Deployment of applications will become very easy. We only need to upload basic code without using Puppet, Chef, Ansible, or Docker for configuration management, greatly reducing operation and maintenance costs.

In summary, compared to traditional projects, functional computing FC has the following advantages:

• Users do not need to purchase and manage infrastructure such as servers, resulting in low operation and maintenance costs and higher security. (Covers the advantages of cloud servers).

• Users only need to focus on the development of business logic, using the development language supported by functional computing to design, optimize, test, review, and upload their own application code. Combined with workflow, code submission is automatically deployed and run directly!

• Function calculation FC triggers applications to respond to user requests in an event driven manner. Seamless integration with Alibaba Cloud object storage OSS, API gateway, log service, table storage, and other services helps quickly build applications.

• Simplify operation and maintenance, and provide functions such as log query, performance monitoring, and alarm to quickly troubleshoot faults.

• Don't worry about performance issues. The architecture is more resilient, with elastic scalability at the millisecond level, and enables rapid low-level expansion to cope with peak pressures.

• Low usage cost, pay on demand, and support 100 millisecond level charging. Just pay for the actually used computing resources, which is suitable for user access scenarios with obvious peaks and valleys.

Functional computing FC seems to truly realize the "cloud like" vision of cloud computing, which well illustrates the environmental concept of maximizing resource utilization, reducing idle resource waste, and the practical need to reduce learning and usage costs.

How to experience such a wonderful function calculation?

Function computing FC provides functions such as a runtime environment, developer tools, and function triggers. At the same time, the function calculation FC provides free execution times: 1 million (times) and free resource usage: 400000 (GB seconds). For small-scale online usage, we only need to pay for public network traffic and other resources.

The most commonly used method for creating function calculations is to enter the service and function sub page on the console and create the service and function in turn. A service can be composed of multiple functions, and a function can only belong to one service.

Of course, Alibaba Cloud provides a one-click in function computing console - application page, which we can create through template and warehouse import:

Currently, the template center in the public beta includes a total of 56 application or framework templates from various official or community sources, with a fairly comprehensive coverage. Under the guidance of official documents, it is possible to create FC applications on a zero basis.

From complex to simple, from long to short

Practice: Web short URL jump based on Node.js+Serverless

Main functions:

Realize mapping between long and short links.

Brief description:

The user can create a corresponding short chain for the specified URL

Users access the short chain and automatically jump to the corresponding URL

As mentioned above, building applications using functional calculations for FC is generally FaaS+BaaS. The following practical project involves the use of BaaS databases, and for convenience, uses a cloud development platform to build applications.

The application architecture diagram is as follows:

Resource preparation:

You need to register for a cloud development platform and activate the following services;

• API Gateway/API Gateway

• Function Compute

• Object Storage/Object Storage Service

• Log Service/Log Service

• MongoDB Serverless instance

Database section:

• Purchase MongoDB Serverless Edition.

• Creating a new set is actually equivalent to creating a new table. Create a collection: links, logs.

• Connect the Serverless instance through program code, and after completing the front-end static page, you can bind the domain name for online testing.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us