hoangquochung1110 / public-notes

0 stars 0 forks source link

REST API vs Remote Procedure Invocation (RPI) #25

Open hoangquochung1110 opened 2 months ago

hoangquochung1110 commented 2 months ago

REST API vs Remote Procedure Invocation (RPI)

Similarities

Key Differences

Aspect | REST API | Remote Procedure Invocation (RPI) -- | -- | -- Philosophy | Resource-oriented | Procedure-oriented Abstraction | Resources with state | Methods with parameters Protocol | Primarily HTTP/HTTPS | Various (HTTP, TCP, custom) Interface | Uniform interface using standard HTTP methods | Custom methods/procedures State | Stateless by design | Can be stateful or stateless Format | Typically JSON or XML representations | Various formats, often binary Discovery | Often uses hypermedia (HATEOAS) | Typically uses service registry or IDL Coupling | Loose coupling | Usually tighter coupling Caching | Built-in HTTP caching mechanisms | Custom caching if implemented Example Implementations | RESTful Web Services | gRPC, RMI, CORBA, SOAP Usage Pattern | GET /users/123 → User resource returned | getUserById(123) → User object returned Error Handling | HTTP status codes | Exceptions or error objects Origin | 2000s, web-centric | 1970s, distributed computing

Common Use Cases