473,394 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

when to store content in a database table?

Hi,

When developing a website in general when should I choose to put
content in a database. For menu options, settings, and listings like
products it seems to be clear for me to put them in. But the main
content (article for example) should I put that in a page or in the
database. More in general, when would it benefit to use a database and
when not. Does anyone know a good tutorial or do you have advice
concerning this.

Kind regards,

Roderik
Jul 17 '05 #1
1 1560
Roderik <ng@nl100.cjb.net> wrote:
Hi,

When developing a website in general when should I choose to put
content in a database. For menu options, settings, and listings like
products it seems to be clear for me to put them in. But the main
content (article for example) should I put that in a page or in the
database. More in general, when would it benefit to use a database and
when not. Does anyone know a good tutorial or do you have advice
concerning this.

Kind regards,

Roderik


That really depends on a lot of factors, such as networked filesystems,
access time, type of database, access points, etc..

In general, I avoid using a database when a file would do. This is
because the filesystem is generally faster than a database. Often
performance can increase if you use a DBM (like gdbm or berkeley)
instead of a database. But... this type of optimization can be more
problematic than it's worth in a lot of other cases. (It's good at
caching words to numeric ID's, things that map 1-1 and don't change, but
lousy if mappings change often.)

If the information changes a lot, or needs more keys than just the
filename and if you're using a database anyway.. then a database makes
sense. (even then, I'd recommend storing larger chunks as files due
to the hassles and typical overhead of storing blobs)

If you've got to work across multiple hosts, a database may make sense
because it's easier to synchronize. (especially for session data) but
not for everything.

For situations where articles change, or need multiple segments,
consider storing the article as an XML document and parsing it. (storing
a cached copy of the HTML on the filesystem)

Depending on how your XML article is formatted, you can index portions of
the article (such as topic, author, date, etc..) in a database for
searching, then storing only the filename in the database, using that
for retrieval. With rsync and a server farm, this can work out good.
(and also is nice to take some of the work off the database)

The other thing to keep in mind is the scale of the database. If you had
a dozen web servers serving content, but only 1 server running a
database which held all content, that 1 database server will be
overworked. Using files in this case would probably make more sense.

Because of all these factors (and many more...) an accurate guide would
be very difficult to write, and ultimately be more confusing than it'd
be worth.

Jamie


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Antonio | last post by:
Hi, I want to read an html page written in chinese and store it in a file having extension .aspx , I'm not sure where is the problem, I use the following lines of code: String sAddress =...
4
by: Paul | last post by:
Hi, When should I use a list (in table properties: like Ford;Mercedes;BMW;Audi ) and when should I use a lookup table?? And second question: IF I use a lookup table, should I always make a...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
4
by: =?Utf-8?B?U1VOTlk=?= | last post by:
Hi, i am uploading a .docx file into sql2005 and later when i retrieve the file from the database and i open it, i get a error message "The file is corrupted and cannot be open". I am not facing...
2
by: swethak | last post by:
hi, i wrote a code to upload a resume in mysql database and download that one . But in my database name,type,size of the file stored but content of the file not stored. So in my database...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
8
by: ahilar12 | last post by:
Hi experts, I have a form with many textboxes,listboxes in php.I have a edit button to edit the values in the form.once i click the edit button the existing values should be displayed so that...
70
mideastgirl
by: mideastgirl | last post by:
I have recently been working on a website for an honors association, and have a lot of difficulty but have found help from those on this site. I would like to see if I can get some more help on a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.