1

A bunch of work is done for static pages that will not contain dynamic data, such as, contact, about us, home, etc. that can be updated fairly easily if the designer/developer has access to a site. Why is it a better practice to keep that information in a database that must construct the data on the regular?

1
  • I am a developer that deals in the guts of Drupal and WordPress. Frankly, they don't scare me. I know how they tick. I wonder why there hasn't been a hybrid system built to fit those that could use it. Keep it dynamic for those that need it, but not bootstrap every page. I know that Drupal and WordPress users say the clients can update the content themselves, but the reality is that they don't typically do that. Perhaps the answer is to create the CMS? Mar 6, 2014 at 17:10

3 Answers 3

2

If one thinks in terms of templates and a website administrator who is a lay person, then the database format in Content Management System makes more sense, because all the person has to do, for example, in order to change contact details on the Contact page, or change some updates on the Homepage, is to go into the CMS. It will be set-up in a Form type of look, that only needs filling in and submitting. The initial cost for a small static website with a CMS setup will be higher of course. However, if your homepage needs regular updates, it might be worth having a CMS. If there are very little changes throughout the year, one may opt to hire designer/developer services.

Rather than best practices, I would see it as cost and demand.

5
  • Drupal and WordPress are template based. Even if you are not a pro, it will lead you to set up a website or CMS. The code will be behind. Your website might not be dynamic, but their system is.
    – Mugé
    Mar 5, 2014 at 20:38
  • This brings me to a follow up question. With Drupal bootstrapping the entire system to determine what it has nearly every page load (unless cached), why has there not been a consideration for a hybrid system that runs static and dynamic, or providing a manner that returns precompiled pages that have been optimized so that it is not dynamically building the page at the time of request? Mar 5, 2014 at 23:15
  • I have not used Drupal, however, having used WordPress, I realized it requires a learning curve. For myself, I found it too limiting. It has its purpose to serve as a tool for building websites. I see Drupal concentrates on building customized CMS. I will assume that this question is best directed to Drupal. When I see the word 'Customized' I am assuming it will have its limitations still. Customized may mean for Drupal, they are doing their best to make it user friendly. However, working with codes is more powerful. For that, you would need the knowledge of a developer.
    – Mugé
    Mar 5, 2014 at 23:24
  • @OddenCreative. Sorry, I am just seeing your comment on "I guess the answer is to create CMS?" I will say 'Yes' to that. There is a built-in CMS in WP and Drupal, it needs additonal functionality to its CMS system. As an open source, I hope, someone takes on that task.
    – Mugé
    Mar 7, 2014 at 12:59
  • @OddenCreative: There has been consideration for CMS that do generate static files. Jekyll is very well known and does exactly that. But usually, they rarely label themselves as CMS it introduce a bias (most people expect CMS to be fully dyynamic, instead of generating static files) In the Drupal world too the static generated approahc has been considered. The Boost module (drupal.org/project/boost) is not new and does exactly that. More recent, the Zariz project (drupal.org/project/zariz) is also attempt at generating static sites from Drupal. Mar 25, 2014 at 16:50
1

Because putting the content in the database and dynamic generation a the pages for each requests solve a lot of other issues. Cache invalidation is a hard problem. A static site where every page is build with different pieces of content from multiple sources (in Drupal: blocks, users, nodes, taxonomy terms, etc.) is like a gigantic cache.

But if you don't need the flexibility and the features of the CMS (like letting nearly non-technical users edit pieces of content), then don't go with CMS.

0

"A bunch of work is done for static pages that will not contain dynamic data, such as, contact, about us, home, etc. that can be updated fairly easily if the designer/developer has access to a site. Why is it a better practice to keep that information in a database that must construct the data on the regular?"

There are probably 3-4 key points to consider here.

First, why do people use WordPress? In many cases it's because they aren't web developers themselves and they don't want to have to hire one every time their board of directors (say) changes. I have several clients in this category. By putting the content in the database and rendering it in a template, non-technical users can manage their own pages as well.

Second, consider how easy it is for someone like you to create several static pages and simply use WordPress to power the blog. There are no shortage of startups and small businesses (especially in the tech space) that do that. Use something like Wappaylzer to see what folks are using.

Third, it's not a best practice to keep static information in the database. That's why page caches exist (along with static asset and opcode caches... no one recommends recomputing things unnecessarily as a performance best practice)

Fourth, consider the implication of removing the ability to edit pages from users. Or requiring them to know HTML. And if we start dealing with revision management as well, they might also need to learn Git. I for one hate having to help clients solve problems that they really should be able to solve themselves. I'm much happier if they can manage the simple things on their own. They tend to be happier with their websites, and I tend to get more interesting projects... good all the way around.

In sum, it's not a best practice for some people. Which is why some people don't do it that way. It's not a best practice to return to the database for static assets either, which is why folks who are reasonably aware of caching don't do it that way. But it is a good practice, at least, to let folks have greater control over their websites. It comes at a cost, and it's not right for everyone. But it certainly is right for a lot of people.... and maybe a lot more than simply "right." I think you could go so far as to say it's empowering, and one of the best things about WordPress in general

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.