Welcome Guest, Not a member yet? Register   Sign In
Best way??? - many user/db-tables -> using different db for every client?


additionally to my standard tables (Auth, client data, and other central stuff) I need 20 tables per client. So, if I might be lucky and have some thousand clients (I know, but let me dream...) it would get difficulty using table_prefix in just one database. Would'nt it?
Also might it be cool to separate the different clients data (so the 20 tables), because these would be more or less discrete company data.

So, I thought it would be good to use one central database and one database for every client. Codeigniter has a way to use different databases.

A) How do I make the second (main) database-connection dynamic? Writing a library that for? The data are in my central database tables.

B) How to I handle with performance. I have tried to work with 2 database connections and it is really slow on localhost.

C) What's usually the right way? If I would not do it this way and would use db-table-prefixes: How many database tables and table lines could I put in one MySQL database?

Every hint or comment appreciated!
Thanks!!! Jan

1) OK, so that you said "I need 20 tables per client." - do these 20 tables differ from client to client or same just you want to seperate clients' data?

2) Are you trying to connect to all databases at once or connection are established depending on what data is requested?

Thank you for the questions!

1) Yes, the same tables for all clients
2) I have a user management, so a user could work for different clients. He would have also different user rights from client to client if he is not the client administrator. So I thought I would need both connections.

Theme © iAndrew 2016 - Forum software by © MyBB