Thursday, March 12, 2009

Drupal Architecture Diagram

Entity-Relationship (ER) diagram of the database

It's always good to have documentation, even if it is written after the fact, instead of before.

As for an Entity-Relationship (ER) diagram of the database, it is definitely worth having even after the database is made. It makes the database easier to understand for someone new to working on Drupal. And if there is every any change to the database, it will be just as invaluable as having created it before the first database.

If you've got an ER tool, it's even better because you can reverse engineer the current database into an ER diagram, and then generate the database after making changes in the tool to the diagram.

Is the database relatively normalized (e.g. 3rd or 4th normal form) for most of the tables? If so, I've got Sybase's Power Designer here and can reverse engineer the database with a little help on getting the non-obvious relationships connected.

Try downloading dbdesign from fabforce.net. It's GPL, windows app, and is a pretty good ER diagrammer designed for MySQL and can reverse engineer a database into a diagram very well. I tried it on the Drupal db and it worked fine.

===

I think a good ER diagram is worth a million words ... but I am not personally strong on wanting to document anything. I have found a great tool that helps with database documentation -- schemaspy

So here is my first contribution to the knowledge base of drupal... SchemaSpy Analysis of drupalcvs which is a 4.8/50 CVS install of drupal!!! -- click around -- it is a very cool tool. It would show table and field comments if there were any.

Seems the drupal developers have discussed this for a while. There are starts but since it is node 28,046 and drupal.org is over 80,000 now ... Seems the effort is restarting as of last week Documenting database schema via processing of .install files

Maybe a view like schemaspy makes would help..

No comments: