Multiple DB connections or just one per server? (Advice needed)

This is just getting advice from other users. I have several applications on an “intranet” being used by about 50 users. As I have developed them I have created new databases and new database connections to each DB. I am up to 5 now, but I have noticed that there are lots of connections in and out, etc. So I tried checking the “Persistent” connection option and that seems to have helped, but the thought occurred to me that I really only need one connection to one of the DB’s on the server and then in the query itself I could select other databases when required.

Would I gain any performance by reducing my 5 DB connections (All on the same local MySQL server) down to just 1?

Thanks for any advice!

Hrm… you do not mention how these 5 databases are used. I would assume that only a single given connection is in play in a given application? Or perhaps you open extra connections dynamically within the applications for special processing besides the main query that is used for a grid or a form.

However, my guess would be that many connections would tax the MySQL server more, compared to just having a single connection and referring to the other databases directly in the query by prefixing the database name when referencing tables in other databases. An internal reference to another database on the same MySQL server must take less resources than having several external connections from php into the databases.

In any case, if you wish to access multiple databases in the same SC app ( as a basis for the grid or form) or general query, I do not see how you can do it by mixing two or more SC connections. As far as I know referencing the multiple databases has to be done within a the query itself.