RPC(Remote Procedure Call) vs ORB(Object Request Broker) What is the difference and what is the relation with RMI
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Remote Procedure Call (RPC) and Object Request Broker (ORB) are both communication protocols used in distributed computing to enable inter-process communication. Despite their common goal of facilitating communication between different processes running on dispersed systems, they differ fundamentally in their design and implementation. Understanding these differences is crucial for software architects, developers, and anyone involved in the development of distributed systems.
Understanding RPC (Remote Procedure Call)
RPC is a protocol that one program can use to request a service from a program located in another computer or network without needing to understand network details. RPC abstracts the networking layer, making a remote server seem like a local object to the client's program.
Here is a simple example of how RPC works:
- The client calls a procedure, providing the necessary arguments.
- This call is intercepted by the client stub which marshals (packages) the procedure id and arguments into a standard format.
- The packaged data is sent over the network to the server.
- The server stub receives the data, unpacks the procedure id and arguments, and then calls the server's local procedure.
- The result of the procedure is sent back to the client stub, which unpacks the result and returns it to the calling function in the client.
RPC frameworks and implementations are available in various programming languages, such as Java’s RMI (Remote Method Invocation), Microsoft’s DCOM, or Sun's ONC RPC.
Understanding ORB (Object Request Broker)
ORB is part of the Object Management Group’s (OMG) CORBA (Common Object Request Broker Architecture) specification, which is designed to facilitate the communication of data between applications regardless of the platforms they are running on. ORB acts as a middleware in distributed computing and allows a client to call a method on a server object, which can be located on another machine without needing to understand the underlying network communications.
The workflow in an ORB-based system includes:
- Definition of the server object's interface using the Interface Definition Language (IDL).
- Compilation of the IDL which generates client-side stubs and server-side skeletons.
- The client invokes a method on the stub object.
- The stub communicates with the ORB core, which is responsible for finding the server object, passing the request.
- The server side ORB core delivers the request to the skeleton, which invokes the method on the actual server object.
- The response follows the reverse path back to the client.
Comparing RPC and ORB
To better understand the differences between RPC and ORB, consider the following table:
| Feature | RPC | ORB |
| Architecture | Procedure-based | Object-oriented |
| Communication | Simple data types | Supports complex objects |
| Compatibility | Language-dependent | Language-independent |
| Specification | Platform-specific | Standardized by OMG |
| Use Case | Ideal for simpler, homogeneous environments | Best for complex, distributed, heterogeneous environments |
Relationship with RMI (Remote Method Invocation)
RMI is a Java-only solution that combines the principles of RPC and ORB. While RMI operates similar to RPC as it enables the invocation of methods on remote objects, it uses Java's object-oriented capabilities, much like an ORB. RMI allows methods to pass Java objects as arguments and return values, even though the actual computations are performed on another (remote) JVM (Java Virtual Machine).
In conclusion, while both RPC and ORB enable communication in distributed environments, their use may depend on specific application needs, network complexity, and the required inter-operability among different systems. RMI stands as a form of RPC tailored specifically for Java applications, extending Java's "Write Once, Run Anywhere" capabilities to distributed computing.

