1
I am working on a system where more than one company will have its space and I want to do something where companies register their products and visitors (users) can first of all see all companies and click on one of them see their products.
I thought of using a bank for each company, or just a tabala organizing the companies and with their code inserting the products to identify each company in their respective products.
What is the best way ? Someone who has been through this could give me a strength ?
Thanks in advance for your attention
Thanks man, I needed this !
– Pedro Soares
face can I ask a question ? So, because everything is treated as a single bank, there is danger of data exchange ? I think when I have several users registering from different companies. There is the possibility of a data exchange ?
– Pedro Soares
Data exchange, you mean, given that an X company is registered in a Y company? If so, it depends solely on your bank modeling and how you will program, in which case it would be something like a BUG or failure, you have to program your system so that it can never happen. Do you have enough knowledge in a database? SQL, how to create a query, make a specific select, an Insert, etc? If you don’t strongly recommend studying this, before trying to model your system.
– Antonio Jr
Yes I have this knowledge, thank you very much man ! Thanks a lot
– Pedro Soares
In this case it would be interesting to work with more than one database, but the ideal is that it is a cluster with 2 Databases, a reading database and a writing database, where the writing DB data is replicated in the reading database, so you will have a better performance in both operations (Writing and Reading).
– Dimi Antoni Vargas
Regarding your question regarding the possible record of data exchanged by mistake, you need to model your database with at least two tables that relate to a cardinality 1 -> N for example, company table and product table, where in the company table a company would have a single record, and in the products table you use a foreign key referencing this company in each product belonging to it. If you are in doubt search google by cardinality modeling 1 to N. You should find more didactic examples of this data model scenario.
– Dimi Antoni Vargas