- Building Serverless Microservices in Python
- Richard Takashi Freeman
- 356字
- 2021-06-24 15:57:30
Communication styles
Microservice applications are distributed by nature, so they heavily rely on the authorizations network. This makes it important to understand the different communications styles available. These can be to communicate with each other but also with the outside world. Here are some examples:
- Remote procedure calls: It used to be popular for Java to use Remote Method Invocation (RMI), which is a tight coupling between client and servers with a non-standard protocol, which is one limitation. In addition, the network is not reliable and so traditional RMIs should be avoided. Others, such as the SOAP interface, and a client generated from the Web Service Definition Language (WSDL), are better but are seen as heavy weight, compared to REpresentational State Transfer (REST) APIs that have widely been adopted in microservices.
- Synchronous communication: It is simpler to understand and implement; you make a request and get a response. However, while waiting for the response, you may also be blocking a connection slot and resources, limiting calls from other services:

- Asynchronous communication: With asynchronous communication, you make the request and then get the response later and sometimes out of order. These can be implemented using callbacks, async/await, or promise in Node.js or Python. However, there are many design considerations in using async, especially if there are failures that need monitoring. Unlike most synchronous calls, these are non-blocking:

When dealing with communications, you also need to think about whether your call is blocking or non-blocking. For example, writing metrics from web clients to a NoSQL database using blocking calls could slow down your website.
You need to think about dealing with receiving too many requests and throttling them to not overwhelm your service, and look at failures such as retires, delays, and errors.
When using Lambda functions, you benefit from AWS-built event source and spinning up a Lambda per request or with a micro-batch of data. In most cases, synchronous code is sufficient even at scale, but it's important to understand the architecture and communication between services when designing a system, as it is limited by bandwidth, and network connections can fail.
- 電影中的精神病學(xué)
- 陳衛(wèi)川中回醫(yī)臨證實(shí)錄方
- 腫瘤精準(zhǔn)放射治療靶區(qū)勾畫(huà)叢書(shū):泌尿系統(tǒng)腫瘤
- 狡猾的細(xì)胞:癌癥的進(jìn)化故事與治愈之道
- 虛構(gòu)的孤獨(dú)者:孤獨(dú)癥其人其事
- 康復(fù)醫(yī)學(xué)(第2版)
- 現(xiàn)代口腔正畸技術(shù)與臨床思維(現(xiàn)代實(shí)用口腔醫(yī)學(xué)著譯叢書(shū))
- 預(yù)防老年人跌倒健康教育教程(老年人用書(shū))
- 腫瘤防治科普叢書(shū):腦部腫瘤
- 會(huì)保養(yǎng)的女人年輕20歲
- 與癌共舞
- Activiti 5.x Business Process Management Beginner's Guide
- 實(shí)用青春期醫(yī)學(xué)
- 新型冠狀病毒感染臨床用藥手冊(cè)
- PET/CT圖譜