I've heard the word RPC, Remote Procedure Call, several times now.
I never knew what it was, so decided to dive into it.
To understand a concept, I like to take a step back and focus on the problem first.
This makes it easier to comprehend the concept.
Remote Procedure Call
Imagine a company has several departments, each with its own set of applications and data.
For instance, the sales department has a sales application, the HR department has a human resources management system, and so on. To work effectively together, these applications need to share information and functionality.
Challenges the company faces:
Communication: Different applications need to communicate with each other efficiently.
Scalability: As the company grows, the number of applications and the need for interaction between them also grows.
Maintaining Data Consistency: Ensuring that data shared across various applications remains consistent.
Complexity in Integration: Each application might be built using different technologies, making integration complex.
RPC solves these challenges by enabling different applications to communicate with each other as if they were local calls within the same system.
From the user's perspective, when invoking RPCs, it's as if they're invoking local functions.
Solving the communication problem: With RPC, an application in one department can easily call a procedure in an application of another department. It's like one application saying to another, "Hey, please execute this function and give me the result" as if the function was part of its own codebase.
Scalability: RPC provides a standard way of communication, making it easier to add new services without major changes to existing ones.
Ensuring Data Consistency: When one application updates information, it can immediately inform other applications through an RPC call.
Reducing Complexity in Integration: RPC abstracts the complexity of network communication. Developers don't have to write complex code to handle network protocols, data serialization, etc. They can just call remote procedures as if they were local.
RPCs are good when you need multiple different kinds of systems to work with each other.