Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 4th, 2003, 03:47 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to thecharking
text vs database

is it beter to have some info stored in text files or a database? would text be good mostly if you have no database capabilities? are there any articles on the subject? what are the pros and cons? Just thought it would be interesting to know. thanks.
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old November 4th, 2003, 04:25 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to dhouston
The first database work I ever did, I did using a combination of text files and a database. I did so without really knowing why. I think I was a little gun shy about storing lots of text in a database, unsure at the time whether or not databases were really meant for that. So my database stored meta information and a path to a file, and my code did queries and then file I/O to display and modify text. It was a pretty inefficient way to do things.

My view -- and I'm no super expert or anything, though I have a fair amount of experience now (years after that first attempt) -- is that if you can store it in a database, you should. You avoid having to handle locking files, for example, and you dodge having to write search routines and ensure that you're writing unique filenames, etc.

I suspect that in most cases, people who use flat files to store text are doing so through inexperience, as I was, or they don't have database capabilities, as you've proposed. I'd be interested in hearing if anybody out there can give a good justification for using text files when other options are available. I suppose that if you use text files, you can have your content/text editable through a regular filesystem and thus can dodge having to create an interface for maintaining content. Using flat text files and having content developers mount the drive they live on could be a poor man's content management system, in other words.

Reply With Quote
  #3  
Old November 6th, 2003, 04:41 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
Quote:
Originally posted by dhouston
My view [...] is that if you can store it in a database, you should.


What are your thoughts on BLOBs? I've heard that images are slower to pull from a database than from a file.

Any other pros/cons?

Storing data in files also leaves a smaller database file to backup.

Reply With Quote
  #4  
Old November 6th, 2003, 08:03 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to dhouston
Yes, for images, I would typically store a reference to a path or filename and let the filesystem handle the rest. The difference is that you're not frequently making small edits to images, as you might for content. But I would store text in the database. That's a good followup question to have asked.

Reply With Quote
  #5  
Old November 7th, 2003, 01:56 PM
Selleri Selleri is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Iceland
Posts: 46 Selleri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 sec
Reputation Power: 7
There is also the possibility to store pictures in the db and chace them on the server as they are needed.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > text vs database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek