I'm developing a module that will rely heavily on external database queries. Is there a best practice for defining and using an external database connection throughout a module?
This page tells me how to make the connection, but not where to put it in a module (specific hook?) so I only have to define it once. Also, is it always necessary to do "db_set_active('YourDatabaseKey');" or can I pass an argument that will set the db to use? I'm using Drupal 7.