How to design database and organize data if I have two or more domains and one database? All sites for e-commerce purpose and one good can be for sale on each site. So I have only two ideas:
- I need to create one more field (site_id) in almost every table and duplicate data.
- I need to create one table with site_id information for all other fields from other tables.
Both of ideas have a huge minuses. Any ideas? Thanks.
It is likely that there are a small handful of tables somewhere in your schema that link to all of your other tables. It is these tables that you need to put the site_id’s in, not every table in your database.
For (a highly contrived) example, if my schema includes a Customers table, an Invoices table, and an Invoice Line Items table, I don’t need site_id’s in all three tables. I only need a site_id in the Customer’s table.