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

Home » General » General Chit Chat » Messages in a file - why?
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Messages in a file - why? [message #7162] Fri, 08 November 2002 19:59 Go to next message
KVentz is currently offline  KVentz   Russian Federation
Messages: 65
Registered: November 2002
Location: Moscow, Russia
Karma: 0
Member
add to buddy list
ignore all messages by this user
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 02: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
add to buddy list
ignore all messages by this user

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 15:21 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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 16:39 Go to previous messageGo to next message
korebantic is currently offline  korebantic   United States
Messages: 1
Registered: June 2003
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 16:59 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
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
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Relavent php settings....
Next Topic: selecting text
Goto Forum:
  

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

Current Time: Wed Oct 18 07:20:31 EDT 2017

Total time taken to generate the page: 0.00671 seconds