Since the database is being used in modules where the database is optional, these should not establish a connection just because it is defined in the modules configs. Instead it should only be established once code actually retrieves an instance.
You could even go one step further and only initialize once a first request has been made, but this might impact server startup responsiveness. This could be mitigated with a "initializeAtStartup" option, but requires some additional thought.