In an multi tennant application, there are vendor companies who sell product, and buying companies buying from the vendors. Lets call the app. owner and system opperator "the system". The vendors are the system's customers that pay the system to be represeented, the buyers are the vendors customers.
Original thinking was to keep the system's customers separate in a Vendors table, and the buying companies separate in a Customers table, (customers of the vendors). I thought this would make it easier overall with fewer filters and less likely to overlook something when constructing grids and so on, and when the system wants to work with its own customers -the vendors. Also maybe faster not having to always filter out either vendor or customer records. There would be a proportion of 2,000 customers per vendor, 25 vendors would be 50,000 customer records. This brings up the problem of creating an auto increment id for the vendors that would not duplicate the id for the vendor customers.
The other solution would be just one Company table holding the vendor and customer information with a "classification" field identifying either vendor or customer. The Id number problem is solved but a lot of carefull filtering will always have to be done. I know the id problem with two tables is not a problem, its just deciding on how one wants to id the records.
If you have faced this question before, what did you decide and why. Also if anyone has an opinion, please feel free to express it. Would you lump the system's customers(the vendors) into the same table with the vendors customers, or keep them separate?
Thanks,
John
Original thinking was to keep the system's customers separate in a Vendors table, and the buying companies separate in a Customers table, (customers of the vendors). I thought this would make it easier overall with fewer filters and less likely to overlook something when constructing grids and so on, and when the system wants to work with its own customers -the vendors. Also maybe faster not having to always filter out either vendor or customer records. There would be a proportion of 2,000 customers per vendor, 25 vendors would be 50,000 customer records. This brings up the problem of creating an auto increment id for the vendors that would not duplicate the id for the vendor customers.
The other solution would be just one Company table holding the vendor and customer information with a "classification" field identifying either vendor or customer. The Id number problem is solved but a lot of carefull filtering will always have to be done. I know the id problem with two tables is not a problem, its just deciding on how one wants to id the records.
If you have faced this question before, what did you decide and why. Also if anyone has an opinion, please feel free to express it. Would you lump the system's customers(the vendors) into the same table with the vendors customers, or keep them separate?
Thanks,
John
Comment