当前位置:网站首页>The value of applet containers

The value of applet containers

2022-07-06 00:36:00 InfoQ

This article allows you to thoroughly understand the applet container , And where it can be of greatest value .

One 、 What is an applet container

1、 How to understand containers

“ Containers ” The word comes from the English word  Container , Translation is also “ Container ”, Then why compare containers to containers ?
First , Just from the appearance , Neat containers are the same in both size and material ( Even my obsessive-compulsive disorder has been cured ), It's like a factory has a large machine , Just put in the raw materials for manufacturing containers, and you can quickly mass produce completely consistent containers .
secondly , The function of container is to pack and isolate the goods of merchants , Generally, the goods of different businesses will be packed into different containers , In this way, it is not easy to confuse whether loading or unloading .
in addition , Containers have a more important function : Protect the goods in the box . Whether you encounter strong wind, rainstorm or sun exposure during shipping , We can rest assured of the goods in the box .
In fact, we also hope that the container can achieve the same effect ,
As long as the raw materials we provide ( Mirror image ) equally , The result ( Operation example ) It's all the same , And it can also realize packaging, isolation and easy transportation .

2、 Advantages of front-end containers

If you compare a container to a container , You can clearly summarize the advantages of containers :“ Raw materials provided ( Mirror image ) equally , The result ( Operation example ) equally ”、“ Packaging isolation ”、“ Easy transportation ”  etc. .
The service running in the container or multiple processes corresponding to the service should be the corresponding goods in the container , It's natural to think of , The purpose of the container is
Provide an independent running environment for process collection
.
How should we achieve it  “ Independent operating environment ”  Well ?
2.1  File system isolation
  • Each container has a separate file system , Adding, deleting, modifying and querying the file system in a single container will not affect other containers
  • Reference resources  Linux  Under the  chroot  command , You can change a subdirectory into a root directory
2.2 Resource isolation
  • utilize  namespace  Isolate mutual visibility and communication between processes
  • Use  Cgroup  Limit resource utilization , Set what it can use  CPU  And the amount of memory
So the essence of container is a view isolation 、 Resources can be limited 、 Process set of independent file system , It isolates other resources of the system , Has its own independent resource view .“ View isolation ”, It refers to the ability to see part of the process 、 Have a separate host name ,“ Resources can be limited ”, It means that the memory size can be limited 、CPU  Number of applications, etc .

3、 Applet container compared to h5、 Native advantages

At home , The troublemaker of the times is the applet .
With WeChat 、 Alipay 、 Baidu 、 Tiktok and other small program platform launch , The applet ecosystem has achieved unprecedented success , Is there a possibility , Combination of applet ecology and container , Form a small program container ?
Applet container as the name suggests , Is a running environment that hosts small programs , Active intervention and function expansion , Achieve rich ability 、 Optimize performance 、 The purpose of improving the experience .
Maybe you will also think ,H5 It can also be realized. Why do you have to engage in small programs , If we use small programs to contact and use them more often “H5  Mobile application ” And “ Mobile native app ” The comparison , We will find that the application of applet has several obvious advantages .
  • Cross platform capability , A set of codes can be  iOS  And  Android  Running on multiple platforms ;
  • Far more than  H5  Experience ( Support local cache ,Webview, There are rich components and support libraries );
  • Can get more system permissions , Complete richer product design ;
  • You can avoid  DOM  Let the cat out of the ( Do not use commonly used  window  Object and the  document  object );
  • Effective reduction of package size , Save traffic and storage
  • Service is no longer limited by distribution , Support hot update

Two 、 How to introduce applet container

  • The applet container is very good , Many companies are also in-house self-study , However, it is limited to powerful companies , It is also used internally . for example , tencent 、 Ali 、 byte 、 Big companies such as Baidu have their own small program platforms , But they are almost always limited to internal use .
  • The more common reality is that more companies want to use it but don't have the strength to do it , If you really need an applet container, how can you get it in the right posture ?
  • Here's the recommendation
     FinClip
     , One that can make any  App  Solutions for running applets , Just in your  App  Inside , Introduce it  SDK, You can load and run external applets . except  SDK, It also provides a background management system , Unified management of small programs on and off the shelf , And collecting and analyzing applet data .
  • Use it , Want to talk about right  
    FinClip 
    Experience :
  • Follow the development standards and specifications of wechat applet , Development is much easier
in other words , The existing wechat applet can not change a line of code , Put it directly into your  App  Inside , The running effect remains unchanged , There is no need for additional secondary development and transformation , It saves a lot of labor costs .
  • The good news for developers , Support multi terminal operation
Except for the mobile terminal  iOS  And  Android, See also support, including  Linux、Windows、MacOS、 Kirin and other operating systems . amount to PC  End 、 Vehicle mounted equipment 、 Smart TV can use small programs , It can be seen that making products is really hard .
  • Provide IDE  And documents , The learning cost of getting started is low
Providing applets  IDE  development tool , The interface is similar to the development tool of wechat applet , Comes with debugging and real machine preview , Easy to use . It can be here  IDE  Inside , Secondary development of existing projects , Extended functions and interfaces , Or write a small program from scratch .

3、 ... and 、 The value of applet containers

In short, applet containers can help developers quickly optimize the size of distribution packages , Save traffic and storage . meanwhile ,App  Service iterations are no longer limited by distribution , Fast release , Fast iteration . even to the extent that , Based on unified development standards , Small programs only need to be developed once , It can be quickly delivered to multiple terminals .

1、 Multi terminal delivery on the shelf

Because of the standardization and compatibility of grammar , In the development work, you only need to develop a small program once , Can be opened in different applications , Naturally solve cross end pain points . meanwhile , adopt IDE After the tool is debugged and adapted, the applet can be put into wechat, for example 、 Ali 、 Baidu 、 Byte and other open platforms , Connect all large flow platforms , Reach a large number of users , Meet the needs of multi terminal drainage .

2、 Iteration is more agile

For example, finance 、 social contact 、 Complex businesses such as e-commerce will have frequent iteration requirements , In fact, a better way is to spin off this part of the business and transform it into a small program , Then through the form of upper and lower shelves to  App  in , Hot update can be achieved , There is no need to wait for the master release and frequent submission App Store to examine , Meet complex and changeable business scenarios .

3、 Build an open ecological platform

For enterprises with ecological construction , Third party merchants can also be introduced in the form of small programs on and off the shelf , stay  App  Build a self owned light application distribution center in ( The app store ), Quickly cover clothing, food, housing and transportation 、 Office collaboration and other high-frequency applet scenarios , Like wechat 、 Alipay forms its own open ecological platform. .

原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060033007506.html