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