What is cloud native technology?

Cloud native correlation technology

According to the definition of cloud native 1.0 issued by CNCF, cloud native technology mainly includes container, microservice, service grid, immutable infrastructure and declarative API:

Container technology

Container technology and cloud protoplasm are like a pair of spirochetes. Container technology gave birth to cloud protoplasm, and cloud protoplasm ecology promoted the development of container technology. From the birth of Docker technology in 2065438+03 to the establishment of 20 15 cloud native heavyweight alliance CNCF, this is not a historical coincidence, but a historical necessity. As one of the key technologies of cloud nativity, container has been one of the focuses of the industry since the birth of 20 13.

Before 20 13, the cloud computing industry has been worried about the correct opening posture of the cloud. Platform as a Service (PaaS) seems to be a promising direction. The Mizi service released by Fotango Company in 2006 can be said to be the originator of PaaS industry, with typical cloud native characteristics such as pay-per-use and no server, API configuration and service. In 2008, Google launched the Google Application Engine (GAE); Cloud Foundry released by 2065 438+0 1 Pivotal.

These early PaaS platforms have made very useful explorations in the field of cloud native ecology and promoted the healthy development of cloud native ecology. However, these early exploration technologies did not form a big industry trend, but were limited to some specific fields. It was not until Docker opened the source that everyone woke up like a dream. It turned out that it was not the wrong direction, but the poor means of application distribution and delivery.

Docker mirror container mirror is the real core innovation, applying the new mechanism of packaging, distribution and operation. Container image packages the application running environment, including code, dependency libraries, tools, resource files and meta-information into an immutable software package, which is independent of the operating system distribution.

The container image packages the environment in which the whole container runs, avoiding relying on the operating system of the server running the container, thus realizing "build once and run everywhere". Once the container image is built, it becomes read-only and becomes part of the immutable infrastructure.

Microservice

Micro-service architecture is relative to a single architecture, and they belong to different architectural styles. In the micro-service architecture, a service is a single software component that can be deployed independently, and it realizes some useful functions. The API of the service encapsulates its internal implementation. Unlike a single architecture, developers can't bypass the API of the service and directly access the methods and data inside the service. Therefore, microservice architecture forces the application to be modular.

The core feature of micro-service architecture is loose coupling between services. The interaction between services is completed by API, which encapsulates the implementation details of services, thus realizing the modification of implementation mode without affecting the client.

Micro-service architecture decomposes large-scale systems according to the granularity of business services, and each service can be independently developed, tested, verified and deployed. After decomposition, the benefits are as follows:

Support continuous delivery and deployment of large-scale complex applications.

Each service is relatively small and easy to maintain.

Services can be deployed independently.

Services can be independently extended.

Micro-service architecture can realize team autonomy.

It is easier to test and adopt new technologies.

Better fault tolerance

Service grid

Service grid is a special infrastructure layer, which is used to handle the communication between services and is responsible for the reliable request delivery between micro-services. Service grid is usually implemented by a set of lightweight network agents, which are deployed with application code without knowing the application itself.

With the growth of scale and complexity, service grid contains more and more functions, including service discovery, load balancing, fault recovery, indicator collection and monitoring, and usually more complex operation and maintenance requirements, such as A/B testing, canary publishing, current limiting, access control and end-to-end authentication.

The service grid has the following characteristics:

The middle layer of communication between applications.

Lightweight network proxy

Application insensitivity

Separate application retry/timeout, monitoring, tracking and service discovery.

If we explain what service grid is in one sentence, we can compare it to TCP/IP between applications or micro-services, which is responsible for network access, flow restriction, integration and monitoring between services. Generally speaking, writing applications don't need to care about the TCP/IP layer (for example, RESTful application through HTTP protocol), and they don't need to associate things between services originally implemented through applications or other frameworks, such as Spring Cloud and OSS. Now you just need to hand them over to the service grid, which greatly facilitates the development of micro-service applications.

Constant infrastructure

A workload (such as containers, virtual machines, etc.). ) Once deployed, it will not be modified. When something needs to be updated, repaired or modified, just replace the old workload with the new and verified workload.

The function of immutable infrastructure is mainly reflected in the stability of the system. Once the traditional application is deployed to the user-specific server, the server system will change constantly, and either the operating system will be upgraded or new applications will be installed, which may lead to conflicts, resulting in the need for the application to be continuously upgraded with the change of the user's system environment, and new problems will constantly appear in the middle. Immutable infrastructure avoids all these problems, because cloud native applications are deployed on immutable infrastructure, so there is no problem of change.

Declarative API

Declarative API is a more advanced interface design method than imperative API. Simply put, imperative API provides users with the ability to do what, and declarative API provides users with the ability to do what.

Declarative API is a more advanced interface than imperative API. For example, we have a cooking machine. If the interface provided by the cooking machine is oil discharge, seasoning, ingredients, big fire and small fire, it is an imperative API.

If the interface provided by the cooking machine is to serve kung pao chicken and fish-flavored shredded pork, it is a declarative API. A typical example of declarative API is the SQL interface provided by the database. You just need to tell the database what data you need. As for how to obtain these data, the database will operate step by step.