views:

481

answers:

4

Hi,

I need to create a distributed application consisting of multiple clients that send files (plus info about files) to one server, also query that server.

Clients must access to that Web Server from inside the company for sending the files. But, occasionally some specific queries must run outside the company.

I think, given what I know, that RMI is a faster(operating performance) way to connect the desktop client with the indexing engine plus the storage engine. And I believe that making a Web Service that provide an access layer to the search engine is also a good decision, because it will be running outside company's network.

What do you think about it? Is a good approach or do you have some alternatives must be considered.

Thank you in advance.

+2  A: 

RMI can be tunnelled over HTTP (see here), so don't let that influence your decision too much.

If both ends can talk RMI, then RMI is probably what you should use; it's a lot easier to get working than a web service.

skaffman
A: 

What makes you think that RMI is faster? From my experience, it can be slow, difficult to configure, difficult to secure and generally unpleasant to work with.

Since web services are generally just XML over HTTP, you can generally architect a solution that will scale better.

Kevin
From my experience is what I have seen, but I was not sure, thats why I asked for. See this paper, is one of some performance studies: http://mercury.it.swin.edu.au/ctg/AWSA04/Papers/gray.pdf, thanks :)
Sheldon
I don't have direct anecdotal evidence, but it makes sense that web services would be, in general, less performant than RMI (primarily due to the extra overhead of parsing into and out of XML, and the additional verbosity of XML over a binary serialization.)
Jared
+1  A: 

If the API you want to support with the service does not map nicely to HTTP, I would probably choose for RMI (but beware of unnecessary roundtrips.)

If it does map onto HTTP nicely, I would chose to go with REST which is essentially HTTP Servlets implementing your API as actions. If most of the traffic is the uploading / downloading of the files you mention combined with a few API calls, this is probably the way to go.

Btw, your experience that RMI is faster than web-services coincides with mine. (Both can be implemented with slow performance as a result, mainly to do with roundtrips in a poorly designed API.)

rsp
+1  A: 

Be careful here, I developed a similar solution recently and found that sockets were the most efficient and perfomant way to transfer files, while RMI was good for simple method calls (like queries). I also had a hard time setting up RMI, the configuration can be confusing sometimes and there is not much documentation out there on the subject.

I certainly believe RMI will give you better performance over web services; but web services will probably be more maintainable and flexible for future requirements.

LWoodyiii
Thank you, I will be careful, is seems like the configuring time is also a hard work. I have had a hard work by now... but it seems that with few test data, works well.
Sheldon
Also found this plug-in to be invaluable for configuring and debugging RMI:http://www.genady.net/rmi/index.html
LWoodyiii