• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"Streaming" server

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
This just popped up the other day...
Should the server rather "stream" the results to the client or should it send all data at once?
I could either first fill a collection with the results and then send the collection over the network at once or I could read 20 records from the database send this chunk, then read the next 20, etc. The first simple solution can place a heavy load on the server if 50 clients query a database of let's say 3000 records. Because 50 collections holding 3000 objects will have to fit into the server's memory...
I know the JRE can be tweaked with command line arguments concerning stack and heap sizes but I'd rather try to avoid OutOfMemoryErrors in the first place.
Regards,
Marcel
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is when you know you have been thinking too much into the assignment
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marcel,
I'd have to agree with Min. Keep things simple and to the point. If the assignment specs don't mention something, don't think about it! If you do, you're going to spend 6 months on the project instead of the usual 100 hours (not a good thing).
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,
Phhuuu, you're both right. I know I've been thinking about it too much, but I wasn't *really* going for the streaming solution ;-)
Regards,
Marcel
reply
    Bookmark Topic Watch Topic
  • New Topic