惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
U
Unit 42
B
Blog RSS Feed
博客园 - 【当耐特】
T
Tailwind CSS Blog
V
V2EX
S
SegmentFault 最新的问题
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
量子位
aimingoo的专栏
aimingoo的专栏
Stack Overflow Blog
Stack Overflow Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
P
Proofpoint News Feed
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
RPC vs REST, a protocol choice
Lavkesh Dwivedi · 2026-06-20 · via DEV Community

Originally published on lavkesh.com


When designing a system that communicates across the network, you're choosing between two approaches. RPC and REST solve the same problem but from opposite angles.

RPC, or Remote Procedure Call, is about treating network calls like function calls. You invoke a remote method, saying 'execute this procedure on that machine and give me the result.' The underlying protocol can be TCP, UDP, HTTP, or something proprietary. This flexibility is both a strength and a weakness.

For example, I once worked on a project where we used gRPC for internal communication between microservices. We achieved significant performance improvements, with latency reduced by 30% and throughput increased by 25%, compared to our previous REST-based implementation. However, we had to invest considerable effort into managing server state and affinity.

RPC is synchronous by default. You send a request and wait for a response. The interface is built around methods, giving you a clear contract about what you can call and what arguments it needs. Examples include gRPC, Apache Thrift, and older systems like CORBA. RPC systems often maintain state on the server side, making them efficient for certain workloads but complicating scaling.

REST is fundamentally different. Instead of remote procedures, you think about resources. Everything is a thing you can retrieve, create, update, or delete using standard HTTP verbs. Your API isn't a menu of procedures; it's a collection of nouns accessed through GET, POST, PUT, and DELETE.

In a large-scale e-commerce platform I worked on, we used REST for our public API. We had to handle millions of requests per second, and the stateless nature of REST made it easy to scale. We were able to spin up new servers on demand, and the HTTP-based infrastructure worked seamlessly with our load balancers and CDNs. However, we had to implement caching at multiple layers to optimize performance.

The tradeoffs are clear. RPC offers flexibility in protocols used, which matters for custom performance optimizations. RPC also often has lower overhead for high-frequency, method-call style interactions. However, this flexibility comes at a cost. RPC systems are harder to reason about at scale and often require more infrastructure to handle state management and affinity.

REST's statelessness is its key feature. You can cache at every layer, put servers anywhere, and reason about what happens if one server dies. The entire web infrastructure, including proxies, CDNs, and load balancers, understands HTTP. REST uses that for free. The tradeoff is that you're constrained by HTTP's semantics, and some problems don't fit neatly into CRUD operations on resources.

Modern systems often mix both approaches. A public API might use REST because it needs to work everywhere, while internal communication might use RPC like gRPC for efficiency. The choice isn't about one being better; it's about understanding what each gives you and what it costs.