4

Currently reading about RPC and RMI, I'm a bit confused about the difference.

When implementing RMI and for example gRPC, the syntax is basically the same.

They both have interfaces determining methods parameters and response.

They can both send objects in parameters (Java RMI doing it natively, C# gRPC with proto).

They both execute the request to the server through a method call on some object (based on the interface.

So what is the difference? Is it how the processes of data transfer happen between client and server?

By the looks of it RMI is just a Java implementation of RPC and gRPC is the C# implementation.

Sam H
  • 521
  • 3
  • 8
  • 19
  • Does this answer your question? [What is the difference between Java RMI and RPC?](https://stackoverflow.com/questions/2728495/what-is-the-difference-between-java-rmi-and-rpc) – user207421 Jan 11 '21 at 09:19
  • @user207421 I guess you should post this as an answer, since the debate is pretty much revolving around Java and C-like languages... – Mismatch Nov 09 '22 at 01:39

1 Answers1

3

RPC stands for Remote Procedure Call which supports procedural programming. Tt’s almost like IPC mechanism wherever the software permits the processes to manage shared information Associated with an environment wherever completely different processes area unit death penalty on separate systems and essentially need message-based communication. rpc

The above diagram shows the working steps in PRC implementation.

RMI stands for Remote Method Invocation, is a similar to PRC but it supports object-oriented programming which is the java’s feature. A thread is allowable to decision the strategy on a foreign object. In RMI, objects are passed as a parameter rather than ordinary data.

rmi

This diagram shows the client-server architecture of the RMI protocol.

RPC and RMI both are similar but the basic difference between RPC and RMI is that RPC supports procedural programming, on the other hand, RMI supports object-oriented programming.

Let’s see that the difference between RPC and RMI:

rmi vs rpc

  • You write that "In RMI, objects are passed as a parameter rather than ordinary data." I assume ordinary data means primitive types? if that's the case C# gRPC can also pass objects using proto) so isn't it doing the same thing? – Sam H Jan 09 '21 at 18:54
  • An argument to, or a return value from, a remote object can be any object that is serializable. This includes primitive types, remote objects, and non-remote objects that implement the java.io.Serializable interface –  Jan 09 '21 at 19:02
  • @SamH I was going to ask the same, but thinking about JAX-RPC in Java (a supplanted standard since 2015, but nevertheless, officially RPC) since it allows all the same... – Mismatch Nov 09 '22 at 01:31