I am considering a way of taking an existing php and mysql application that was developed for use in-house (and thus has a single database with nothing built in in terms of multi-tenancy).
I figured that it's possible and maybe in some way better to run each client of their own database. What I want to know is how best to handle the login of a user given the credentials supplied could be in any one of the databases and in some cases possibly multiple databases.
I had thought along the lines of iterating through each database and checking for valid credentials. If the credentials exist in multiples then return a list that the user chooses from, or if it exists only once then just logging in.
Is that a valid solution? Will it start to perform badly IF the application was to expand to have thousands of users across hundreds of databases?