mardi 31 mars 2020

Best Practice Symfony / Doctrine - Multi-client management

I'm developing a platform with Symfony where my clients can each manage a database of users. This database of users is used on another application where they can connect and interact with different features.

The easy way to do it is to have an entity client and an entity clientUser with a OneToMany relation. clientUsers will be all together in one entity, and I'm not sure it's the best practice. In the same time, I'm scared of optimisation : if I have 10 clients with each 5000 users each, I will have a big entity of 50 000 users.

Right now I'm thinking of creating a new clientUser entity for each client, so they can have separate entity. for exemple if my clientName is 'ABC', I can create an entity clientUserABC. Then I can use DQL to interact with those separate entities.

It sounds like it works, but also very sketchy. Am I seeing the things right or I'm missing something ?

Thanks for helping




Aucun commentaire:

Enregistrer un commentaire