Learning high-performance service system: RCP and remote call

About RPC remote call RPC:

Remote procedure call protocol

Function: The client did not know the details of the case to call, call an object on a remote computer, like objects on this application calls. Common RPC implementation

  • dubbo
  • Apache Thrift
  • GRPC
  • Hetty

Affect the performance of RPC framework of factors:

  • Supported network I / O model

  • Based network protocol

  • Message encapsulation format

  • Implemented service management

RCP: unusual problem solving

Distributed Transaction solve the problem: two-phase commit protocol (2PC)
TCC distributed transaction
solve the problem:
to ensure service between the micro atomic transaction operations, consistency is guaranteed.

TCC flexible Affairs (Distributed Transaction):
Here Insert Picture Description
Implementation by declaring Confirm and Cancel methods in the annotation methods.

CAP theorem

  • consistency
  • Partition tolerance
  • Availability

According to the principle of CAP as a target, mainly to ensure strong consistency of the database system.
Strong Consistency: reading X client at any time, whether it be the read operation at that node distributed system, read the value of X is consistent.

Transaction compensation mechanism
functions: If one atom is not the service fails to submit the data before the rollback, but reverse the previous results performed by a corresponding reverse services.

Hystrix fuse mechanism
functions: a distributed service forward and reverse operation of the separation operation, and by setting a maximum wait time, throwing an exception and other methods to make the reverse operation is performed automatically.
Compensation mechanism for resolving matters reverse operation result, other services can not be performed, resulting in an avalanche of system.

Guess you like

Origin blog.csdn.net/weixin_40990818/article/details/86516348