[ot] why SQL forum?

  • Thread starter Zhang Weiwu\(familyname first\)
  • Start date
Z

Zhang Weiwu\(familyname first\)

Hello. This is an another newbie question. And it is a bit off-topic. I
post it here and I don't know where is the proper place to post it;)

I just wonder why now all the forum code writers love to put the article
text and other information in to SQL or other types of database, instead of
storing them directly into files, and let the OS's file system to optimize
reading and writing, while storing articles seems have many benefit then
using a database.

A forum messages is suitable for a file, especially when it contain HTML
data, it is suitable for a HTML file.

a. with "forward" and "backward" meta data which is already defined as HTML
standard ("forward" and "backward" article references also show clearer
relationship to the search engines), the article thread information is
clear, and can be somewhat forum-system independent.

b. it makes export and import very much easier. Say a company wish to
publish a disco of all the tech discussion happened last year, the
administrator simple put all things in the forum folder to the disco and it
is okay.

c. It makes dynamic pages relatively static. A file based forum don't
re-generate the article HTML page each time when someone asks for it, and
dynamic pages like jsp are needed only when composing and editing message
posts, saving lots of CPU time.

d. Another benefit of static pages are that it makes search engine easier to
index. Many search engine don't store dynamic pages much, but they are well
designed to index static pages.

e. Many web servers are highly optimized for static page. Normally static
pages are much faster.

f. It could be easier to back up things. Using SQL your need to back up all
stuff with capable knowledge.

So why databased forums are so popular today?
 
G

Gerbrand van Dieijen

Hello. This is an another newbie question. And it is a bit off-topic. I
post it here and I don't know where is the proper place to post it;)

I just wonder why now all the forum code writers love to put the article
text and other information in to SQL or other types of database, instead of
storing them directly into files, and let the OS's file system to optimize
reading and writing, while storing articles seems have many benefit then
using a database.

Helllo,
with all respect (because I might had the same idea when I was less
experienced in it), but all points you state not true because theire based
on false assumptions or inlogical.

First, a filesystem is a database too. So from the perfomance point of
view that makes no difference. A fast database will be just as fast or
faster then a filesystem depending on where you use it for. Many advanced
database bypass the filesystem (the operating system) and write directly
to disk, but for most applications computers/os/harddisks are more than
fast enough that it is not nesseary.

Second, a database is much more flexible then a filesystem. SQL is an open
standard, just as JDBC, ODBC, so you can easily switch database or backup
or transfer date without much trouble.. Yes, many php applications are
tight too the sligly inferiour MySQL, but Java databases (and asp for that
matter) are more or less database-independent.
With a database you can easily query your data, for example 'get all
postings from user a', or 'get postings with subject Whatever and the word
Certainly and True', or 'delete this and this posting' with a filesystem
this is much harder and you would
have to program lots of things that otherwise would be done by the
databasedriver.

Third, dynamic pages can be cached too when a 'time to live' is set, the
page will be cached by a proxyserver or browser and won't be reloaded each
time. It's even possible too set a proxyserver on the server-side that
will transparantly cache requests. However, this is only needed on very
high load websites.

Hoping this is clear,
Greetings,
 
M

Marco Schmidt

Zhang Weiwu(familyname first):
Hello. This is an another newbie question. And it is a bit off-topic. I
post it here and I don't know where is the proper place to post it;)

Probably comp.databases or comp.lang.java.databases.
I just wonder why now all the forum code writers love to put the article
text and other information in to SQL or other types of database, instead of
storing them directly into files, and let the OS's file system to optimize
reading and writing, while storing articles seems have many benefit then
using a database.

Why do you think that databases are less optimized for retrieving
information than file systems? Some database systems don't use file
systems at all but do raw I/O on partitions themselves.
A forum messages is suitable for a file, especially when it contain HTML
data, it is suitable for a HTML file.

Sure a message can be put in a file, but it can just as well be put
into a table column. Whether the content is plain text or HTML doesn't
make any difference (that I can see).
a. with "forward" and "backward" meta data which is already defined as HTML
standard ("forward" and "backward" article references also show clearer
relationship to the search engines), the article thread information is
clear, and can be somewhat forum-system independent.

b. it makes export and import very much easier. Say a company wish to
publish a disco of all the tech discussion happened last year, the
administrator simple put all things in the forum folder to the disco and it
is okay.

Why is that discussion available as HTML already? You can just as well
take the source data and put it in a database.
c. It makes dynamic pages relatively static. A file based forum don't
re-generate the article HTML page each time when someone asks for it, and
dynamic pages like jsp are needed only when composing and editing message
posts, saving lots of CPU time.

Generated pages can be cached.
d. Another benefit of static pages are that it makes search engine easier to
index. Many search engine don't store dynamic pages much, but they are well
designed to index static pages.

