Large database text or just a path to a txt(Mysql) file

Asked

Viewed 987 times

0

My question is this: Is it better to put huge amounts of text into a database or create code that works with a separate txt? (open/save/modify)

I have already said code in Php and have been using it to avoid that the database gets excessively large with content that can be allocated elsewhere.

And he wondered if this is good practice.

  • 1

    Welcome to [en.so]. What criteria do you want to consider? What is your scenario? Do the contents of the files need to be indexed or are they search content? Your question needs to be more objective so that the answer is as well. Take a look at [help] and also [Ask] to help you [Edit] for the default site.

2 answers

1


It will depend a lot on what you need to do. A database can offer a number of services that can be useful, such as file content indexing, synchronized backup with other data from your application, access control / change and independence from the file path/name. If none of this is important to you, you can leave it out of the database which, in my opinion, facilitates development.

(Just one comment: Sharepoint, one of Microsoft’s great products, stores all documents in the database by default.)

0

If it is a good practice it will depend on the structure of its application, for example, if you need to search for content within these texts, which will be complicated for you to do, only with the file path.

You can evaluate a database like the MongoDB (or another database NoSQL) to store this information, since it deals very well with this type of data in absurd quantities.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.