Rohit Bansal
Rohit Bansal

Reputation: 1199

When should we ideally use Remote Procedure Calls?

I am working on an application in Java on Google App Engine where we have a concept of RPC, but when should we ideally make use of RPC? The same functionality that I am doing with RPC could be implemented even without it. So in what scenario should ideally RPC be designed.....?

Upvotes: 0

Views: 154

Answers (3)

Stephen C
Stephen C

Reputation: 719679

You typically use RPC (or similar) when you need to access a service that is external to the current application.

If you are simply trying to call a method that is part of this application (i.e. in this application's address space) then it is unnecessary ... and wasteful to use RPC.


... when should we ideally make use of RPC?

When you need it, and not when you don't need it.

The same functionality that I am doing with RPC could be implemented even without it.

If the same functionality can be implemented without RPC, then it sounds like you don't need it.

So in what scenario should ideally RPC be designed.....?

When it is needed (see above).

A more instructive answer would be scenarios where there are good reasons to implement different functions of a "system" in different programs running in different address spaces and (typically) on different machines. Good reasons might include such things as:

  • insulating one part of a system from another
  • implementing different parts of a system in different languages
  • interfacing with legacy systems
  • interfacing with subsystems provided by third party suppliers; e.g. databases
  • making use of computing resources of other machines
  • providing redundancy
  • and so on.

Upvotes: 1

Peter Lawrey
Peter Lawrey

Reputation: 533880

RPC is designed for request/response. i.e. you have a self contained request to a service and you expect a response (return value or a success/failure status)

You can use it anywhere you might use a method call except the object you are calling is not local to the current process.

Upvotes: 0

filip-fku
filip-fku

Reputation: 3265

It sounds like you don't need RPC in your application.

RPC is used whenever you need to access data from resources on the server that are not available on the client. For example web services, databases, etc.

Upvotes: 0

Related Questions