Most databases come with built-in full text search. You specify which
columns to do full-text indexing on, and then all you have to do is
query the database. Adapting some search engine library / program is
harder.
e. Many web servers are highly optimized for static page. Normally static
pages are much faster.

The result of database queries can be cached as well.
f. It could be easier to back up things. Using SQL your need to back up all
stuff with capable knowledge.

A backup is relatively simple, databases usually come with some tool
that makes that quite easy.

Above I often stated that databases can be used "just as well". That
by itself isn't an advantage, obviously. Here are some reasons:

- Queries can be easily done with SQL. With files, you had to do a lot
of programming to accomplish the same thing. Basically you'd be
programming all that functionality that is already built into
databases.

- Many people know SQL and administrating databases. With a
file-system-based solution, nobody except you and your team had an
overview. Maintenance for others would be complex, and expensive for
those who own the place.

- SQL (or more general, RDBMSs) are old, proven technology. A
self-made solution using the file system is not. People have put
decades of research & development into existing databases. It's
unlikely that you can come up with something better in the short term.

- On many web servers some sort of database is installed for you to
use. Unless you control the server it is unlikely that you can run a
self-made program.

- Relational DBs are not natural for tree-like structures like
discussion forum message threads, but there is the nested set model
for that purpose (when insert is rare and select often):
<http://www.intelligententerprise.com/001020/celko.shtml>.

- There are ready-to-use solutions for web forums. Why start from
scratch (except maybe for the purpose of learning)?

Regards,
Marco
 
S

Sudsy

Marco Schmidt wrote:
- SQL (or more general, RDBMSs) are old, proven technology. A
self-made solution using the file system is not. People have put
decades of research & development into existing databases. It's
unlikely that you can come up with something better in the short term.
<snip>

Sorry, Marco, but you provided an irresistable target. What about
heirarchical database management systems like IMS which were on
the market and mature well before the advent of relational DBMSs?
Anyone for DL/1?
Young turks think that DOM is new? Hah! Check out some of the
calls like GetNextWithinParent, GetNextChild, etc. and tell me
that it hasn't all been done before.
Granted, it's more elegantly available in Java, a fact which
hasn't been lost on Big Blue which makes it possible to access
IMS databases from Java.
Just keep in mind that a lot of what some consider to be "new"
has been around, in one form or another, for close to half a
century.
Makes you go "hmmmm", eh?
 
L

Lee Fesperman

Sudsy said:
Marco Schmidt wrote:

<snip>

Sorry, Marco, but you provided an irresistable target. What about
heirarchical database management systems like IMS which were on
the market and mature well before the advent of relational DBMSs?

The keyword here is 'proven'. Hierarchical (and Network) data model are disproved
technologies, that is, they have been proven to be inflexible, fragile and overly
complex. They are not mainstream technologies.
Anyone for DL/1?
Young turks think that DOM is new? Hah! Check out some of the
calls like GetNextWithinParent, GetNextChild, etc. and tell me
that it hasn't all been done before.
Granted, it's more elegantly available in Java, a fact which
hasn't been lost on Big Blue which makes it possible to access
IMS databases from Java.
Just keep in mind that a lot of what some consider to be "new"
has been around, in one form or another, for close to half a
century.

I realize that XML seems to be bringing the Hierarchical data model back into favor. The
difficulty is that they have solved none of the well-known problems with that data model
and have added additional complexity on top.
Makes you go "hmmmm", eh?

Makes me go "hmmm" ... where did this guy learn database concepts?
 
S

Sudsy

Lee Fesperman wrote:
The keyword here is 'proven'. Hierarchical (and Network) data model are disproved
technologies, that is, they have been proven to be inflexible, fragile and overly
complex. They are not mainstream technologies.
I realize that XML seems to be bringing the Hierarchical data model back into favor. The
difficulty is that they have solved none of the well-known problems with that data model
and have added additional complexity on top.




Makes me go "hmmm" ... where did this guy learn database concepts?

That was precisely my point: navigating through a DOM tree is not that
different from navigation in IMS. IOW there's nothing really new under
the sun here.
As to your query ("where did this guy learn database concepts?"),
could you elucidate? Granted, I've only been using heirarchical
and relational DBMSs for a couple of decades...
 
L

Lee Fesperman

Sudsy said:
Lee Fesperman wrote:



That was precisely my point: navigating through a DOM tree is not that
different from navigation in IMS. IOW there's nothing really new under
the sun here.
As to your query ("where did this guy learn database concepts?"),
could you elucidate? Granted, I've only been using heirarchical
and relational DBMSs for a couple of decades...

If that is true, you certainly are confused. Marco recommended RDBMSs as old, proven and
well researched. You recommended hierarchical, a data model that is flawed, shown to be
not worth further research and largely discarded. Perhaps, you also want to recommend
ISAM, Inverted Files, Network Data Model, dBASE, Pick, ... from the backwaters of
technology.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top