squirrelworks

1. RPC: Remote Procedure Call

Acorn

The "Action" Focus: RPC is designed to execute a specific function on a remote server as if it were local. It focuses on actions (verbs) rather than resources (nouns).

In an RPC model, the client sends a request to a server to execute a procedure using specific parameters. The server processes the call and sends the result back. It is tightly coupled, meaning the client and server must share the same interface definition. This makes it incredibly fast and efficient for internal microservices, but often brittle for public-facing web APIs where the client might change independently of the server.

Legacy to Modern: XML-RPC to gRPC

While early RPC used XML (XML-RPC), modern high-performance systems use gRPC. Developed by Google, gRPC uses Protocol Buffers (Protobuf) for serialization, making it significantly smaller and faster than JSON-based alternatives. This is why you see RPC used in low-latency environments like high-frequency trading or complex backend service meshes.


2. REST: Representational State Transfer

REST is not a protocol, but an architectural style. It treats everything as a unique resource identified by a URL. Instead of calling getUserData(), you perform a GET request on the /users/123 resource.

Statelessness

In REST, every request from a client must contain all the information necessary for the server to understand and process it. The server doesn't "remember" previous requests. This makes REST APIs incredibly easy to scale, as any server in a cluster can handle any incoming request.

Standardized Verbs

REST relies on standard HTTP methods: GET (Read), POST (Create), PUT (Update), and DELETE. This standardization allows browsers, caches, and proxies to understand the intent of a request without knowing anything about the specific data being transferred.


3. Coupling & Discoverability

The fundamental difference between these two styles lies in how "tightly" the client and server are bound together.

Critical Distinctions:
  • RPC Coupling: If you change a function name on the server, the client will break. Clients must know the exact procedures available.
  • REST Decoupling: REST uses HATEOAS (Hypermedia as the Engine of Application State). A server can send links to the client, telling it what it can do next, allowing the API to evolve without breaking the client.
  • Payload Efficiency: RPC (specifically gRPC) is much leaner. REST typically uses JSON, which is human-readable but carries more overhead due to its verbose text format.

4. API Architecture Comparison

Choosing between REST and RPC depends entirely on the use case—external web consumption vs. internal high-speed communication.

Feature / Aspect REST RPC (gRPC/JSON-RPC)
Primary Focus Resources (Nouns/URI) Actions (Verbs/Functions)
Coupling Loose (Independent Evolution) Tight (Shared Interface)
Data Format JSON, XML, HTML, Plaintext Protobuf, JSON, XML
HTTP Methods Strict use of GET, POST, etc. Usually just POST
Caching Native Browser/Proxy Caching Difficult / Implementation-heavy
Discoverability Self-describing (Links) Pre-defined (Contract-based)
Scalability High (Stateless) Variable (Connection-oriented)
Performance Standard (Text-based overhead) High (Binary/Compressed)
Error Handling HTTP Status Codes (404, 500) Custom Error Codes in Payload
Best Use Case Public Web APIs / Mobile Apps Internal Microservices / IoT

5. Implementation in Squirrelworks

In a robust Squirrelworks environment, these architectures often coexist. We might use a RESTful API to serve data to a Vue.js or jQuery frontend (as seen in the JS Course modules), while using an RPC-style mechanism for high-speed background tasks like database cleanup or log rotation.

Understanding the "Nouns vs. Verbs" distinction allows us to design more resilient systems. By choosing REST for public interfaces, we ensure that our web pages can scale and remain compatible across different browsers. Conversely, by understanding RPC, we gain insight into how legacy systems like MAPI functioned and how modern microservices communicate with maximum efficiency.





Sources
  1. reddit.com/r/computerscience/comments/j4djbh/rpc_vs_rest/
  2. aws.amazon.com/compare/the-difference-between-rpc-and-rest/
  3. cloud.google.com/blog/products/application-development/rest-vs-rpc-what-problems-are-you-trying-to-solve-with-your-apis
  4. en.wikipedia.org/wiki/Remote_procedure_call
  5. newsletter.systemdesign.one/p/how-rpc-works


Accessibility
 --overview

Agile
 --DevOps overview
 --Principles

API
 --REST best practices
 --REST demo
 --REST vs RPC
 --Wikipedia API

Blockchain
 --overview

Cloud
 --AWS overview

CSS/HTML
 --Bootstrap carousel
 --Grid demo
 --markdown demo

Electricity
 --fundamentals

Encoding
 --Overview

Ergonomics
 --Desk configuration
 --Device fleet
 --Input device array
 --keystroke mechanics
 --Phones & RSI

ERP
 --Anthology overview
 --Ellucian Banner
 --Higher Ed ERP Simulation Lab
 --PeopleSoft Campus Solutions
 --PESC standards
 --Slate data model

Git
 --syntax overview
 --troubleshooting libcrypto

Hardware
 --Device fleet
 --Homelab diagram

Java
 --Fundamentals

Javascript
 --Advanced Interaction: jQuery & UI Frameworks
 --input prompt demo
 --misc demo
 --Time and Date functions
 --Vue demo

Linux
 --grep demo
 --HCI and Proxmox
 --Proxmox install
 --xammp ftp server

Mail flow
 --DKIM, SPF, DMARC
 --MAPI

Microsoft
 --AZ-800: Administering Windows Server Hybrid Core Infrastructure
 --BAT scripting
 --Group Policy
 --IIS
 --robocopy
 --Server 2022 setup - Virtualbox

Misc
 --Applications
 --regex
 --Resources
 --Sustainable Computing
 --Terminology
 --Tribute to Computer Scientists

Networks
 --BGP Peering & Security Hardening Lab
 --CCNA Lammle Study Guide
 --Cisco 1921/K9 router
 --routing protocols
 --throughput calculations

PHP/SQL
 --Cookies
 --database interaction
 --demo, OSI Layers quiz
 --Foreign key constraint demo
 --fundamentals
 --MySQL and PHPmyAdmin setup
 --pagination
 --security
 --session variables
 --SQL fundamentals
 --structures
 --Tables display

Python
 --fundamentals

Security
 --Overview- GRC (Governance, Risk, and Compliance)
 --Security Blog
 --SSH fundamentals

Serialization
 --JSON demo
 --YAML demo