[ot] why SQL forum?

Discussion in 'Java' started by Zhang Weiwu\(familyname first\), Jul 23, 2003.

  1. 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?
     
    Zhang Weiwu\(familyname first\), Jul 23, 2003
    #1
    1. Advertising

  2. On Wed, 23 Jul 2003 22:58:45 +0800, Zhang Weiwu\(familyname first\) wrote:
    >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,

    --
    Gerbrand van Dieijen

    WWW: http://twisted.warande.net
    ICQ: 19345450
     
    Gerbrand van Dieijen, Jul 23, 2003
    #2
    1. Advertising

  3. 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.


    The generated HTML from a database can contain <link> elements with
    Prev, Next, Last, First etc. just as well.

    >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
    --
    Please reply in the newsgroup, not by email!
    Java programming tips: http://jiu.sourceforge.net/javatips.html
    Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
     
    Marco Schmidt, Jul 25, 2003
    #3
  4. Zhang Weiwu\(familyname first\)

    Sudsy Guest

    Marco Schmidt wrote:
    <snip>
    > - 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?
     
    Sudsy, Jul 26, 2003
    #4
  5. Sudsy wrote:
    >
    > Marco Schmidt wrote:
    > <snip>
    > > - 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?


    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?

    --
    Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
     
    Lee Fesperman, Jul 26, 2003
    #5
  6. Zhang Weiwu\(familyname first\)

    Sudsy Guest

    Lee Fesperman wrote:
    <snip>
    > 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.

    <snip>
    > 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?
    >


    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...
     
    Sudsy, Jul 26, 2003
    #6
  7. Sudsy wrote:
    >
    > Lee Fesperman wrote:
    > <snip>
    > > 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.

    > <snip>
    > > 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?
    > >

    >
    > 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.

    --
    Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
     
    Lee Fesperman, Jul 28, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    985
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,236
    Smokey Grindel
    Dec 2, 2006
  3. markm75
    Replies:
    8
    Views:
    573
    markm75
    Jun 17, 2007
  4. Alexey Verkhovsky

    [Ruby Forum] Forum digest by email

    Alexey Verkhovsky, Sep 22, 2004, in forum: Ruby
    Replies:
    0
    Views:
    442
    Alexey Verkhovsky
    Sep 22, 2004
  5. Kelvin
    Replies:
    2
    Views:
    150
    Eric Bohlman
    Oct 22, 2004
Loading...

Share This Page