Advice on multi-user system i'm making

flprocess

Supreme Member
Jr. VIP
Joined
Oct 11, 2019
Messages
1,396
Reaction score
1,432
Hey everybody!

Need your advice. I'm working on a multi user system (php). Every one who register to the system get access to the back end (kind of like a CRM). My question is - when someone register and starts his own "system" (or "company"), should I create a new directory for him, or let everyone use the same .php files with their on database?


From one side:
if i'm letting the software create a new directory, let's say domain.com/crm/company (or company.domain.com), when i want to make an edit to a file, I would have to upload it to every customer's folder (i know i can script this, but it will still be a hassle). same with adding new files.

From other side:
if I'll make one directory with the same files, if a customer will request and pay me for custom settings or custom options, i wouldn't be able to do it since it will affect everyone else.

From a third side:
I can make core directory, like domain.com/core, than create every user his own directory which will do include/require to the core files, and i would be able to add custom files to each one. question is how safe is it and how effective when adding a feature.

Would appreciate your opinions on this.

Thanks & Love
 
It looks to me what you are trying to do is implement multi-tanency. Search google for multi-tenancy and how to implement it.
 
It looks to me what you are trying to do is implement multi-tanency. Search google for multi-tenancy and how to implement it.

Didn't know this has a term, thank you so much :) My first thought about making a shared database is the issues within - It could be enormous database and it will be very difficult to separate between user's data, also considering the security risks it poses (like one breach can destroy everything for everyone). Also, wouldn't it be a problem to delete certain information when a user unregister?
 
Didn't know this has a term, thank you so much :) My first thought about making a shared database is the issues within - It could be enormous database and it will be very difficult to separate between user's data, also considering the security risks it poses (like one breach can destroy everything for everyone). Also, wouldn't it be a problem to delete certain information when a user unregister?
adding Deleted member 923340 and @Gogol
 
should I create a new directory for him, or let everyone use the same .php files with their on database
Same php files, different entries on database.

If you feel adventures,
Same php files and different database for each company with their own tables.
 
Last edited by a moderator:
Back
Top