Tag: Call response time throughput GPO return value core Kotlin ice cloud
After learning Java, I can also calculate the whole stack (laughter).
Java is very convenient for everything based on spring, unlike node's express needs to find its own middleware.
This article may not be too long, mainly about distributed understanding.
Assuming a spring cloud-based application, the core business is Servicecore, which includes ServiceA and ServiceB, where a is accessed through a cloud service. and log the core business after it's done
The process is as follows:
Servicecore->
Clouda.servicea ()//This will block
SERVICEB ()//This will perform its own business
Servicelog->
Cloudlog.servicelog ()
In this process Servicecore regardless of the use of distributed, its execution time is not reduced, and will increase the time of data transmission.
So why use distributed?
If you write the server with Kotlin, using the co-process model (coroutine), so that a thread can be multi-threaded, the coprocessor can be blocked in parallel, the resources can be freed to increase throughput.
In other words, the core of a high concurrency scenario is to respond quickly to users.
Even in a clustered environment, the throughput of a set of services is limited, and the server cannot continue to receive user requests when the thread pool resource dries up.
For the core business, the business is divided into several services and given to RPC processing, the main service can be vacated resources to receive more user requests, and the core business is the invocation of services, all operations are executed in parallel.
Rather than the core business, you can use Message Queuing to push it out, and this part of the business we don't need a return value.
Seemingly for a single user, the distribution does not reduce the response time, but it does actually reduce the overall system response time.
Some understanding of the distributed aspects after learning Java