10

I have googled a little to find a good explanation of the difference between the above two remoting strategies, i.e. transparent remoting and location transparency.

As far as I know, the former is at the base of Java RMI, the latter at the base of Akka. I know very well Java RMI and I understand what transparent remoting means, but what about Akka?

Thanks a lot for all the responses.

Batiaev
  • 1,173
  • 1
  • 14
  • 30
riccardo.cardin
  • 7,971
  • 5
  • 57
  • 106

3 Answers3

15

The two are actually opposites.

"Transparent Remoting" is about making remote calls look like local calls. "Location transparency" is about making local calls look like remote calls.

While this may not sound like a big deal—it is. It is all about the assumptions you can make. Typically local invocations have a much higher fidelity as there is a lot fewer possible error and failure modes. By embracing those failure and error modes in "Location transparency" it does no longer matter technically where the sender and receiver is located.

With "Transparent Remoting" it is not evident that you are crossing a asynchronous and binary boundary, and as such, whether the calling thread will be able to make progress, whether there will be a notification on communication problems or information loss or corruption.

I hope that answers your question,

Cheers, √

Viktor Klang
  • 26,479
  • 7
  • 51
  • 68
5

See the docs:

The previous section describes how actor paths are used to enable location transparency. This special feature deserves some extra explanation, because the related term “transparent remoting” was used quite differently in the context of programming languages, platforms and technologies.

Basically, transparent remoting is tied to RMI (as you said yourself) and means invoking methods on objects without knowing whether the methods are executed locally or the data has been sent over the network to be executed on a remote object.

Location transparency is a similar philosophy, but related to actors. It means that Akka API doesn't differentiate between local and remote actors. More specifically, it means that even though an actor may be running either in a local or a remote actor system, once you obtain it (using system name, actor name and remote machine host+port) you use it just as you would if it were running locally. If you switch some actor from running locally to running remotely (or vice versa), only thing you need to change is the actor lookup (since it's now on a different host). But once an ActorRef has been obtained, the rest of your code doesn't care if the actor is running locally or remotely.

See also here.

slouc
  • 9,508
  • 3
  • 16
  • 41
0

A few years later im reading this post and i think both answares might not be right.

I'm reading Reactive Design Patterns Book and there it says on the topic location transparency on page 210:

"[…] Consequently the calling object needs to be aware of the location of the receiving object, or at least it needs to know that the receiver does not support normal method calls. Location transparency is the property that source code for sending a message looks the same regardless of where the recipient will process it"

I understand it like this:

  • calling Object: source code for sending a message looks the same [...]
  • receiving Object: can be local or remote, calling object does not care

and on the topic transparent remoting the book says: "[...]„ unify the programming model for local and remote method invocations through transparent remoting: making remote invocations appear the same as local ones" I understand it like this:

  • calling Object: can be local or remote, receiving object does not care
  • receiving Object: remote invocations appear the same as local ones
  • 2
    Hey, Julian. It seems to me that your answer is the same as the one of Viktor. Anyway, you've just said that Viktor Klang doesn't know the difference between the two concepts! :O – riccardo.cardin Sep 20 '21 at 13:47
  • no i did not said that. I said "it might not be right", this could also mean, that i did note fully understand Viktor answer (: – Julian Schiller Sep 20 '21 at 14:42
  • and actually, after Reactive Design Patterns Book from Roland Kuhn et al, the way he wrote it, is not 100% right. At least i would not get full points with this answer in my exam, but we work with Kuhn. – Julian Schiller Sep 20 '21 at 16:30