Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GuestBook Servlet

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all!
Which is better for implementing a guestbook?: a database storage approach or a flat-file system approach? I am aware that a db allows better searching and data view. However, I am not sure as to how much data a db can hold. Which one can hold more?: a txt file or a db?
Where can I find information about the amount of data that different dbs can hold. I am interested in MySQl and MS Access.
Looking foward to your help.
Thanks.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, let's see. A text file would be theoretically limited to the size of your hard drive. Databases often include low-level technology to cross multiple hard drives with RAID. I've seen databases in the hundreds of Terabytes (1 Terabyte = 1000 Gigabytes)...
More practically, a search through a text file would be linear. Searches through databases are optimized with indices to be logarithmic or better...
Also, a database can be run on a different machine from your servlet. This allows you to take advantage of the processing power of two machines. With a text file, well, your're kind of stuck there...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Rob J Ford
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thing, think about what you hope to achieve. If you want a guestbook with 2-3 fields, then this would be fine for a text file. If there's going to be more info fields or loads of information (a forum like this) then a database might be a better option. Though I believe this forum is on a flat-file not a database.
 
Eric Howell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob J Ford:
Though I believe this forum is on a flat-file not a database.

I am surprised by this. I'ed be really interested to find out why this storage option was selected as there's a lot of info in this forum. Anyone got any inside info ?
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot everybody for your insights. I will convert from flat file to database. It seems like a good idea.
Thank you very very much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic