Cross-service call of e-commerce system study notes

As mentioned in the first article Architecture, distributed business logic requires multiple services to be completed collaboratively, unlike clusters, multiple copies.

Since multiple service communication is required, the methods of communication between services are as follows:

1. Web service is based on SOAP protocol, which is cumbersome and not recommended.

2. REST If there are many services, the call chain is more complicated, although it can be analyzed through distributed tracing

3. Message bus (generally applicable to asynchronous communication)

4. Use dubbo    to use RPC protocol to make remote calls, directly communicate with sockets , which is highly efficient, and can count the calling relationship and the number of calls. But service only supports java language development


How to use dubbo?

Let's take a look at the configuration method of spring boot integrating dubbo:

service provider




service consumer




Dubbo configuration part reference:

https://www.cnblogs.com/umgsai/p/6246041.html

2. Dubbo principle

Dubbo is a distributed service framework dedicated to providing high-performance and transparent RPC remote service invocation solutions, as well as SOA service governance solutions.

Its core parts include:
  • Remote communication: Provides abstract encapsulation of various long-connection-based NIO frameworks, including various threading models, serialization, and information exchange in the "request-response" mode.
  • Cluster fault tolerance: Provides transparent remote procedure calls based on interface methods, including multi-protocol support, and cluster support such as soft load balancing, failure tolerance, address routing, and dynamic configuration.
  • Automatic discovery: Based on the registry directory service, the service consumer can dynamically find the service provider, making the address transparent, so that the service provider can smoothly increase or decrease the number of machines

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325421571&siteId=291194637