another proposal: use DB to store post messages [message #8241] |
Sat, 18 January 2003 17:34 |
laser
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 |
Ilia
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
|
|
|
|
|