Understanding RPC vs HTTP: Architecture, Differences, and Popular Frameworks

This article explains the fundamental differences between RPC and HTTP services, covering the OSI model, RPC architecture components, synchronous vs asynchronous calls, and reviews popular RPC frameworks such as gRPC, Thrift, and Dubbo, helping developers choose the right approach for backend development.

Top Architect
Top Architect
Top Architect
Understanding RPC vs HTTP: Architecture, Differences, and Popular Frameworks

The author, a senior architect, starts by pointing out the common confusion between RPC (Remote Procedure Call) and HTTP calls, noting that many developers treat them as interchangeable.

To clarify, the article briefly revisits the OSI seven‑layer network model (Application, Presentation, Session, Transport, Network, Data Link, Physical) and emphasizes that RPC primarily operates at the transport layer (TCP), while HTTP is an application‑layer protocol.

It then outlines the essential components of a typical RPC architecture: a Client, a Server, a Client Stub that packages requests, and a Server Stub that unpacks them and invokes local methods. The author explains how these pieces enable remote method invocation and reduce client‑side dependencies.

The discussion moves to call semantics, distinguishing synchronous calls (the client waits for a result) from asynchronous calls (the client proceeds without waiting, using callbacks or futures). Java’s Callable and Runnable interfaces are used as examples of how to implement each style.

Three widely used open‑source RPC frameworks are introduced:

gRPC : Google’s framework built on HTTP/2, supporting multiple languages and leveraging Netty.

Thrift : Facebook’s cross‑language service framework with an IDL and code generation.

Dubbo : Alibaba’s mature RPC solution with pluggable protocols and serialization, often used in large‑scale Java micro‑services.

For contrast, the article describes traditional HTTP/REST services, showing a simple POST example (wrapped in a code block):

POST http://www.httpexample.com/restful/buyer/info/shar

It notes that HTTP is straightforward, language‑agnostic, and suitable for smaller projects or low‑traffic APIs.

Finally, the author compares the two approaches: RPC offers higher efficiency, persistent connections, and rich monitoring for large enterprises, whereas HTTP provides simplicity and rapid iteration for smaller services. The conclusion advises choosing the technology based on project size, performance needs, and ecosystem compatibility.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend DevelopmentRPCHTTPframeworks
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.