1
Please indicate the source for reprinting: Grape City official website, Grape City provides developers with professional development tools, solutions and services, and empowers developers.

You may have been exposed to Docker more or less in your work. Do you know what is behind Docker and containerization?

Containerization technology is all over the world, so why is Docker only known to everyone?

In the post-Docker era, who is the king of the cloud-native era?

We believe this series of articles can help you answer these doubts.

Physical server that was "disliked"

Before the cloud era, if developers needed to build an online site, they had to maintain their own physical servers. However, with the development of business, the number of servers has gradually increased, and consequently the cost of hardware, space, and maintenance has continued to increase. For C-oriented sites, network hotspot events are random, and traffic changes are not controllable, and it is inevitable that they will encounter skyrocketing traffic within the site. If there is no backup server at this time, the burst of large traffic is likely to overwhelm the entire site. But when there are no emergencies, the procurement and maintenance costs of the backup server are not negligible.

2.png

   (运维的传统艺能:上线拜祖,图片来自网络)

Where there are problems, there are business opportunities. Someone thought that if you buy a batch of servers and put them on the external network, arrange for someone to manage them, and then rent them out according to the needs of users, wouldn't this problem be solved?

As a result, a good show of cloud computing was officially staged.

The virtual machine is still "overweight"

The curtain of the cloud computing era has been opened, and major companies have come on stage. Let us briefly review them first.

  • In 2006, Amazon established aws, starting from the cloud storage business.
  • In 2008, cloud computing was started.
  • In 2009, Alibaba Cloud was established. The latest data shows that in the 2020 IaaS market share survey, Alibaba Cloud ranks third in the world and first in the Asia-Pacific; the top two are Amazon and Microsoft, with a market share of 9.5%, surpassing Google’s 6.1% and Amazon’s 40.8%. Microsoft 17%. The domestic market share is 40%, followed by Huawei Cloud, which accounts for 18%.
  • In 2010, OpenStack was released by NASA. OpenStack is an IaaS architecture, you can use its architecture to build your own private cloud, so that anyone can create and provide cloud computing services on their own. In contrast, AWS and aliyun are both self-developed architectures, and OpenStack is open source. So if the company needs, it can connect to OpenStack to build its own private cloud. (Of course the premise requires OpenStack core development capabilities).
  • Between 2010 and 2013, the global share of cloud computing was divided between aws and OpenStack.

At this time, cloud computing technology is essentially virtualization technology, providing hardware resources as infrastructure to users, referred to as IaaS. Simply understand, IaaS is to split a large server into multiple small virtual servers through virtualization technology to provide services, similar to installing a virtual machine on the machine.

1.png
(The entry time of the main cloud computing players, the picture comes from the Internet)

However, the virtual machine in the IaaS era is still too cumbersome. Each virtual machine needs to consume CPU, memory and other computing resources to support the operation of the application. No matter how small the application is, the overhead of the system is a fixed cost. How to lose weight for IaaS and minimize the overhead of the virtual machine system?

Since 2013, cloud computing has officially entered the PaaS era. In the PaaS era, the units sold by cloud computing have changed from virtual machines to application operating platforms. As a result, cloud vendors provide more services and higher resource utilization.

What is PaaS? We use a popular example to explain. If we are the owner of a biscuits shop now, adopting the IaaS model means that we need to use other people’s kitchens, boilers, gas, and dough to make fillings and biscuits. If it is PaaS, the flour, fillings and seasonings of our biscuits are provided by others, and we only need to bake the biscuits.

How should cloud vendors build a set of useful PaaS services? Leveraging on open source projects has become the consensus of all vendors.

Cloud Foundry opens the PaaS open source era

The core of PaaS is the platform. Among the PaaS open source projects that first appeared in the developer's field of vision, Cloud Foundry founded by vmware is the most well-known. Unlike IaaS, which provides virtual machines on the cloud, cloud computing based on Cloud Foundry can provide application hosting functions. Developers only need to pass a simple command such as: cf push "my application", the project can be packed into a compressed package and uploaded to the Cloud Foundry server. Cloud foundry will start its own scheduler, find a host (system version, performance, number) that meets user needs in a group of cloud hosts, and then use containerization technology to create a container on the host and download the compressed package in the container , Decompress and run, and finally become an application that provides services to the outside world.

In addition, the Cloud Foundry platform provides services such as distribution, disaster recovery, monitoring, restarting, etc. for these application projects (this is also the core service we provide to users). This kind of hosting service liberates the productivity of developers, so that they no longer care about the operation and maintenance of the application, but concentrate on developing their own applications. And this is the "initial heart" of PaaS, platform as a service.

