How can SMEs effectively respond to the elastic change demand of computing resources?

The Development History of the Computing Stage

Ancient times

Long long ago, computers were extremely scarce resources. I once communicated with a university professor, who said that at the beginning, a university's computer department might have only one computer. Computers are so scarce that even if you have money, you may not be able to get the computing resources easily.

This era, which I would like to call the ancient era of computing resources, is characterized by scarcity!

medieval times

I just graduated from the club and entered a large state-owned commercial bank to engage in information technology. The first time I walked into the computer room, I was shocked by the rows of server computers. Looking at the lights flashing from time to time on those servers, I can imagine that they support the capital flow of tens of billions, hundreds of billions and trillions.

They are huge, powerful and stable, but - well - very expensive. Not only is the purchase expensive, but the cost of supporting computer rooms and operation and maintenance personnel is also high if you want these large servers to operate normally. If large enterprises can afford it, small and medium-sized companies will be powerless.

This era, I would like to call it the medieval era of computing resources, which is characterized by expensive!

Modern times

In 2018, when I entered a private enterprise, I found that most enterprises use ECS. The advantage of using ECS is that if the deployed program has a large number of accesses, high concurrency, and large amount of data, you can buy a higher configuration and more expensive one. If the deployed program is relatively simple and the number of visitors is not large, buy a lower configuration and cheaper one.

In addition, with the development of time, when the number of visits increases greatly, you can also spend money to upgrade the configuration. At the same time, if you use ECS, you don't need to build a separate machine room, nor buy a hardware router or firewall, which is not expensive in terms of cost. It's so popular that SMEs began to embrace ECS. I remember that when I worked in the company, I managed dozens of ECS servers, and added several each year.

In this era, I would like to call it the modern computing resource, which is characterized by high cost performance.

Contemporary

In fact, I have found some problems in my work for a long time, that is, our demand for computing resources is unbalanced in time and space.

For example, we have developed a school payment system, which is usually ignored. When the school sends the payment notice, the number of visitors to the system is huge. But when we buy a server, we have to buy it according to the situation that supports the maximum traffic. Isn't the remaining computing power usually wasted?

If there is a way to expand or shrink computing power flexibly according to needs, users only need to pay according to the actual amount of computing, that would be a considerable progress.

In addition, from the perspective of social development and the community with a shared future for mankind, it has greatly saved social resources and improved production efficiency. Alas, to my ignorance, although I have always had this idea, I do not know that it is a technology that has long been implemented in the field of cloud computing. And Serverless is one of the representative computing technologies, which has already come to us.

In this era, I would like to call it the contemporary era of computing resources. Its characteristics are fine and harmonious.

Concept of Serverless

Literally, Server is a server, less is a lack, and there is no server. Server free computing means that our programs are not deployed to various servers, but directly delivered to the cloud (such as Alibaba Cloud), which helps us coordinate computing resources and perform elastic computing.

Next, let's use the Alibaba Cloud Serverless function to calculate, to really experience it.

Fast experience

Product entrance

There are many Alibaba Cloud products. Let me first tell you how to calculate the FC location.

Create an app

After entering the function calculation product, we first need to create an application. An application can be understood as a background service, background project, etc.

Alibaba Cloud has many built-in application templates, such as the common SpringBoot, Django, Flask, etc., which are very good and powerful. Here I choose the familiar SpringBoot.

Apply deployment settings

As shown in the following figure, it is set to deploy application code through the Gitgee code repository. This is easy to understand. Our application is directly related to a Gitee code repository. If we want to deploy the application, we first submit the code to Gitee.

Note: Click the link at the red line in the figure above, and then log in to Gitee to complete the binding authorization of Gitee code to Alibaba Cloud Service.

After clicking Create, the following window will pop up and wait until the creation is completed.

Write code

When creating the project above, we specified the name of the Gitee code warehouse as [start spring boot jc]. We cloned the warehouse to the local. The project code structure is as follows:

Open the pom.xml configuration file. It's familiar. It's a pure SpringBoot project, version 2.1.8. Since Alibaba Cloud developers have chosen this version, it should be very stable and excellent.

Next, look at the startup class. We can easily guess that welcome is the default entry for our application.

Come on, how can I witness my generation of Java full stack programmers without any modification!

Code deployment

Submit the code to the warehouse, and click the red line to enter the application details:

In the deployment history, I was surprised to find that it has been automatically deployed. If you want to ask me how I found it, just look at the time. This shows that Alibaba Cloud has done a good job. It automatically discovers code updates and then automatically triggers deployment. This one is worth praising!

Access test

At the top of the application details page, click to access the domain name:

The following page interface pops up, and you're done.

Analysis of common use problems

How to develop your own business logic

If you are familiar with SpringBoot, this problem should be very simple.

You can configure the dependency in pom.xml, then write the service class, and finally call the encapsulated service class in the welcome method. The running results can be displayed through the webpage, of course, some background calculations can also be displayed without the webpage.

How to configure a formal domain name

When the project is officially launched, we often want to use the official domain name. You can enter the function calculation homepage, click [Domain Name Management Menu], and then click [Add User defined Domain Name]:

As shown in the figure below, we can associate our domain name with the functions in the application.

Instance type and environment configuration

Click the [Configuration] button in the red circle in [Service Management] - [Function Management].

As shown in the figure below, you can configure the instance type and environment information, such as memory, concurrency, and instance type.

Note that memory refers to the maximum memory for function execution, and concurrency refers to how many requests a function can process at the same time.

How to select an instance type

There are three types of instances. The following is an official description of Alibaba Cloud. I think it is well written, so I won't explain it too much.

• Elastic instance: basic instance of function calculation, mainly applicable to sudden traffic scenarios, such as activities, large-scale promotions, red packets, etc.

• Performance instance: Large scale instance with higher resource ceiling, mainly applicable to computing intensive scenarios, such as audio and video processing, AI modeling, enterprise Java applications, etc. When you select a performance instance, your function will run in the instance with higher computing power.

• GPU instance (in public test): GPU instance based on Turing architecture, mainly applicable to audio and video, AI artificial intelligence, image processing and other scenes. In different scenarios, different business loads are sunk to GPU hardware acceleration, which greatly improves the efficiency of business processing.

How to monitor and view logs

Note that the application related underlying services and functions will be displayed in the application details, as shown in the following figure:

Click the function to see a lot of information, as shown in the figure below, you can easily see the monitoring indicators.

The following figure shows the log information:

How to perform elastic management

On the function details page, click [Elastic Management] - [Create Rules] to perform elastic management on functions by setting rules.

As shown in the following figure, the number of instances can be dynamically adjusted by time or by indicator.

Summary

It can be found from the above description that Serverless function calculation, as a new form of calculation, can better cope with the scenario of elastic changes in computing resources.

From a macro perspective, the demand for computing resources of different enterprises and services is unbalanced in time and space. Cloud computing vendors can achieve reasonable allocation of computing power by dynamically scheduling resources, saving a lot of idle resources, and thus reducing costs.

More broadly, when the idea of a community of shared future for mankind has developed to a certain extent, all cloud computing manufacturers around the world can share basic computing capabilities. When the computing resources of a country or region are not enough for a sudden event, you can temporarily call the computing resources of cloud manufacturers in other countries or regions - of course, you need to pay reasonable fees.

The R&D of Serverless is beneficial to the country and the people. The future is bright. For today's technology, we will always be full of hope. Let's dance in the clouds and accompany the world in the bright years.

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