Some understanding of the distributed aspects after learning Java

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.