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

Home » General » General Chit Chat » Messages in a file - why?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Messages in a file - why? [message #7162] Sat, 09 November 2002 00:59 Go to next message
KVentz is currently offline  KVentz   Russian Federation
Messages: 65
Registered: November 2002
Location: Moscow, Russia
Karma: 0
Member
I have found that FUD forum stores messages bodies separately from headers in a single text file and forum searches message by (start char, length) coordinates.

Why not to store messages bodies with headers in MySQL table? Was it made for productivity or something?
Re: Messages in a file - why? [message #7163 is a reply to message #7162] Sat, 09 November 2002 07:45 Go to previous messageGo to next message
hackie is currently offline  hackie   Canada
Messages: 177
Registered: January 2002
Karma: 0
Senior Member
Core Developer

KVentz wrote on Fri, 08 November 2002 19:59

I have found that FUD forum stores messages bodies separately from headers in a single text file and forum searches message by (start char, length) coordinates.

Why not to store messages bodies with headers in MySQL table? Was it made for productivity or something?


It's a lot faster to store them in a file.. a WHOLE LOT faster...


cc intelligence.c -o intelligence
$ ./intelligence
Segmentation fault
Re: Messages in a file - why? [message #7181 is a reply to message #7162] Sat, 09 November 2002 20:21 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
KVentz schrieb am Sam, 09 November 2002 01:59

I have found that FUD forum stores messages bodies separately from headers in a single text file and forum searches message by (start char, length) coordinates.

Why not to store messages bodies with headers in MySQL table? Was it made for productivity or something?

phpBB stores messages the way u described. The result is, that on high load the forum will become awfully slow, even if it would run with UNIX sockets. Saving messages into a file bypasses this restriction in favour of speed.
bye
Olliver
Re: Messages in a file - why? [message #10768 is a reply to message #7181] Mon, 09 June 2003 20:39 Go to previous messageGo to next message
korebantic is currently offline  korebantic   United States
Messages: 1
Registered: June 2003
Karma: 0
Junior Member
Olliver wrote on Sat, 09 November 2002 15:21

KVentz schrieb am Sam, 09 November 2002 01:59

I have found that FUD forum stores messages bodies separately from headers in a single text file and forum searches message by (start char, length) coordinates.

Why not to store messages bodies with headers in MySQL table? Was it made for productivity or something?

phpBB stores messages the way u described. The result is, that on high load the forum will become awfully slow, even if it would run with UNIX sockets. Saving messages into a file bypasses this restriction in favour of speed.
bye
Olliver


Insanity...Insanity

Even so, going with flat files has some serious drawbacks. What happens if the file gets corrupted? I can see that is far more likely to happen than with MySQL, especially if the server were to crash in the middle of a write. Modern day RDBMS protect you somewhat from that sort of thing. What data do you have to prove that this approach runs faster than MySQL using domain sockets.

Also, we have a custom message board system. Using this flat file format makes conversion for us far more difficult. It's quite unfortunate you made this decision. PhpBB all of a sudden looks a whole lot more appealing...
Re: Messages in a file - why? [message #10769 is a reply to message #10768] Mon, 09 June 2003 20:59 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Here you are wrong, MySQL in a default setup is fast because it does not sync data to disk right away and rather stores it in memory. A sudden system failure will result in a data loss.
The entire file is unlikely to be corrupted unless you start manually tinkering with it, at worse you could risk loosing a single message.

The data to proves it comes from numerous benchmarks conducted at the time of implementation of this solution. As far as conversion, I fail to see how this would cause any difficulties. As long as you use the fud_msg_edit->add() or fud_msg_edit->add_reply() methods the actual message creation & writing of the body will be handled by the forum internally.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Relavent php settings....
Next Topic: selecting text
Goto Forum:
  

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

Current Time: Sat Apr 20 16:21:59 GMT 2024

Total time taken to generate the page: 0.03194 seconds