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

  • 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.

主站蜘蛛池模板: 民乐县| 根河市| 鞍山市| 磐石市| 海安县| 盐亭县| 大足县| 仙桃市| 巴中市| 全南县| 怀宁县| 广平县| 应城市| 常熟市| 万山特区| 景德镇市| 同心县| 玉环县| 宁海县| 衡山县| 屏山县| 星座| 华宁县| 财经| 北票市| 尉氏县| 南华县| 乌什县| 应用必备| 朝阳区| 隆林| 宁武县| 含山县| 务川| 南丹县| 平舆县| 江阴市| 调兵山市| 兴和县| 德昌县| 沁阳市|