Jump to content

[SOLVED] Most efficient forum DB


lemmin

Recommended Posts

What would be the most efficient way of storing the posts in a forum?

 

If I store them in the DB with a massive char string, it seems a little bit rediculous. Especially since the size range is huge. Would it make sense to save each post as its own file and read each post to the browser? What is the standard for doing this?

 

Thank you.

Link to comment
Share on other sites

Would it make sense to save each post as its own file and read each post to the browser?

No, it wouldn't.

 

What is the standard for doing this?

Using a database.

 

Declare the column that is holding the post bodies as TEXT, TINYTEXT, or some other large text field type.

Link to comment
Share on other sites

Do you really think anyone is going to type a response that is 2^32 characters in length on a forum?  Do you realize how big that is?

 

Let's assume that your keyboard has a key repeat rate of 50 chars per second.  That means if I just held down the 'a' key, it'd produce 50 of them per second.

 

Let's figure out how long that'd take to produce 2^32 of the letter 'a'.

2^32 chars / (50 char / s) = 85899345.92s

 

85899345.92s / 60 / 60 / 24 = 994 days

 

Let's not even worry about the logistics of the user's machine crashing from not having enough memory to hold that many chars in memory at once.  Or uploading 2^32 bytes worth of data to the server.

 

You can probably safely create the column of type TEXT, or 2^16 and never have a problem.

 

As for the database engine setting aside large chunks of space for small posts, I wouldn't worry about it.  The people who develop and maintain MySQL are more clever than you're giving them credit.

Link to comment
Share on other sites

True Question here would be are you planning on this forum getting larger or staying small.

 

Your talking about using "Flat Files" to run a forum?

 

choose your DB you would like to use as an option and do some research on it

 

For one Mysql has many ways to set up a DB / Tables

 

and and yes some DB's are dynamically others allocated

 

for example MS Access you do have to compress.

 

DB's do require maintenance. Plus if your worried about "Large text" limit the size of the post. but not 2^16 that would be over board.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.