Multiple tables or one table with "identifier"
Posted by: John Smith
Date: September 17, 2022 07:35AM

I have been working with DB2 databases for 30+ years but I am relatively new to MySQL.

I am in the VERY early stages of designing a web app with a MySQL backend. My customers will only be able to access the data via the web app. They will have no direct SQL access.

90% of the data will be unique by customer (guessing it will be about 20-30 tables) with a few shared "master" tables (guessing maybe half a dozen). At this point, I don't know how many customers I will have using this app or how many rows will be in the tables (database has not yet been designed).

My question is (for now ignoring size constraints...I doubt it will ever reach that level) would it be more efficient to have all of the customer's data in one set of tables with a customer identifier field in each table to separate the data or should I create unique table names by customer such as Customer1_contacts, Customer2_contacts?

It seems like the data retrieval would be much more efficient with unique tables but I don't know if that creates worse performance for the engine itself if a bunch of customers are hitting it at the same time.

Looking forward to learning which method to use and why. :)

Options: ReplyQuote


Subject
Written By
Posted
Multiple tables or one table with "identifier"
September 17, 2022 07:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.