In 2020, we will talk about serverless and cloud development

The most indispensable thing in the front-end circle is new technology. Almost every month there will be some new npm packages, new frameworks, and new terms. When a new version of a popular framework is released, or when an article explains a new event, the following comments are often:

Please don't update it, I can't learn it anymore.

or

Come, help me up, I can still learn.

Or

Can you directly give out v999? Let me finish it all at once.

Only one picture can describe the mood of front-end developers at this moment:

An epidemic in early 2020 gave us more time to study at home. Not long ago, I was also invited to serve as a guest judge for the online public welfare hackathon hosted by Tencent. The difference between this dark horse competition and the past is that the whole process is online, free to team up, and develop a WeChat mini program related to the fight against the epidemic in 2 days. In 2 days, nearly 200 people submitted more than 80 entries.

Another two technical aspects of this competition are "cloud development".

When it comes to cloud development, we naturally think of another concept, that is Serverless. There is no doubt that 2019 is a year of large-scale promotion of Serverless, whether it is Serverless-related books and articles, or various conferences on Serverless-related topics, they are all very popular. There are even many articles calling Serverless the front end 3.0.

  • Front-end 1.0 represented by ajax

  • Frontend 2.0 represented by Node.js

  • Frontend 3.0 represented by Serverless

Node.js even brings the capabilities of front-end JavaScript to the server side, allowing front-end developers to easily engage in Full Stack or (BFF) Backends for Frontend. Many front-end developers also define their career goals as full-stack engineers. Obviously this is contrary to the concept of mainstream software development: let professional people do professional things. Many developers have gradually changed from "full-stack engineers" to "full-stack engineers"-they can do everything but can't do everything.

As a front-end developer, you also know how to configure nginx. But is your nginx really the best? Why not leave it to a professional person to do it?

As a front-end developer, you also know how to configure mysql. But is your mysql really the best? Why not leave it to a professional person to do it?

As a front-end developer, do you really understand concurrency, networking, capacity expansion, disaster tolerance, monitoring, and logging? Why not leave it to a professional person to do it?

Through chatting with several developers during this dark horse competition, I probably learned the concept of cloud development. Basically, it can be considered as a set of best practices and solutions built on Serverless, covering a complex of FaaS (Function as a service) and BaaS (Backend as a service, backend and service).

The specific implementation is the model shown in the figure below:

Based on the functions and services provided by the cloud development system, front-end developers focus on UI and interaction logic, and can access the business logic layer carried by cloud functions and cloud databases and cloud storage at a small cost. As the supporting data storage layer. In short, the focus of the front-end is: interaction logic + business logic (cloud function) + data (cloud database/cloud storage).

Many articles about Serverless will mention CDN (Content Delivery Network), which is also the first Serverless service that most front-end developers come into contact with. We have been using it for a long time even before the word Serverless was born. Developers who use CDN do not need to care about the privacy, security, and authentication mechanism of files, and do not need to know the status of the CDN server or the specific location of file storage. They only need to deploy files. CDN is serverless for front-end developers. .

In this dark horse competition, more than 80% of developers used cloud development, and the most used function was cloud functions. Cloud functions are similar to AWS Lambda. Developers only need to use the language supported by the platform to write the core code and set the conditions for the code to run, and then the code can be flexibly and safely run on the Tencent Cloud infrastructure.

The most obvious advantage brought by cloud functions is that users only need to write the most important "core code" and no longer need to care about peripheral components, which greatly reduces the complexity of building the service architecture. Without any manual configuration, cloud functions can automatically scale horizontally according to the amount of requests. Regardless of the peak or trough of your application's daily requests, SCF can automatically arrange reasonable computing resources to meet business needs.

The biggest advantage of using cloud development in this dark horse competition is "zero deployment and zero maintenance". Therefore, all participants are developers and there are no professional operation and maintenance engineers. The launch of any small program, in addition to the small programs you see, there are gateways, computing services, infrastructure management, databases, file services, cache services, etc. behind it. Cloud development provides a more complete server architecture and can ensure the stability of the service.

In the coming 2020, Serverless has more possibilities. Finally, the old saying:

Come, help me up, I can still learn.

Guess you like

Origin blog.csdn.net/vCa54Lu0KV27w8ZZBd/article/details/104404385