Big strings: text files or SQL DB?

I am coding a forum system using PHP.

I currently store the stream identifier, title, author, view, and other attributes in the SQL database, and then save the stream body (HTML and BBcode) in text files inside a folder with the name after the stream identifier.

In practice, it is very easy to capture the database values ​​and then just capture the body of the stream from a text file, but I was wondering if this is the "right way"? I personally have no problem with this, but if it turns out that it is inefficient, and instead I have to save both the HTML and BBcode stream in the database, and then change it.

However, it seems to me wrong to store such a (very possible) huge line of multiline text along with many different characters in the database - I was told that the databases are more designed for short field values, not the contents of the website.

I just wanted to get the final answer to this question, because he had been looking for me for ages, wherever I did it properly.

Does anyone know how popular forums store threads?

Added Thanks for the answers, so it is better to store the contents of the stream in the database, what type of field should I use? Also what about the answers? Another table that has a thread id and a comment id, and then a comment body? I am new to this database, so thanks for your help.

+3
5

Confluence ( ) .

:

  • () (-), ,
  • , Full Text Search (FTS), .
+4

, .

, - GridFS. NOSQL.

0

, DotNetNuke AspDotNetStorefront . , .

(, YAF), . DB HTML, / HTML.

, : LIKE, .

, cout, , ? , , , , , ...

.NET-. PHP: http://www.phorum.org/

0

, , phpbb3 (http://www.phpbb.com/). php. : D

0

, , , /, ..

, . , PHPBB , . memcached .

, , , .

0

Source: https://habr.com/ru/post/1750379/


All Articles