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

Synchronous

When it comes to the communication layer between microservices, synchronous is certainly the most widely used approach. Within this topic, some protocols are well known and others less so. The range of direct protocols is as follows:

  • HTTP
  • TCP
  • WebSockets
  • Sockets
  • RPC
  • SOAP

Arguably, the most commonly implemented is HTTP. Many microservices use HTTP to communicate with each other, where as the HTTP is typically used with JSON.

The problem with this approach is that, with HTTP, JSON can generate an unwanted processing time to send and translate the information. Some teams that use JSON with HTTP only adopt the keep alive strategy for app-to-app communication and conventional connections to APIs.

When it comes to HTTP, API with JSON is practically normative. However, for internal communication between microservices, this is quite questionable. A good approach, in this case, considering problems of latency and data translation, is the use of binary traffic for communication between microservices.

There are some very interesting options for this approach: Avro, Protocol Buffer with CPRM, and Thrift are some examples. Another important point is that with binary we are not tied to any specific technology, and changing the communication interface with this technology is extremely simple.

主站蜘蛛池模板: 温宿县| 安图县| 大足县| 永康市| 华安县| 金寨县| 苗栗县| 宣化县| 荃湾区| 资源县| 郧西县| 根河市| 克拉玛依市| 新闻| 祁东县| 颍上县| 聂荣县| 五大连池市| 尚义县| 黑龙江省| 万安县| 赤水市| 长治市| 罗田县| 安塞县| 黄浦区| 尚义县| 阳原县| 民和| 长泰县| 徐州市| 新竹市| 岳普湖县| 土默特右旗| 洞头县| 巢湖市| 岢岚县| 普兰店市| 寿光市| 通山县| 福州市|