views:

260

answers:

1

Hi,

I'm looking at setting up communication between an iPhone app and a Java based server and thought that google protocol buffers might be the way to go; however I've managed to get myself a bit confused and I'm not sure the best way to go about implementing this so I was hoping for a bit of friendly advice :)

Should I set up the Java server as a webservice and send the proto messages to it (via a post or something similar), or should I set up a client/server with the Java server accepting a connection and then the iPhone passing the proto message via the connection? I'm presuming the best way of doing it is to create an actual socket connection and pass messages back and forth that way; but I could be wrong and setting it up as a webserver with messages/responses could be the best way.

Any advice on the matter would be really appreciated.

Thanks,

Dan

A: 

I think it largely depends on how you plan to scale your application. A web server designed to run your servlet has scalability "baked in." If you just use a simple socket listener in a Java application, then where do you bring in the scalability? There are ways to do it, but you probably would not need to worry about those issues as much if you just used Tomcat.

The downside is that if you want to deploy something like Tomcat, there is a bit of a learning curve involved.

Brian H
Yeah, I have had previous experience with Tomcat, and was considering using the Play framework; my only concern was that they might be a bit 'heavyweight' for the kin of operation. I guess Im trying to find the best answer speed wise, so will probably do both and see which provides the best results. :)
Dan