In this section, we will take a look at Chatty applications, which is a specific characteristic of certain type of applications. There are two ways to explain Chatty Applications as below:
- Application point of view
- Network point of view
1. Application point of view
If an application/system consists of sub systems which have to communicate with each other for a number of times, to complete a functional operation, then it is called a ‘Chatty Application’.
For e.g., let us say a client requires order details and its items information from the server. The server might expose an API to return order details and number of items. It could expose a separate API to return item details for a given item number. (Refer above diagram for reference).
So the client has to make one call to get order details and then ‘N’ calls for each of the N items. If the client needs stock information for every item, then it would have to invoke additional N calls to retrieve stock information. So the client would need 2N+1 calls to get an order.
This kind of application could be classified as a ‘Chatty Application’.
Disadvantage of Chatty Applications:
Chatty applications require a lot of network round trip and could cause latency issues.
Advantages of Chatty Applications:
In some cases it might be good to build a chatty application. If we do not build a chatty application, then, systems would need to exchange huge amount of data during the initial request. In the above example, the first request to get order details could return order details and all the associated item details. As a result, the amount of data exchanged per request would be huge. This would also slow down the response to the initial request. We need to analyze the use case and figure out, whether the client really needs all the data at one shot and then chose the right solution. This is basically a tradeoff between response time per request and the network/server load.
2. Network point of view
A chatty protocol is an application or a routing protocol that requires a client or a server to wait for an acknowledgement before it can transmit again. This wait time could be negligent in a Local Area Network, but could get significant in a Wide Area Network and affect system performance.
The solution to this is to use WAN optimizer tools or accelerator tools which will minimize the number of round trips possibly by caching the responses.