File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes What to store Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What to store" Watch "What to store" New topic
Author

What to store

ryan sukale
Ranch Hand

Joined: Aug 11, 2007
Posts: 53
Hi Ranchers.

When you have an application that has a large number of entries posted by a user, like a forum, where do you store all this stuff??
In database field typed as CLOB/BLOB?

I mean that when we have all these forum posts, where do they all go? Putting them into a database using CLOBS/BLOBS would result in lowering in response time for each request.

How does forum like javaranch or any other forum do it? Give me an idea, because i have never dealt with databases before.

Kindly help.

Thanks in advance.


SCJP 5.0, SCWCD 5.0, SCBCD 5.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41083
    
  43
The standard approach would be to use a VARCHAR, not a CLOB.

What do you mean by "lowering in response time" - compared to what?


Ping & DNS - my free Android networking tools app
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Ryan,
When designing a database, you want to make it possible to look up information. Think about finding a post in this forum. I don't just want to all the posts that you made. I also want to look up threads, do searches, etc. If I had all your posts in one CLOB, they would be extremely difficult to find.

A much more logical approach is to have a posts table so we can lookup each thing individually. This forum uses the database structure provided by jforum.net. (with a few things added on.) I recommend looking at their site if you are curious about the exact schema.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: What to store
 
Similar Threads
Database Selection Question
Storing a tree structure in a relational database..
creating XML from Beans
Storing the snapshot of the screen along with the form values
Jstl Expressions not rendering after database query