Altough its super easy to perform a search concerning the subject, it is not as easy arrive at a conclusion. What exactly are some cons of storing html inside a database to be used?
HTML is static, and querying the information from the database uses database assets database assets are usually one of the more restricted on moderate to heavy use systems, therefore it seems sensible not to store HTML within the database, but to put it around the filesystem, where it may be retrieved without needing critical assets.
That is dependent on using the HTML within the database. Whether it's data that you simply only ever access like a blob (meaning you won't everOrhardly ever query the items in the HTML), i quickly think it's really a wise decision in some instances. Then now you ask , basically just like "Must I store files in abc format during my database?" And also the response to questions like this is dependent on a number of things:
- What size would be the files? Would storing them around the filesystem, with only their filename/path within the DB become more efficient?
- Must you replicate the information with other servers? If that's the case, then storing raw files within the DB might be simpler than you are on the FS, if you have DB-sync infrastructure in position.
- What exactly are your query uses like? Could they be user friendly to some DB or perhaps a file system storage?
Now, if you are speaking about storing HTML data that you simply frequently need to query, that changes the overall game entirely.
Any database normalization nazi would let you know never to get it done. But there can be times when it's helpful. For example, if you are with a couple kind of full-text searching engine, you might want that inside a database--or perhaps in whatever make up the full-text internet search engine uses.
Within the largest sense, HTML is really a document markup language and serves to structure data right into a document. The database however should contain raw data organized along its logical relations. Documents use formatting and could present data redundantly, however the true, underlying information is always fixed. Thus you need to store the best, raw type of data that it is possible to, and retrieve it in significant ways using both query language itself to produce appropriate sights for the reasons, along with other, output-specific information systems to create documents.
Obviously you might prefer to cache caused by an output formatting operation, and you'll decide to keep cache inside a database, too. That's fine obviously. But in regards to the raw payload data, I'd always choose the above mentioned.