Author Xu Xiaobin, senior technical expert of Alibaba cloud
This article is organized from the first lecture of “open course of serverless technology”, click to start learning.
Attention“ServerlessThe official account, replyintroductionTo get the server less series ppt.
Traditional single application architecture
More than a decade ago, the mainstream application architecture was single application, and the deployment form was a server and a database. Under this architecture, the operation and maintenance personnel would carefully maintain the server to ensure the availability of services.
With the growth of business, the simplest single application architecture will soon face two problems. First of all, there is only one server. If this server fails, such as hardware damage, then the whole service will not be available. Secondly, after the business volume increases, the resources of one server will soon be unable to carry all the traffic.
The most direct way to solve these two problems is to add a load balancer at the traffic entrance, so that the single application can be deployed to multiple servers at the same time. In this way, the single point problem of the server is solved. At the same time, the single application also has the ability of horizontal scaling.
(single architecture horizontal scaling)
1. Microservice architecture performs general services
With the further growth of business, more and more R & D personnel join the team to develop features on single application. As there is no clear physical boundary for the code in a single application, we will soon encounter various conflicts, need manual coordination, and a large number of conflict merge operations, and R & D efficiency drops sharply.
Therefore, we began to separate the single application into microservice applications that can be independently developed, tested and deployed. Services communicate with each other through API, such as HTTP, grpc or Dubbo. The microservice architecture based on the split of bound context in domain driven design can greatly improve the R & D efficiency of medium and large teams.
2. Microservice architecture brings challenges to operation and maintenance
Application evolves from single architecture to microservice architecture. From the physical point of view, distributed becomes the default option. At this time, application architects have to face the new challenges brought by distribution. In this process, we will start to use some distributed services and frameworks, such as redis, ACM, zookeeper, Kafka, grpc or Dubbo, and distributed tracking system.
In addition to the challenges of distributed environment, microservice architecture also brings new challenges to operation and maintenance. In the past, R & D personnel only need to operate and maintain one application, but now they may need to operate and maintain ten or more applications, which means that the workload of security patch upgrade, capacity assessment, fault diagnosis and other transactions is growing exponentially. At this time, the importance of application distribution standards, life cycle standards, observation standards, automation flexibility and other capabilities is more prominent.
1. Based on cloud product architecture
Whether an architecture is cloud native depends on whether the architecture grows on the cloud, which is a simple understanding of “cloud native”. This “growing in the cloud” does not simply mean using cloud IAAs layer services, such as simple ECs and OSS, but should be understood as whether distributed services on the cloud, such as redis and Kafka, are used, which directly affect the business architecture. Under the microservice architecture, distributed services are necessary. It turns out that we all develop such services by ourselves, or operate and maintain such services based on the open source version. In the cloud native era, businesses can use cloud services directly.
The other two technologies that have to be mentioned are docker and kubenetes. The former standardizes the application distribution standards, whether it is applications written by spring boot or nodejs All written applications are distributed in the form of mirror images; the latter defines the standards of application life cycle in terms of technology of the former. An application has a unified standard from Startup to online, to health examination, and then to offline.
2. Application lifecycle hosting
With the standards of application distribution and lifecycle, the cloud can provide standardized application hosting services. It includes version management, release, observation after online, self-healing, etc. For example, for stateless applications, the failure of an underlying physical node will not affect R & D at all, because the application hosting service can automatically complete the migration work based on the standardized application life cycle, offline the application containers on the failed physical nodes, and start the same number of application containers on the new physical node. It can be seen that cloud native further released the value dividend.
On this basis, because the application hosting service can perceive the data of the application runtime, such as the concurrency of business traffic, CPU load, memory consumption, etc., the business can configure the scaling rules based on these indicators, and then the platform can execute these rules to increase or decrease the number of containers according to the actual situation of business flow, which is the most basic auto Scaling — auto scaling. This can help users avoid restricting resources in the low peak period of business, save costs, and improve operation and maintenance efficiency.
This paper summarizes
In the process of architecture evolution, R & D operation and maintenance personnel gradually shift their focus from the machine, hoping that the machine will be more managed by platform system, rather than by people. This is a simple understanding of serverless.
Brief introduction to the author
Xu Xiaobin, senior technical expert of Alibaba cloud. At present, he is responsible for the construction of Alibaba Group’s serverless R & D operation and maintenance platform. Before that, he was responsible for aliexpress microservice architecture, spring boot framework, and R & D efficiency improvement. The author of “Maven actual combat” used to be the maintainer of Maven central warehouse.
Pay attention to courtesy
follow“Serverless” Official account, background replyluck draw, you will have a chance to win “Newman Bluetooth audio”, “Alibaba cloud fully automatic customized umbrella”, “Taobao”. The prize will be opened at 10:00 on May 25. Come and try your luck!
“Alibaba cloud native pays attention to micro service, serverless, container, service mesh and other technical fields, focuses on the trend of cloud native popular technology, and large-scale implementation practice of cloud native, so as to become the technology circle that understands cloud native developers best.”