Our company has a product which relies on local database to work (it allows more client to connect to same database and share data between them).
DBMS: Microsoft SQL Server 2008
Now, we need to create a single database, accessible through internet (i am not interested in the how, for now), which will allow more users to use it as if it is their own.
Simple examples to follow.
By supposing that our program will manage (insert/modify/delete) books and their sellers:
Table Seller:
IdSeller PRIMARY
Name
Table Books:
IdBook PRIMARY
IdSeller NOT NULL
Description
Now, we need to distribute it, and categorize data by "Company"
Table Company:
IdCompany PRIMARY
LicenseNumber
Our idea was to modify primary (??) tables like this:
Table Seller (NEW VERSION):
IdSeller PRIMARY
IdCompany NOT NULL
Name
In this way we are sure Books will belong to specific sellers who will belong to specific companies.
Conceptually this is working, but we will have then to change all the queries made in our DataAccessLayer!
We thought of a couple of solutions:
- company-filtered-views for each primary table
- rewrite all the queries
How would you handle this problem?