1. Remote call
Generally speaking, there are two ways of remote calling between services, HTTP and RPC. HTTP mainly includes Httpclient, OkHTTP, RestTemplate, Feign (the RestTemplate package can be integrated with Ribbon for load balancing), etc.; RPC mainly includes dubbo, grpc, brpc, motan, rpcx, thrift, etc. This article mainly compares the remote service invocation framework Feign and Dubbo commonly used in the springcloud framework
2. Comparison of remote calls
Comparison item | feign | dubbo |
---|---|---|
protocol | http | rpc/rmi/http |
performance | generally | high |
connect | short connection | Long connection |
High concurrency | Not suitable | Suitable |
load balancing | Polling/random/ResponseTime weighting (client level algorithm) | Random/Polling/Activity/Consistency Hash (accurate to interface level algorithm) |
fault tolerance | Fuse mechanism | failover/failfast/brodecast/forking (retry, timeout introduced) |
For springcloud selection, alibaba uses dubbo (rpc or http), and netflix uses feign (http)
Note: If dubbo uses rpc, cross-language can be achieved through alibaba sidecar
Related recommendations:
1. Registration center selection comparison
2. Configuration center selection comparison
3. Gateway selection comparison
4. Remote call selection comparison
5. Distributed data consistency
6. Message queue selection comparison
7. Monitoring tool selection Contrast
8. Comparison of full link tracking model selection