Understanding RPC: Concepts, Comparison with SOA/SOAP/REST, and Popular RPC Frameworks
This article explains what RPC is, compares it with SOA, SOAP, and REST, outlines the step‑by‑step RPC execution process, and introduces several mainstream RPC frameworks such as RMI, Hessian, protobuf‑rpc‑pro, Thrift, Avro, and Dubbo.
What is RPC?
RPC (Remote Procedure Call) is a protocol that allows a program to request services from a remote computer without needing to understand the underlying network details, enabling access to remote resources as if they were local.
Key aspects include communication protocol, serialization, interface description, service framework, performance, language support, and more.
Differences between SOA, SOAP, REST, and RPC
REST is an HTTP‑based simple API using JSON, easy to use but less secure. SOAP is an XML‑based heavyweight protocol with WS‑Security. SOA is a service‑oriented architecture for loosely coupled, coarse‑grained services. RPC provides direct function invocation across machines, sharing many characteristics with the others but differing in usage scenarios.
RPC Working Principle
Client obtains a handle and sends parameters.
Local kernel sends a network message.
Message reaches the remote host.
Server handle receives the message and extracts parameters.
Remote procedure is executed.
Result is returned to the server handle.
Server handle sends the result back via the kernel.
Message returns to the client host.
Client kernel receives the message.
Client receives the returned data.
Mainstream RPC Frameworks
Typical frameworks include:
RMI : Java RMI using Java Remote Method Protocol and native serialization.
Hessian : Lightweight HTTP‑based remoting with binary encoding.
protobuf‑rpc‑pro : Java library based on Google Protocol Buffers and Netty, supporting TCP reuse, SSL, cancellation, and logging.
Thrift : Cross‑language scalable framework with code generation for C++, C#, Java, Python, PHP, Ruby, using sockets.
Avro : Hadoop‑origin data exchange protocol supporting HTTP and TCP.
Dubbo : Alibaba’s high‑performance service framework that integrates with Spring; uses Zookeeper for service registration and discovery.
Simple Dubbo usage involves registering interfaces in Zookeeper, declaring required interfaces, and letting Zookeeper notify services.
For a detailed Dubbo introduction, see the linked article.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Mike Chen's Internet Architecture
Over ten years of BAT architecture experience, shared generously!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
