• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

client server communication

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
My web server could have 500 clients.Each client sends its information to my server after every 2 mins.Server stores the information in the database.
The information sent by client after every 2 mins ,may or may not change.So in my opinion,it is not a very good design,to update the database after a message from the client comes.Instead server can update a xml file after receiving a message from the client.After that say after every one hour,the server will update the database by taking values from the xml.

Is it a good approach?can i do something else.Please express your views.

with regards,
ajse
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. You've gone from one transactional data store to two data stores, one of which is not transactional. Every query (from every application that might connect to your database, not just from your web app) now has to query an XML file and the database, since the database is always out of date.

This sounds a lot like an early optimization. Web server, servlet containers and RDBMS's all have well understood optimizations routes. Write your application to hit the DB as often as you need, then tune the infrastructure if performance is poor.
[ August 31, 2006: Message edited by: Paul Sturrock ]
 
Ranch Hand
Posts: 257
Hibernate Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Its not clear that whether clients will access the data entered by other clients.
It can be in one of the two ways,

1) If it is to store the data, and will not be modified by other clients then storing the data in xml file and updating the database is fine, but that depends on your db and way of accessing the xml file. The performance factor plays a major role. Just think about writing into file and writing or modifying the database, will not they take same time?

2) If other clients will modify and see the data entered by clients, then storing or updating the data in DB directly would be better. Because it will promise ACID properties. you can use Hibernate or EJB if you want to really improve the time. If there is no application server , then go for Spring + Hibernate.

3) If you are maintaing in the file, think about the state of the server before crash ( if at all any) and after crash ....

Any way to maintain the consistancy state, it would be better to update the database.

More inputs welcome,


 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your views.

So now I can conclude that,there is no harm in hitting the DB although there are 500+ clients sending data after every one or two minutes.Please confirm
the above statements are true or not.

As far as data goes,the clients have there independent set of data and they do not depend on others.

with regards,
ajse
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


So now I can conclude that,there is no harm in hitting the DB although there are 500+ clients sending data after every one or two minutes.Please confirm
the above statements are true or not.


No idea. All I could say is probably not. It is very difficult to say anything about performance without knowing what your application is doing and the environment it is deployed in. Even if we did know these things, performance questions are very difficult to quess up front. This is the sort of thing you own performance testing will discover. Prototype your application and test it to see.
[ August 31, 2006: Message edited by: Paul Sturrock ]
 
See where your hand is? Not there. It's next to this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic