Difference between RPC and RMI

RPC vs RMI

RPC (Remote Procedure Call) and RMI (Remote Method Invocation) are two mechanisms that allow the user to invoke or call processes that will run on a different computer from the one the user is using. The main difference between the two is the approach or paradigm used. RMI uses an object oriented paradigm where the user needs to know the object and the method of the object he needs to invoke. In comparison, RPC isn’t object oriented and doesn’t deal with objects. Rather, it calls specific subroutines that are already established.

RPC is a relatively old protocol that is based on the C language, thus inheriting its paradigm. With RPC, you get a procedure call that looks pretty much like a local call. RPC handles the complexities involved with passing the call from the local to the remote computer. RMI does the very same thing; handling the complexities of passing along the invocation from the local to the remote computer. But instead of passing a procedural call, RMI passes a reference to the object and the method that is being called. RMI was developed by Java and uses its virtual machine. Its use is therefore exclusive to Java applications for calling methods on remote computers.

In the end, RPC and RMI are just two means of achieving the same exact thing. It all comes down to what language you are using and which paradigm you are used to. Using the object oriented RMI is the better approach between the two, especially with larger programs as it provides a cleaner code that is easier to track down once something goes wrong. Use of RPC is still widely accepted, especially when any of the alternative remote procedural protocols are not an option.

Summary:

1.RMI is object oriented while RPC isn’t
2.RPC is C bases while RMI is Java only
3.RMI invokes methods while RPC invokes functions
4.RPC is antiquated while RMI is the future


ncG1vJloZrCvp2OxqrLFnqmeppOar6bA1p6cp2aemsFwwMScn6ennKS0unvPq6atp5OkubR5xaipppmkqHyltcWfnKudnpiybq7Era6enZ5iv7GvjJqlnWWiorZw