5.png
(Service provided by Cloud Foundry)

Some students will ask here, what is a container? Container is a technology used to solve the problem of multiple application resource conflicts and isolation. The namespace mechanism and cgroups commands on Linux can be used for resource isolation and restriction. These are container technologies.

Container technology was not created by Docker. Before the rise of Docker, it was already commercialized by other companies. But why is it that everyone thinks of Docker when it comes to containers now? This will mention the death of Cloud Foundry.

From Cloud Foundry to Docker

Cloud Foundry seems to be no different from the cloud functions we use now, but the reality in 2021 is that Cloud Foundry is dead.

We have seen many articles on the Internet, combined with our experience in the development of movable type public cloud, we believe that the fatal flaw of this project is focused on its packaging mechanism.

The core component of Cloud Foundry is the application packaging and distribution mechanism, which is also the function that developers deal with most. Cloud Foundry defines a set of packaging methods for every mainstream language, and there are no rules between these methods. But it is this packaging function that has become the weakness of Cloud Foundry and has been criticized by users. Developers have to maintain a completed package for each language, each framework, and even each version of the application. It may happen that the local machine runs successfully, and the package cannot be run after the package is uploaded. When the situation is most serious, the time that developers spend on debugging the cloud platform system is already longer than the time it takes to develop a new software.

Originally a technology born to empower developers, Cloud Foundry is so unfriendly to developers. When developers’ complaints accumulate to a certain extent, it is logical that Cloud Foundry, which wants to gain a foothold in the PaaS wave, is "red carded out" by rising star Docker.

Initially, Docker was a container project developed by a company called dotCloud (founded by Solomon Hex in 2010 and incubated by Y Combinator). When Cloud Foundry was struggling with the packaging problem, Docker was quietly accumulating its power, and within a few months of open source, it quickly rose to become a PaaS technology solution that cannot be ignored, attracting the attention of cloud service developers.

The funny thing is that when Docker was just open sourced, Cloud Foundry's chief product manager James Bayer made a detailed comparison in the community, telling users that Docker, like Cloud Foundry, is a sandbox using Namespace and Cgroups technologies. There is nothing worthy of attention.

In fact, Docker did adopt this "traditional" technical solution just as he said, but compared with Cloud Foundry, Docker has made a little innovation, which reflects the vision of Solomon Hex. Since 2010, he began to consider the consistency and reusability of application packaging, and proposed innovative solutions, which eventually caused a devastating blow to Cloud Foundry. The solution is Docker mirroring.

4.jpg

(Docker, the picture comes from the official website)

The newly open source Docker quickly exploded. The naive little whale, user-friendly documentation, the slogan of deploying an Nginx cluster in three minutes, and the "trivial innovation" of Docker Image have made Docker sweep the entire PaaS field.

Docker's magic weapon: mirroring

The key to Docker's success is that Docker mirroring almost perfectly solves the weakness of Cloud Foundry in packaging.

The so-called mirror is actually a compressed package, but compared to the packaged result of the execution file + startup script of Cloud Foundry, the mirror provides users with a complete operating environment. Each mirror can specify the operating system version. The file structure of the program execution can be constructed, and a mirror image can be completely shared and used in multiple places.

6.png

In addition, Docker also provides developers with a complete image production process, which has nothing to do with programming languages and frameworks. Developers only need to follow this process to customize the operating system environment required by the corresponding program.

In short, Docker mirroring perfectly solves two problems:

1. The difference between the local environment and the server environment
2. The same image allows all machines to be reused

From this moment on, the PaaS market has been completely dominated by Docker.

summary

This article is the first issue of a series of articles. Together, we reviewed the development path of IaaS replacing physical servers and building PaaS based on IaaS. When building PaaS, we experienced the decline of Cloud Foundry and witnessed the success of Docker.

However, can a complete PaaS service be built only by relying on Docker? Which technical solution did we choose for our movable type grid The story of cloud computing is not finished yet, so stay tuned for the exciting content of the next issue.


葡萄城技术团队
2.7k 声望28.5k 粉丝

葡萄城创建于1980年,是专业的软件开发技术和低代码平台提供商。以“赋能开发者”为使命,葡萄城致力于通过各类软件开发工具和服务,创新开发模式,提升开发效率,推动软件产业发展,为“数字中国”建设提速。