The author | juven xu Ali cloud senior technical experts

This article is compiled from lecture 1 of Serverless Technology Open Class. Click to start learning. Pay attention to “Serverless” public account, reply ** get started **, you can get Serverless series articles PPT.

Traditional single application architecture

More than a decade ago, the mainstream application architecture was single application, which was deployed in the form of a server and a database. In this architecture, operation and maintenance personnel would carefully maintain the server to ensure the availability of services.

(Single structure)

As the business grew, this simplest monolithic application architecture quickly faced two problems. First, there is only one server, and if that server fails, for example with hardware damage, the entire service becomes unavailable. Secondly, as the volume of services 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 to the traffic inlet so that a single application can be deployed on multiple servers at the same time. In this way, the single-point problem of the server is solved and the single application can scale horizontally.

Microservices Architecture

1. Microservices architecture evolves into universal services

As the business grew, more developers joined the team to develop features on individual applications. As the code within a single application has no clear physical boundary, people will soon encounter various conflicts, which require manual coordination and a large number of conflict merge operations, and the r&d efficiency plummets.

As a result, individual applications are being broken up into microservice applications that can be developed, tested, and deployed independently. Services communicate with each other through apis such as HTTP, GRPC, or DUBBO. The micro-service architecture based on Bounded Context splitting 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

As applications evolve from monolithic to microservice architectures, and distribution becomes the default option from a physical perspective, application architects have to face new challenges posed by distribution. In this process, people will start to use some distributed services and frameworks, such as cache service Redis, configuration service ACM, state coordination service ZooKeeper, message service Kafka, as well as communication frameworks such as GRPC or DUBBO, and distributed tracking system.

In addition to the challenges posed by distributed environments, microservices architecture brings new challenges to operations and maintenance. An application developers need only original operations, may now need ten or more operational application, which means that the security patch upgrade, capacity evaluation, fault diagnosis and other transaction workload is multiplied, at this point, the application of distribution, life cycle, observation standard, automatic elastic also highlights the importance of ability.

Cloud native

1. Based on cloud product architecture

Whether an architecture is cloud native depends on whether it grows on the cloud, which is a simple understanding of “cloud native”. The term “growing on the cloud” does not simply mean using cloud IaaS layer services, such as simple ECS, OSS and other basic computing storage; It should be understood as the use of distributed services on the cloud, such as Redis, Kafka, etc., which directly affect the business architecture. Under the microservice architecture, distributed services are necessary. In the past, everyone developed such services by themselves, or operated and maintained such services based on open source versions. In the cloud native era, businesses can use cloud services directly.

Two other technologies that need to be mentioned are Docker and Kubenetes. The former standardized the distribution of apps, both written by Spring Boot and NodeJS, as mirrors. The latter, in turn, defines the standard of the application life cycle on the former technology. An application has unified standards from startup to online, to health check, and then to offline.

2. Application lifecycle hosting

With standards for application distribution and life cycle, the cloud can provide standardized application hosting services. Including application version management, release, online observation, self-healing, etc. For stateless applications, for example, an underlying physical node fault won’t affect the research and development, the application hosting service based on the standardized application life cycle can be automatically run work, container referrals in fault physical nodes, general application, in the new physical nodes started on an equal amount of container. As you can see, cloud native further releases value dividends.

On this basis, as the application hosting service can sense the data during the application running period, such as the concurrency of service traffic, CPU load, and memory occupation, the service can configure scaling rules based on these indicators, and the platform can execute these rules to increase or decrease the number of containers according to the actual situation of service traffic. This is basically auto scaling — automatic scaling. This helps users avoid resource restriction during peak service periods, saving costs and improving o&M efficiency.

This paper summarizes

In the evolution of architecture, R&D operation personnel gradually shift their focus from machines, hoping to be managed more by platform systems rather than by people. This is a simple understanding of Serverless.

Author’s brief introduction

Xu Xiaobin, ali Cloud senior technical expert. Currently, I am responsible for the construction of Serverless R&D operation platform of Ali Group. Before that, I was responsible for AliExpress micro-service architecture, Spring Boot framework and improvement of R&D efficiency. The author of Maven in Action is a former maintainer of Maven’s central repository.

Pay attention to polite

Pay attention to ** “Serverless” ** public account, background reply lucky draw, will have the opportunity to obtain “Newman Bluetooth audio”, “Ali Cloud automatic customized umbrella”, “Tao Doll”, May 25 10:00 draw, come to try your luck!

“Alibaba Cloud originators pay close attention to technical fields such as microservice, Serverless, container and Service Mesh, focus on cloud native popular technology trends and large-scale implementation of cloud native, and become the technical circle that knows most about cloud native developers.”