Learn about RPC, why RPC was born, and what's the difference between RPC and HTTP?

Also a galaxy 2021-01-14 14:59:43
learn rpc rpc born difference


Get to know RPC, Why was it born RPC, and HTTP What's the difference ?

Opening question

  1. What is? RPC?
  2. Why RPC, What problem to solve ?
  3. RPC And HTTP What's the difference ?
  4. You know how many RPC?

know RPC

RPC:Remote Procedure Call, Remote procedure call . It means that the computer program makes the process in different address space ( Usually on another computer on a shared network ) Execution time , It's encoded like normal ( Local ) Procedure call , Without the programmer explicitly coding the details for remote interaction .

RPC It's a kind of server - client (Client/Server) Pattern , The classic implementation is a way to do it through Send a request - Accept the response A system for information exchange .

RPC Is interprocess communication (IPC) A form of , Because different processes have different address spaces : If it's on the same host , Even if the physical address space is the same , They also have different virtual address spaces ; If they're on different hosts , The physical address space is different . Many different ( It's usually incompatible ) Technology has been used to implement this concept .

【 Simple understanding 】: Two different computers ( Program ), Computer A There is one Agreement , Computer B Want to call Computer A Need to pass through Agreement To make a communication call .

RPC The birth of

In fact as early as 1982 About years ago RPC It's used by people to communicate with distributed systems , The earliest invention 『 Remote procedure call 』 The person who uses this word is 『 Bruce · jay · Nielsen (Bruce Jay Nelson)』 About it. 1981 year .

We're familiar with Java stay 1.1 Version provides Java Version of RPC frame (RMI), At this time in 1990 After year , Basically RPC It is widely used in system to system calls . But only in the back end , For the public, more contact is still needed HTTP Such agreement , Therefore RPC Let the public know more about cognition later .

RPC And HTTP

Let's start with HTTP

HTTP:Hypertext Transfer Protocol Hypertext transfer protocol .

HTTP The agreement 1990 It only began to appear as a mainstream agreement in 1997 ; The reason why they are known to us , Because usually HTTP be used for web End , That is to say web The browser and web Server interaction . When ajax and json When the front end is popular ,json And it's starting to play its part , Simplicity and ease of use make json Become the mainstream choice of front and back end data transmission .HTTP In the agreement Restful Specification as representative , It has a lot of advantages . it Good readability , And You can get Firewall support 、 Cross language support .

HTTP The shortcomings of the new technology are soon exposed :

  1. Less useful information ,HTTP stay OSI The seventh floor , It contains a lot of HTTP First class information
  2. Low efficiency , Because of the seventh floor , There are a lot of layers in the middle
  3. HTTP agreement Calling remote methods is complicated , Need to encapsulate various parameter names and parameter values, as well as encrypted communication, etc

therefore RPC Good news ?

  1. It's all useful information
  2. Efficient
  3. Easy to call
  4. No need to care about network transmission or communication

HTTP and RPC There's a connection

http It's also rpc A way of doing it .

RPC and HTTP In a word, it's different

RPC It's like a regional dialect , Only the inside knows , Both sides need to know the dialect , Otherwise, we can't communicate

HTTP It's Putonghua , Basically understand , I can also say

RPC It's usually used for ?

stay Microservices 、 Distributed It has become the everyday today , Services are usually deployed on different servers , The servers are also in different regions , At this time, there is a cross region and cross server call problem ,RPC That is to say, it can be used in similar situations .

RPC For internal use of the company , Low performance consumption , High transmission efficiency , Service governance is convenient , But it's not recommended to transfer large text 、 Video etc. .

Questions at the end of the passage

  1. Does it make you understand HTTP and RPC Some of them are different ?
  2. RPC What do you want to do with it ?
  3. You're using RPC Do you ?
版权声明
本文为[Also a galaxy]所创,转载请带上原文链接,感谢
https://javamana.com/2021/01/20210114145911667n.html

  1. Redis basic command
  2. Summary of MySQL articles
  3. 2、 Create k8s cluster in 5 seconds
  4. data自定义属性在jQuery中的用法
  5. Linux常见解压缩
  6. Detailed explanation of HBase basic principle
  7. 1、 Why and how to learn k8s
  8. Java advanced (29) -- HashMap set
  9. java中大文件上传
  10. Weblogic 2017-3248 analysis of Java Security
  11. Kubernetes official java client 8: fluent style
  12. Explain the function of thread pool and how to use it in Java
  13. Programming software tutorial video Encyclopedia: C + + / Java / Python / assembly / easy language (with tutorial)
  14. Description of dependency problem after javacv is updated to 1.5. X and how to reduce the size of dependency package
  15. Java reflection & dynamic agent
  16. Building Apache 2.4 + php7 + mysql8 in centos7 environment
  17. Summary of Java multithreading (1)
  18. Oracle AWR report generation
  19. Four magic functions of mybatis, don't step on the pit!
  20. A 16-year-old high school student successfully transplanted Linux to iPhone and posted a detailed guide
  21. Centos7 one click installation of JDK1.8 shell script
  22. Mounting of file system in Linux (centos7)
  23. How does serverless deal with the resource supply demand of k8s in the offline scenario
  24. Detailed explanation of HBase basic principle
  25. Spring security oauth2.0 authentication and authorization 4: distributed system authentication and authorization
  26. Redis performance Part 5 redis buffer
  27. JavaScript this keyword
  28. Summary of Java multithreading (3)
  29. Sentry(v20.12.1) K8S 云原生架构探索, SENTRY FOR JAVASCRIPT 手动捕获事件基本用法
  30. Sentry(v20.12.1) K8S 云原生架构探索, SENTRY FOR JAVASCRIPT 手动捕获事件基本用法
  31. (10) Spring from the beginning to the end
  32. Summary of Java multithreading (2)
  33. Spring source notes! From the introduction to the source code, let you really understand the source code
  34. A stormy sunny day
  35. Zookeeper (curator), the implementation of distributed lock
  36. Show the sky! Tencent T4's core Java Dictionary (framework + principle + Notes + map)
  37. Spring boot project, how to gracefully replace the blank value in the interface parameter with null value?
  38. Spring boot project, how to gracefully replace the blank value in the interface parameter with null value?
  39. docker+mysql集群+读写分离+mycat管理+垂直分库+负载均衡
  40. docker+mysql集群+读写分离+mycat管理+垂直分库+负载均衡
  41. To what extent can I go out to work?
  42. Java 使用拦截器无限转发/重定向无限循环/重定向次数过多报错(StackOverflowError) 解决方案
  43. Implementation of rocketmq message sending based on JMeter
  44. How to choose the ticket grabbing app in the Spring Festival? We have measured
  45. Implementation of rocketmq message sending based on JMeter
  46. My programmer's Road: self study java
  47. My programmer's Road: self study java
  48. All in one, one article talks about the use of virtual machine VirtualBox and Linux
  49. All in one, one article talks about the use of virtual machine VirtualBox and Linux
  50. Java 使用拦截器无限转发/重定向无限循环/重定向次数过多报错(StackOverflowError) 解决方案
  51. [Java training project] Java ID number recognition system
  52. How does serverless deal with the resource supply demand of k8s in the offline scenario
  53. Detailed explanation of HBase basic principle
  54. Explain the function of thread pool and how to use it in Java
  55. Kubernetes official java client 8: fluent style
  56. 010_MySQL
  57. Vibrant special purchases for the Spring Festival tiktok section, hundreds of good things to make the year more rich flavor.
  58. 010_MySQL
  59. Of the 4 million docker images, 51% have high-risk vulnerabilities
  60. Rocketmq CPP client visual studio 2019 compilation