0

I have a brief conceptional question:

Recently, I started to develop an app in which I can (on the fly) create clients who, in turn, can create projects that have lots of other stuff (own logins, etc).

The URL-structure is "example.com/client1/project1" for users to get to their project. So far so good, I managed it all with the DB-Model and routing etc.

Example structure:

-> Client -> Project -> User
                     -> Forum -> Topic -> Post
                     -> Message
                     -> Setting
                     -> [...] (you get the gist)

However, there will only be a handful of clients (< 15), so I was wondering if it were better to use a SEPARATE app-folder and DB for EACH client. Because this way, I will also be able to roll-out upgrades for each client separately.


Here my initial thoughts on the matter (going for separate installations):

Pro: Separate Apps

  • Ability to roll-out updates and new features separately for each client (it may well be that some new features are unwelcome by some clients)
  • An error in one DB will only affect one client

Contra: Separate Apps

  • More maintenance work in terms of monitoring all apps & applying updates globally (but given the number of clients this is not really a problem)
  • May become really confusing with different versions etc.
  • No ability to implement a superadmin that can access all apps (needs to be done on app-level)
  • Harder to create shared functionality and data (e.g. billing for clients)
  • Bad practice?

Should I ever wish to merge all installations, then this will not be a problem really, because everything is based on UUIDs. Furthermore, I will still implement the Client-Model, with all the rest being dependent on it: this way, it will simply be a matter of combining the databases and clients' files into one app-installation (given everyone wants the same functionality).

Note: The CakePHP core-library will be shared in any case: so this is not the issue here.

What would you think in this instance? The only problem I can see is with billing:

But it's not a problem to call a central DB from within each client to let it know "Hey, I just created something that needs to be billed".

If I do it in a single app - how do I exclude certain clients from some updates? Or should I simply force everyone to get used to any new features?

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54
JD-Robbs
  • 120
  • 6

1 Answers1

2

Because of the overheads you also mention, I'd only go for the 'Separate apps' if there was a requirement which made it absolutely necessary.

EDIT: you do not need to have different db schemas to finetune available features per clients

bpgergo
  • 15,669
  • 5
  • 44
  • 68
  • Hi bpgero, many thanks for kicking this off. Yes, you are right in that I can still manage it in the same app. However, then I would need to add a whole new feature-management to the app in order to manage who can use what and who sees what. But yes, from a general standpoint, I definitely agree with you on the stance that once central installation is simply "cleaner" - thanks! :-) – JD-Robbs Jan 09 '12 at 18:57
  • I tackle this using separate config files for each customer. Ex. //in boostrap-client1.php: Configure::write('Admin.images.ajax_upload', true); //in view file: if (Configure::read('Admin.images.ajax_upload')) $this->FancyUploadHelper->input('xyz'); else $this->Form->file('xyz'); ... Cake has many layers which can help you switch features on and off (loading different views, elements, behaviors, Plugins, etc.). I strongly suggest you check out migrations because good database management (and versioning) is of essence in such projects. – Vanja D. Jan 27 '13 at 09:28
  • Truth is, more often than not you have new features which satisfy all customers. I usually just pack the "extra super-custom" features inside a Plugin, which is loaded through the super-custom-client's separate bootstrap file. – Vanja D. Jan 27 '13 at 09:34