官术网_书友最值得收藏!

  • Microservices with Azure
  • Namit Tanasseri Rahul Rai
  • 278字
  • 2021-07-02 22:18:23

Composite user interface for the web

Several high-scale websites such as Facebook and MSN combine data from multiple services on their page. Such websites compose their frontend out of multiple components. Each of these components could be the user interface provided by individual Microservices. A great example of this approach is Facebook's BigPipe technology, which composes its web page from small reusable chunks called pagelets and pipes them through several executing stages inside web servers and browsers:

Facebook BigPipe (source: https://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919/)

The composition of a user interface can take place at multiple levels, ranging from development to execution. The flexibility of such integrations varies with the level they are carried out at.

The most primitive form of composition can be the sharing of code, which can be done at the time of development. However, using this integration, you have to rely on deployment monoliths as the various versions of user interface can't be deployed in parallel.

A much more flexible integration can also take place at runtime. For instance, Asynchronous JavaScript and XML (AJAX), HTML, and other dependencies can be loaded in the browser. Several JavaScript frameworks, such as Angular.js, Ember.js, and Ext.js, can help realize composition in single-page applications.

In cases where integration through JavaScript is not feasible, middleware may be used which fetches the HTML component of each Microservice and composes them to return a single HTML document to the client. Some typical examples of such compositions are the edge side includes of varnish or squid, which are proxies and caches. Server-side includes such as those available on Apache and NGINX can also be used to carry out transformations on servers rather than on caches.

主站蜘蛛池模板: 东乌珠穆沁旗| 清河县| 边坝县| 健康| 五指山市| 鹤壁市| 江城| 雅江县| 同心县| 济源市| 化州市| 南澳县| 大埔区| 枣阳市| 瑞安市| 化德县| 建水县| 清丰县| 上杭县| 唐海县| 永仁县| 丹江口市| 左云县| 安岳县| 承德市| 宜州市| 福海县| 芮城县| 徐闻县| 青川县| 岳阳市| 常德市| 江门市| 义乌市| 浮山县| 丹寨县| 津市市| 松原市| 曲周县| 准格尔旗| 台前县|