FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » another proposal: use DB to store post messages
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
another proposal: use DB to store post messages [message #8241] Sat, 18 January 2003 17:34 Go to next message
laser is currently offline  laser   China
Messages: 9
Registered: January 2003
Karma: 0
Junior Member
After tracking the code for a few hours, I finally find out that the forum's messages all store in a file in forum/messages/ dir,
I think it would be some benefits to store these messages, and even those attachements, into DB:

1, it would be very easy to back, upgrade and move those data form one site to another: we just dump the data from DB, and then reload it into new DB using DB's tools would be enough.

2, it would be more easy to cope different encoding.

3, we coulde use more generalized full index engine from DB to do search for us, (like Openfts in sourceforge.net), thus avoid
our hard work.

4, the code would be more clear.

5, we won't worry about the file size again, no metter on what OS/file system, the file size are maintained by DB, not ourself.

and maybe some more.

The draw back:

may be the speed would slow down a bit.

I've make some changes to my test forum, now it could use DB to store messages well. It seems the changes are minors: I add a msg_body column to {prefix}msg table, type "text" (PostgreSQL's CLOB type), then make some revise in php code to use it. It's a ugly hack (comment out some write_body() call and some read_msg_body() call, replaced with the value from query result), just to see if it works, maybe need to rethought about the DB schema and the code arrange, but if necessary, I could post those files here.

any comment are appreciated.

Re: another proposal: use DB to store post messages [message #8245 is a reply to message #8241] Sat, 18 January 2003 19:05 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The logic behind storing messages in a file has been explained numerous times on this forum. If you are looking for a reason why it is done search the archive.

The forum already has dump/import functionality that will backup all the forum data and then allow you to import it to a forum on another server.

File size don't matter and code cleanleness will be the same.


FUDforum Core Developer
Re: another proposal: use DB to store post messages [message #20355 is a reply to message #8245] Sat, 09 October 2004 18:01 Go to previous messageGo to next message
applejack   Australia
Messages: 13
Registered: October 2004
Karma: 0
Junior Member
tsearch2/opentfs would certainly make a great contribution to fudforum.

I have seen instances where the nest limit (10000) in postgresql being reached due to the way the index in fudforum is being populated.

... John
Re: another proposal: use DB to store post messages [message #20356 is a reply to message #20355] Sat, 09 October 2004 18:53 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
messages will not be stored in DB, that is slow an ineffecient.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How do I get error messages?
Next Topic: A question about FUD API
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 18 19:44:04 GMT 2024

Total time taken to generate the page: 0.02202 seconds