File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes GuestBook Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "GuestBook Servlet" Watch "GuestBook Servlet" New topic

GuestBook Servlet

ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
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.

In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
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 Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at for other WebSphere information.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Rob J Ford

Joined: Oct 30, 2001
Posts: 3
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

Joined: Nov 26, 2000
Posts: 63
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

Joined: Aug 27, 2001
Posts: 216
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!
I agree. Here's the link:
subject: GuestBook Servlet
It's not a secret anymore!