472,958 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1549
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.