Is it possible to split the Drupal database into multiple databases. For example I have one database having the watchdog table and another database having all the other tables?

I know if I created my own tables I could store them in a separate database and use the following:

How to connect to multiple Databases in Drupal 7?

$query = db_query("SELECT * FROM your_table");
  • Can you describe what task you're hoping to achieve this way?
    – beth
    Commented Aug 20, 2014 at 16:04

2 Answers 2


For watchdog specifically, you could use hook_watchdog to route the message where you need it, and don't use the dblog module (dblog's hook_watchdog) if you don't want it logged to the default database.

For other (core or 3rd party) data, it depends on whether there is an appropriate hook to interrupt the intended functionality.


I think you'd be better served using Syslog for logging without cluttering your database.

  • Thanks. Updated the question. It could be any tables that we would move out. (This is not my idea BTW but I have been tasked to look into it)
    – Bobby
    Commented Aug 20, 2014 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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