current position：Home>Comparison between RPC service and HTTP service, Huawei finance 2021 spring recruitment interview
Comparison between RPC service and HTTP service, Huawei finance 2021 spring recruitment interview
2021-08-26 13:24:08 【Programmer poison coin】
Say RPC and HTTP Before the difference , I think it's necessary to understand OSI Seven layer network structure model of （ Although it is basically five layers in practical application ）, It can be divided into the following layers ： （ From top to bottom ）
first floor ： application layer . It defines the interface for communication and data transmission in the network ;
The second floor ： The presentation layer . Define the transmission format of data in different systems , Coding and decoding specifications, etc ;
The third level ： The session layer . Manage user sessions , Control the establishment and interruption of logical connections between users ;
The fourth level ： Transport layer . Manage the end-to-end data transmission in the network ;
The fifth floor ： The network layer . Define how data is transferred between network devices ;
The sixth floor ： The link layer . Encapsulate the data packets of the above network layer into data frames , Easy to transport in the physical layer ;
The seventh floor ： The physical layer . This layer is mainly to transmit these binary data .
In practice , There is no presentation layer and session layer in the five layer protocol structure . It should be said that they are merged with the application layer . We should focus on the application layer and the transport layer . because HTTP It's the application layer protocol , and TCP It's the transport layer protocol . good , After knowing the hierarchical model of the network, we can better understand why RPC Service comparison HTTP The service was better ！
Two 、RPC service
This is called RPC ah ,, See light suddenly ！
RPC Mainly used in large enterprises , Because there are many systems in large enterprises , Business lines are complex , And the efficiency advantage is very important , This is the time RPC The advantages are obvious , This is what we do in actual development , Projects generally use maven To manage . For example, we have a system service for processing orders , First declare all its interfaces （ This means java Medium interface）, Then package the whole project into one jar package , The server side introduces this two-way library , And then realize the corresponding functions , The client side only needs to introduce this two-party library to call .
Why do you do this ？ Mainly to reduce the number of clients jar Bag size , Because every time I pack and release ,jar Too many packages always affect efficiency . In addition, it decouples the client and the server , Improve code portability .
The synchronous call is timely, and the client waits for the execution to complete and returns the result .
Asynchronous call means that the client does not wait for the call to complete and return the result , However, you can still receive the notification of the returned result through the callback function . If the client doesn't care about the results , It can be a one-way call . The process is a bit like Java Medium callable and runnable Interface , When we do asynchronous operations , If you need to know the result of execution, use callable Interface , And through Future Class gets the result information of asynchronous execution . If you don't care about the result of execution , Use it directly runnable The interface will do , Because it doesn't return results , Of course! ,callable It's OK, too , We don't go to get Future That's all right. .
Dubbo It is a very famous open source project of Alibaba group RPC frame , It is widely used in many Internet companies and enterprises . Both the protocol and the serialization framework can be pluggable . The remote interface is based on Java Interface, And rely on Spring Framework is easy to develop . Can be easily packaged into a single file , Independent process running , It is consistent with the concept of microservice .
3、 ... and 、HTTP
It's job hopping season , I sorted out some real interview questions asked by big factories , Due to the length limit of the article , Only some topics are shown to you , more Java Basics 、 abnormal 、 aggregate 、 Concurrent programming 、JVM、Spring Family bucket 、MyBatis、Redis、 database 、 middleware MQ、Dubbo、Linux、Tomcat、ZooKeeper、Netty wait … Has been collated and uploaded on my Tencent documents 【 First line internet factory Java Core interview question bank 】 Click to collect , And will continue to update … Interested friends can see and support a wave ！
author[Programmer poison coin],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Crazy blessing! Tencent boss's "million JVM learning notes", real topic of Huawei Java interview 2020-2021
- How to implement injection in vuex source code?
- JQuery operation select (value, setting, selected)
- An article disassembles the pyramid architecture behind the gamefi outbreak
- BEM - a front-end CSS naming methodology
- [vue3] encapsulate custom global plug-ins
- Error using swiper plug-in in Vue
- Another ruthless character fell by 40000, which was "more beautiful" than Passat and maiteng, and didn't lose BMW
guess what you like
Huang Lei basks in Zhang Yixing's album, and the relationship between teachers and apprentices is no less than that in the past. Netizens envy Huang Lei
He was cheated by Wang Xiaofei and Li Chengxuan successively. Is an Yixuan a blessed daughter and not a blessed home?
Zhou Shen sang the theme song of the film "summer friends and sunny days" in mainland China. Netizen: endless aftertaste
Pink is Wangyuan online! Back to the peak! The new hairstyle is creamy and sassy
Front end interview daily 3 + 1 - day 858
Spring Webflux tutorial: how to build reactive web applications
[golang] walk into go language lesson 24 TCP high-level operation
August 23, 2021 Daily: less than three years after its establishment, Google dissolved the health department
The female doctor of Southeast University is no less beautiful than the female star. She has been married four times, and her personal experience has been controversial
There are many potential safety hazards in Chinese restaurant. The top of the program recording shed collapses, and the artist will fall down if he is careless
- Anti Mafia storm: He Yun's helpless son, Sun Xing, is destined to be caught by his dry son
- Introduction to flex flexible layout in CSS -- learning notes
- CSS learning notes - Flex layout (Ruan Yifeng tutorial summary)
- Today, let's talk about the arrow function of ES6
- Some thoughts on small program development
- Talk about mobile terminal adaptation
- Unwilling to cooperate with Wang Yibo again, Zhao Liying's fans went on a collective strike and made a public apology in less than a day
- JS function scope, closure, let, const
- Zheng Shuang's 30th birthday is deserted. Chen Jia has been sending blessings for ten years. Is it really just forgetting to make friends?
- Unveil the mystery of ascension
- Asynchronous solution async await
- Analysis and expansion of Vue infinite scroll source code
- Compression webpack plugin first screen loading optimization
- Specific usage of vue3 video play plug-in
- "The story of huiyeji" -- people are always greedy, and fairies should be spotless!
- Installing Vue devtool for chrome and Firefox
- Basic usage of JS object
- Two easy-to-use animation JS that make the page move
- Front end Engineering - scaffold
- Java SQL Server intelligent fixed asset management, back end + front end + mobile end
- Array de duplication problem solution - Nan recognition problem
- New choice for app development: building mobile applications using Vue native
- New gs8 Chengdu auto show announces interior Toyota technology blessing
- Vieira officially terminated his contract and left the team. The national security club sent blessings to him
- Less than 200000 to buy a Ford RV? 2.0T gasoline / diesel power, horizontal bed / longitudinal bed layout can be selected
- How does "heart 4" come to an end? Pinhole was boycotted by the brand, Ma Dong deleted the bad comments, and no one blessed him
- We are fearless in epidemic prevention and control -- pay tribute to the front-line workers of epidemic prevention!
- Front end, netty framework tutorial
- Xiaomi 11 | miui12.5 | android11 solves the problem that the httpcanary certificate cannot be installed
- The wireless charging of SAIC Roewe rx5 plus is so easy to use!
-  typescript
- CSS transform Complete Guide (Second Edition) flight.archives 007
- Ajax foundation - HTTP foundation of interview essential knowledge
- Cloud lesson | explain in detail how Huawei cloud exclusive load balancing charges
- [JS] 10. Closure application (loop processing)
- Left hand IRR, right hand NPV, master the password of getting rich