tag:blogger.com,1999:blog-31421954.post6392128107776814352..comments2023-10-30T08:23:12.960-07:00Comments on mySQL DBA, Architecture, Dev, Scale, HA, Code : Avoid storing Markup (HTML) in the databaseDathan Pattishallhttp://www.blogger.com/profile/00356367514107959723noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-31421954.post-16520103452123909382008-05-29T02:48:00.000-07:002008-05-29T02:48:00.000-07:00I'm storing XHTML 1.1 in MySQL database. We publis...I'm storing XHTML 1.1 in MySQL database. We publish a daily bulletin and each article is stored in MySQL. <BR/>Advantage:<BR/>Security. MySQL give us a extra level of security, cause doesn't not exist XHTML files to alter.<BR/>Availability: Retrieving or searching is faster on MySQL stored text.<BR/>Disadvantages:<BR/>Processing:<BR/>Some of this articles are really big, and we have some problems on retrieving these with phpMyAdmin.<BR/>But we are now using PHP gzcompress/gzuncompress to avoid this inconvenient.<BR/><BR/>See youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-31421954.post-81094146251080551892008-04-24T04:57:00.000-07:002008-04-24T04:57:00.000-07:00It's perfectly OK to store markup in the database....It's perfectly OK to store markup in the database. The problem isn't in the storing, it's when it's retrieved. :)<BR/><BR/>It may seem silly to say that, but it's true. A very simple script can be called to generate a static page from the db contents; this script can be run hourly, daily, monthly, and/or manually as part of a release process.<BR/><BR/>There's plenty of reasons to store HTML in the database, but there are very very very few instances in which one needs to retrieve HTML from the database over and over and over and over.Sheeri K. Cabralhttps://www.blogger.com/profile/13990877688502800403noreply@blogger.comtag:blogger.com,1999:blog-31421954.post-3761765022762990652008-04-23T19:41:00.000-07:002008-04-23T19:41:00.000-07:00I agree, but I think there are very good times to ...I agree, but I think there are very good times to store HTML data in the database. Most administration sections of a web site are storing HTML values such as p tags, br tags etc. I think as long as you don't start storing div's and span's you will be ok. Good topic~!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-31421954.post-65831437210453958122008-04-23T19:30:00.000-07:002008-04-23T19:30:00.000-07:00There are notable cases when storing HTML in the d...There are notable cases when storing HTML in the database is acceptable and desirable:<BR/><BR/>1. When the data itself is HTML! (i.e. user input for a wiki-page or the like)<BR/><BR/>2. When the HTML is meant to be used as a cache. Squid proxies or memcached, in many cases, will be more appropriate, but if you have a markup language that is intensive to convert to HTML, storing it in a database column helps performance a bit.<BR/><BR/>Also, it is often a good idea to store text in its own database, and then use a foreign key to link it to the relevant row. This way you can avoid TEXT columns in heavily accessed tables.Ambush Commanderhttps://www.blogger.com/profile/08963503454239819127noreply@blogger.com