Since there is an HTTP request, why use RPC calls?

HTTP protocol to regulate Restful which represented a great advantage. It is readable, and can be supported by the firewall, cross-language support. Moreover, in last year's report, Restful much more than RPC trend.

This would like to quote the report contents, but unfortunately recently for some reason, KeXueShangWang was the Qiang. When I out of the wall in the future, then a supplement.

HTTP has its drawbacks, however, which is corresponding to its advantage. The first is a small proportion of useful information, after all, work in the seventh layer HTTP, HTTP contains a large number of first-class information. Followed by the low efficiency, or because the sake of the seventh floor. Also, readability does not seem necessary, because we can introduce a gateway to increase readability. In addition, remote method call using the HTTP protocol is more complex, to package a variety of parameter name and value.

 

The RPC and HTTP are complementary, we detail next. After reading this answer, RPC allows you to produce, principles, implementation code have a clear understanding. This would also help the business system, good choice between RPC and HTTP.

 

But need to say again, not to say good RPC, HTTP does not mean good, both strengths and weaknesses, is still in the competition.

 

I got to ask who? According to my business scenarios, flexible stations ......


 

The English name is RPC Remote Procedure Call, translated into Chinese is called "remote procedure call." Which is actually somewhat obscure "process", the process is actually method. Therefore, RPC can be understood as "Remote Method Invocation."

 

To understand the remote procedure call, we understand that first procedure call. Very simple, as shown, it is to call a method. This is all too common, not much explanation.

In a distributed system, because the boundary of each service are small, it is likely to call methods of other services provided. This presented a service method A calls B service needs, namely remote procedure calls.

 

To get the service method A calls B in service, the first thought is achieved through an HTTP request. Yes, it is very common, such as service B exposure Restful interface, and then let's call it A service interface. Based on the call Restful

Guess you like

Origin blog.csdn.net/jxq0816/article/details/104574287