File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using RMI vs Socket programming

 
Anoop Isaac
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have 4 web server instances running on the same machine behind a load balancer. All the instances are serving the same application. I want a module taken out the of these 4 instances and run it as a separate service, so that i can reduce the load on the above 4 instances.This service needs to send back a simple json response after doing some index search,service is not exposed to any outside client. So given this simple requirement, what would be the best solution to implement the new service, mainly considering performance . Will it be RMI or socket programming or is there any other solution. Will I have to sacrifice performance if I go for RMI instead of socket programming?

Thanks
Anoop
 
Amit Ghorpade
Bartender
Posts: 2851
10
Fedora Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to understand why socket programming is needed here. Maybe I am not getting the requirement correct.
Why not have a firewall to block anything that is not allowed to access?
Its easy, decoupled and configurable from my point of view.

Hope this helps
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
multiple webservers running on the same machine.


Really? Multiple web servers? - How do you sort out the ports?

Or do you mean one web server with multiple web applications?

How big is the user load?

Bill
 
Anoop Isaac
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amit Ghorpade wrote:I am not able to understand why socket programming is needed here. Maybe I am not getting the requirement correct.
Why not have a firewall to block anything that is not allowed to access?
Its easy, decoupled and configurable from my point of view.

Hope this helps
As I said, we already have for web server instances running on the same machine behind a load balancer. All the instances are having the same application deployed. I want to take a module out of this 4 instances and run it as a separate services so that I can reduce load on server instances. All the server instances will communicate with this new service to get response.
 
Tim Moores
Bartender
Pie
Posts: 2495
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd probably use a RESTful web service for this. I can't really think of any reason why I'd use RMI these days, or bother with sockets. The prevalent REST libraries (like Jersey) make both the client and server side pretty easy to develop.
 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anoop Isaac wrote:we already have for web server instances running on the same machine behind a load balancer.


I can't imagine any reason to do such a thing. You use a load balancer to spread load between separate machines. It makes no sense to run 4 instances on one box and load balance between them. You lose all sharing of state, etc.

Further, I agree with Tim, there is no reason to use RMI in this case. Don't do it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic