Where to save big data on blog posts - in a file or database?

I am developing one blog site, and I was wondering how to save big data on a blog - in an XML file, as an HTML file or directly in a database. Any suggestion?

+3
source share
4 answers

The database will be much better. Therefore, save the XML file (or any other file), you need to overwrite everything. The database allows you to add / update a record at a time.

Not to mention the fact that the database is easier to search if you are looking for all blog posts with a specific word or phrase ...

+8
source

The blog post is small. Images may be.

Some questions:

  • ? MySQL (ick), , , TEXT ( < 64K) MEDIUMTEXT ( 64 16).
  • "XML"? XHTML - XML. HTML5 XML.
  • ? , .

, :

?

  • : , ? , . " " ( 4 ), .
  • . , , , ( ). , , .
  • : VACUUM ANALYZE .
  • : , . , . ?
  • ( ): . , ? , ?
  • : . ?
  • : ?
  • / : , ?
+3

.

I would not suggest HTML, because at some point you can make it in some other way, but XML and DB have their sides up and down. XML files, assuming that you mean one message for each file, are very portable, easy to edit, etc. DB storage is easier to search and retrieve, and is slightly less likely to accidentally be deleted.

+1
source

XML is not a good choice when it comes to saving / loading / serializing / deserializing big data. I would recommend using a database.

+1
source

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


All Articles