wesley tanaka

Nodes

Any object on your site that you're willing to have an individual page for, or want to be able to create/edit/delete individually, or that users of your site might post using a form, or that you'd possibly like to show up in search results should be done by creating a node type, and then using that node type to create those objects.  That's the Drupal Way.

Yes, there are a few exceptions.  I will get to them in a moment.

Why should your content also be nodes?

  1. Interoperability.  Most modules assume that they are going to be acting on nodes.  You can attach comments to your content just by enabling the comment module.  You can index your content for search by enabling the search module.  You can categorize or label your content with the taxonomy module.
  2. Sharing of create/update/delete functionality.  By defining a form for your node type, the UI and logic for creating, updating and deleting content is already done for you.

Why might you not want to use a node?

  1. All nodes have an entry in drupal's node table.  A drupal system hasn't been tested (that this author knows about) with millions of nodes.  There are possibly certain node functions that slow down dramatically if the node table becomes too large.  Large numbers of one type of content would then slow down access to other types of content.
  2. Your nodes, by default show up under the path: node/XXXX, where XXXX is a number.  The "Drupal Way" to chagne those paths is to create a path alias using the path module.  However, path aliases are rows in a single database table.  With one row per alias, there are performance implications if you have millions of nodes (and thus millions of aliases).

Exceptions

The aggregator module (which downloads RSS feeds and puts them into your database), the comment module, and the user module in drupal's core don't use nodes.  In the case of the comment module, this causes a lot of ugliness -- the first post of a forum topic and all subsequent posts to that topic are conceptually different and are treated differently.

Syndicate content