Siddiqui
Siddiqui

Reputation: 182

sli database structure best approach?

We are working on SLI Search module for our client. I want to ask you is that a good approach to make separate tables or should I manage all clients data into single table?

Keep in mind that user can ask to update their module, means that table structure can be different of each client.

Secondly, client will give me their data and I will update all clients data in their tables or in single table using Package.

So, it will be good approach to make their separate tables in database or should i make a centralized table for all our clients?

Upvotes: 0

Views: 293

Answers (1)

Waqar Shah
Waqar Shah

Reputation: 26

If the table field varies from client (customer) to client, then it is recommended to have separate tables otherwise you will create a lot of null records.

Secondly, if every client is a separate instance and there is no correlation between them, then why now have a separate schema or database for them?

Sounds like SQLite database will be a good fit as every client data structure is unique, so you better make it portable so you can amend one SQLite database at a time.

Centralised Tables Approach There is a new study and research that we used recently but you need to consider indexing issue for fast search on the fields.

Anyway, you can create a flat table, which have have many columns with sequential numbers e.g. Field1, Field2, Field3, Field4.....Field99, Field100... Field150 (as many potential customer fields you have).

You create another table and in that you map labels for every client (customer) to these fields. E.g. Client ABC id is 10032 He has used from Field1 to Field11 Field1 has a label name FirstName Field2 label is Surname Field3 label is DOB ... ... Field11 label is UserCountry

Now every time records are shown, you fetch the logged user labels and then map them to fields.

I hope this answers the question.

Upvotes: 1

Related Questions