If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Extensive text to be saved, what is best method?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-06, 13:00
themeaty themeaty is offline
Registered User
 
Join Date: Jan 2006
Posts: 2
Cool Extensive text to be saved, what is best method?

Hi, I'm new at db stuff and I'm not sure what the best method is.

I am setting up a news website feature for college alumni to submit news about themself. The fields will be last name, first name, year graduated, location, and news text.

The text copy could get quite extensive, should I save the text copy in the database or should it be saved in an external text file? The database would then reference the text file when that specific alumni news is requested.

What is the best way? Is there a better method?
Thanks!
Reply With Quote
  #2 (permalink)  
Old 01-17-06, 18:27
Morthane Morthane is offline
Registered User
 
Join Date: Jan 2006
Posts: 20
It's quite obvious to save the text in its own file - preserves formatting, pictures, and many other reasons. Also, anything to cut down on DB size is good I should think.

You should probably create another table:
Code:
table news
(
    filename varchar primary key,
    datecreated datetime,
    .
    ..
    ...
)
Reply With Quote
  #3 (permalink)  
Old 01-17-06, 19:01
themeaty themeaty is offline
Registered User
 
Join Date: Jan 2006
Posts: 2
Why am I creating a second table called news?
Reply With Quote
  #4 (permalink)  
Old 01-17-06, 19:22
Morthane Morthane is offline
Registered User
 
Join Date: Jan 2006
Posts: 20
I was considering the possible future growth of your database and giving you the opportunity to create additional data that you may want to have associated with a file.

Additionally, I'm looking at data normalization rules - look at the 3rd rule.
Reply With Quote
  #5 (permalink)  
Old 01-17-06, 19:40
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
it depends if you want the content indexed. If the content is purely a regurgitaiton of what someone has said then there is a strong argument to store it as flat files, away from the db.

It also depends on how you intend storing those flat files, at some point you are going to hit the limits within whatever OS you are using (whether its no of directories, files in a directory or whatever)

if you wanted the content to be searchable then there is a strong argument to store the information within the db. for examle if you wanted to offer the ability to search alumnii's postings for specific terms

it depends on how you plan to use the information, if you deploy it as a web aplication then that may also change what is reasonable. if you link to existing resources available elsewhere then you don't get charged for the bandwidth accessing tht information. Youmay be able to rely on external indexing engnes such as google to provide the search faciliites that would be provided by storing inside the db.

finally there is a backup and security issue. storing insode the db will be mor secure than outside, it will be part of any backups - but it will increase the time and cost of your backups. information stored outside the db can be as secure as inside, with carefull design, but you are prone to more data errors if users are allowed to modify or delete files held outside the db

HTH
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On