Jump to content

Archived

This topic is now archived and is closed to further replies.

aeris130

Content-in-MySQL, newbie question

Recommended Posts

I'm currently trying to learn about MySQL in order to get rid of about 350 php-files currently plaguing my host.

I've noticed that there's a lot of tutorials etc about storing contacts, passwords, etc, but I'm also interested in storing my entire content, including extensive articles.

So, first of all, how much space would be required for this? Also, are there any tutorials specifically regarding this, or can most tutorials about retrieving info from MySQL be applied?

In other words, is there anything special that I should keep in mind when storing extensive content, compared to names, phonenumbers etc?

Share this post


Link to post
Share on other sites
Assuming you're just talking about text files (and not binary data), my recommendation would be to keep them in a separate table. TEXT/LONGTEXT fields are not fixed-width, so they may slow down queries on existing fixed-width tables. Otherwise, there's nothing special about storing 65K of text in one field vs storing 250 characters.

Share this post


Link to post
Share on other sites
You shouldn't have any problems storing HTML in the database, although storing PHP code is slightly more involved (if you want it to be executed when it comes out).

One of the nice things about storing articles in MySQL is you can use COMPRESS() and UNCOMPRESS() to transparently save space. Some MySQL installations may not have support for it though.

Share this post


Link to post
Share on other sites
True enough... again, it simply means a performance hit every time you want to access said article. Is space isn't an issue (which it usually isn't) and the space savings is minimal, they there's no need to bother in the general case.

Share this post


Link to post
Share on other sites

×

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.