Wednesday, March 28, 2012

Putting CSS and web settings in the DataBase expensive?

I had an idea to put all my web design settings, css text and web content in the database..This way it would be easy for others to edit remotely. Do you guys think this would have an impact on performance if I do this?no .|||Its not an uncommon approach. Many web content management tools store their pages in databases.|||I wouldn't store your CSS in the database. You most definately will incur a performance hit if you do this. In order to pull this off, you would have to handle calls to http://yoursite.com/yourCss.css open a connection to the database and dynamically provide the valid CSS to each and every client that views your webpage. Storing page content dynamically suffers similar performance hits.

That said, dynamic CMS's such as DNN, Wordpress and Drupal take a similar strategy for the content of the pages. The construction of the pages themselves is handled through a set of business classes which have been optimized to construct pages from a given set of parameters as opposed to storing the entire page itself in a database.

If you are working on anything marginally complex, you will also have the issue of developers being able to view the entire project, or at least the relevant peices they are working on in real-time.

Moral: I wouldn't do this unless you have a REALLY good reason. Use Visual Source Safe or CVS or something else that is designed explicitly for this purpose.|||Well, you certainly sound like you know what you are talking about more than I sound like I know what I am talking about.

Good enough for me.|||Well, you certainly sound like you know what you are talking about more than I sound like I know what I am talking about.Welcome to my world :)|||storing css in a database is a fabulous idea, and not a new one

let's say you go to a site, and, amongst other things that you can customize, you are allowed to set various display properties like colours, font choice and size, display of various sidebars or not, and so on...

when you press the "save these settings" option, the backend will save these as your custom css parameters, but not just in the database, the backend will also (re)save them to a static .css file so that your browsing experience can take advantage of browser caching

i didn't really mean to bore you with details of web development in a database-driven environment, but the key point is, the database is used as a repository for all kinds of stuff

hence the name Content Management System|||when you press the "save these settings" option, the backend will save these as your custom css parameters, but not just in the database, the backend will also (re)save them to a static .css file so that your browsing experience can take advantage of browser caching

That's subtly different from serving up CSS from the database, which is the point I was attempting to make (albiet poorly).

CMS's also are not generally going to store the raw source for an entire page in the database.

We're arguing from the same side of the fence.

No comments:

Post a Comment