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

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.

主站蜘蛛池模板: 高唐县| 贡觉县| 堆龙德庆县| 长白| 正蓝旗| 安义县| 福海县| 长汀县| 读书| 乐至县| 迭部县| 都江堰市| 甘洛县| 康马县| 张掖市| 合作市| 曲水县| 甘洛县| 获嘉县| 大城县| 博野县| 广州市| 阿图什市| 邹平县| 新余市| 班戈县| 砚山县| 彭州市| 三门峡市| 和顺县| 沧州市| 汾阳市| 龙胜| 怀远县| 张家港市| 和顺县| 轮台县| 赣榆县| 静海县| 丰顺县| 孝昌县|