Ad

Database Design (MySql)::should We Put Html Data In Text Field Inside Database Table Or More Efficient To Save Inside Text.txt File?

- 1 answer

We building big Web Application and we use mysql, we want to make mysql database more fast. Some of us think if we will put message html body inside table and not inside text.txt in will make database heavy and not fast. Thanks,

*Part of main table that hold message: option 1:hold html message body inside database

message {
id (int)
subject (varchar)
body (text)
}

option 2: hold html message body inside body1.txt file

message {
id (int)
subject (varchar)
file_body_path (varchar)
}

*

Ad

Answer

If you:

  1. Don't need transactional control over the contents of your files and
  2. Only treat the files as an atomic entity (i. e. don't parse them, search for their content etc.)

, then you better store them out of the database.

The HTTP server will serve the disk-based files much faster to begin with.

Ad
source: stackoverflow.com
Ad