Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about network usage in a client / server application  RSS feed

 
Claude Moore
Ranch Hand
Posts: 892
8
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning guys,

we developed a Java client-server applications, in which remote application server and java client (traditional java swing clients) communicate via http connections, using a variant of Data Transfer Hashmap pattern:
classes (simple JavaBeans or POJOs classes) are serialized in a compressed stream and sent to the remote application server, which replies to the client using the same protocol, i.e http.

Now, we're evaluating how this solution impacts on network bandwith usage. We discovered that, while in mean each request/response requires a payload of about 20-40 Kbytes, in some cases (mainly, when requests or responses are involving trasmission of lists of objects, even of 3/4 hundred of items), the payload reaches 200 / 300 kbytes per request / response.

I wonder if this communication architecture were a bad choice, so that we'd better try another approach
before experiencing bandwith shortage, or if this payload should be considered "normal".

For example, a rich web application (with a non minimal user interface) how much network band consumes in mean ?

Do you have any suggestion or hint ?

Thank you in advance !

 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to do an analysis of your needs; we can't really do that for you. How much memory does each of those 200-300 objects require? Do you really need to send all of them to the client? Can you just send a list of strings or other data extracted from the larger objects? How are you encoding the objects -- is there a more efficient way? How much interaction do you need on the client side -- would a web app be good enough?
 
Claude Moore
Ranch Hand
Posts: 892
8
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:You'll have to do an analysis of your needs; we can't really do that for you. How much memory does each of those 200-300 objects require? Do you really need to send all of them to the client? Can you just send a list of strings or other data extracted from the larger objects? How are you encoding the objects -- is there a more efficient way? How much interaction do you need on the client side -- would a web app be good enough?


Thank you first of all for your answer. Well, actually I did not think about encoding my objects; i thought that their serialized form (a byte stream) would be rather minimal. So, upon your suggestion, I'll take a look to encoding strategies for data objects. I hope i'll find something useful.
Anyway, my topic was posted first of all for discussion sake: let's say that all those pieces of information are necessary to client-side (whatever the client is : a swing form, a web page and so on). Which approach would be the best ? Searching on the web, I found a lot of suggestion about Database + Java performance tips and tricks, but not very much stuff regarding network usages... So I wonder: how much bandwith a tipical web app consumes ? Since i'm using a client, a direct access via Jdbc would be more performant ?
I hoped that somebody here faced a similar problem, just for discussion...

Thank you !
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google of course has a huge network load problem - the Google answer is Protocol Buffers.

That approach packs data into a minimum space but requires a lot of work. The toolkit has extensive Java support.

Bill
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably a bit late of a response, but web servers can zip content if the client can accept data in this format and the client can unzip it. If you are transmitting data that compresses well this can significantly reduce bandwidth.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!