RPC vs API
RPC vs. API
- -| RPC: Remote Procedure Call
- RPC: a client invokes a function on a remote server (as if it were local).
- RPC: Protocols; XML-RPC (WordPress uses it), JSON-RPC, DCOM, RMI, and CORBA
- -| API: Application Programming Interface
- API: A set of rules and specifications to define how the interactions should work.
- API: Can expose; web services, libraries, and frameworks
- API: Protocols and formats; HTTP, REST, SOAP, GraphQL, XML, JSON, etc.
- -| The difference is on the level of abstraction.
- RPC: Low-Level, very close to the implementation (the clients know the signature)
- API: High-Level, away from the implementation (the client only needs endpoints and API Parameters)
- RPC: highly coupled; changes to the implementation have a high impact.
- API: loosely coupled; changes to the implementation have a low impact.
- RPC is more efficient and faster. Uses binary formats
- API: can be complex and slower. Usually more textual.