I've a set of tables that install with my module, but I worry about mixing them in with Drupal's tables. I shouldn't simply create a separate database for my own tables, should I?

Is there a 'good' approach to this?


I would create them in the main Drupal database, especially in case you need to JOIN them with other tables.

Personally, I preface custom tables with the module name.

That said, creative use of CCK / fields (depending on Drupal version) often cuts down on the need for custom fields, and integrates nicely with other features (eg, Views).


Creating tables to go along with a custom module is acceptable and perhaps event "best practice" in the Drupal world. Using a separate database would require an additional connection via PHP which I suspect would be a waste of server memory but an option if you insist on doing so. Often there's no one "right" answer in Drupal. There are of course "best practices" which I encourage you to follow but there's a lot of room for personal style.

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.