Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vote for the best protocol for the given scenario

I have a design decision to make. I need your advice.

Requirements:

  • A server and a client. client is typically a mobile phone.
  • Connected through the Internet.
  • Server and client want to talk to each other.
  • Exchange of text, multimedia between the client and the server.
  • Text would be some standard format. that is predecided.
  • Real time requirements
  • Session would typically last for 5-15 minutes. In some cases for under a minute. assume 5 minutes as the session duration.
  • The protocol should adhere to standards.
  • It must be efficient.

Option 1 A binary protocol that I design for my application.

Option 2 Implement my server as an HTTPServlet. Client sends post requests and the query in the post message and servlet sends response in the message. However, I think that for real time interaction, this is not a good option as a new thread would be created for each post request even for the same client and session. Please comment on the efficiency of this.

Option 3 Use a normal servlet. Would face the same problem as above.

Option 4 Use SOAP

Option 5 Use REST

Option 6 Use Google Wave (I haven't read the specification yet)

Option 7 Suggest some other protocol

Right now, I don't have experience with web services, but if it is the option then I don't mind investing time in it.

Basically, I want the speed and efficiency of option 1 with a standard way of doing things.

Thank you

like image 807
Rohit Banga Avatar asked Sep 25 '09 15:09

Rohit Banga


People also ask

What are the 3 different types of voting systems?

There are many variations in electoral systems, with the most common systems being first-past-the-post voting, block voting, the two-round (runoff) system, proportional representation and ranked voting.

What are the choices given to the voters during the elections?

They can choose who will make laws for them. They can choose who will form the government and take major decisions. They can choose the party whose policies will guide the government and law making. What Makes an Election Democratic?

What is a get out the vote strategy?

"Get out the vote" or "getting out the vote" (GOTV) describes efforts aimed at increasing the voter turnout in elections. In countries that do not have or enforce compulsory voting, voter turnout can be low, sometimes even below a third of the eligible voter pool.


2 Answers

Option 7 Why don't you go for XMPP?

  • It's a standard

  • it allows messages in both directions.

  • you may use existing XMPP infrastructure (clients might connect using their Google Talk accounts for instance) or easily build your own using open source XMPP servers

  • I also like the fact, that you basically only write client code (as the server is also an XMPP client) - assuming server and client are both written in same language, you may even use the exact same code.

  • file transfers are supported.

  • easily extensible to your needs

  • it's buzzing (Google Wave) ;)

The only thing people might argue about is its efficiency - or the efficency of XML in general. I don't think it's a problem though.

like image 34
sfussenegger Avatar answered Oct 05 '22 23:10

sfussenegger


Sounds like to me that you would be best served by the HTTP protocol. It has a low overhead, already well accepted. Uses TCP [which is a requirement for mobile communication], it has session negotiation [well connection wise not the actual state of the session]

Use a different protocol for sharing of video and audio, but set the connection up with the http one.

Using SOAP/web services would not be optimal, due to the processing required. From personal experince webservice clients on mobile machines is easier but the processing required is tremedious and can create a bottleneck in your application. [Mobile machines don't handle threads too well]

Also: Since you are sending data over wireless you also have to account for the additional issues dealing with unguided media.

Your requirements:

  • A server and a client. client is typically a mobile phone. : Yep
  • Connected through the Internet. : Yep, depends on how your device network is setup
  • Server and client want to talk to each other. : Yep
  • Exchange of text, multimedia between the client and the server. : HTTP works well with text and images, but you need to switch to something unreliable like UDP for video.
  • Text would be some standard format. that is predecided. : Yep
  • Real time requirements : This is impossible, but can be attempted.
  • Session would typically last for 5-15 minutes. In some cases for under a minute. assume 5 minutes as the session duration.: There are headers to keep the session open
  • The protocol should adhere to standards. : RFC Something
  • It must be efficient. : The only processing you have to do is line by line parsing of Key: data.

Also, I forgot to mention SOAP/Webservices is XML over HTTP.

like image 76
monksy Avatar answered Oct 06 '22 00:10

monksy