I have a site where multiple applications for one business live.
There are multiple models that they all share, but each one have a clear distinction between their functionalities.
For instance, one of the apps allows the user to make quotes of the products for the clients. Another app is a shopping cart. Another is for tracking products.
They do different things, for a different audience, but they both use the product, and user models, among others.
My question is, when working with a framework like codeigniter for php or RoR, what is the best architectural decision:
-
Build only one application with all the functionalities stuffed into
it. -
Build multiple applications and handle the common models and
libraries in one “master app” (my choice)
Thanks!
We are working with the same scenario as well. Our solution is in .NET but technology is not the issue to worry about, at least for the most part.
Our common application commponents are: Customer Account Management, Shopping Cart and Authentication models, shared across 3 distinct client web applications. There are a couple of ways that you may want to investigate to solve this problem. The goal is to share common components across all your websites.
The approach that we chose was to make all our applications share the same codebase. We extracted and the Customer Account Management, Shopping Cart and Authentication models from all three applications and create a common code base first. The key is to ensure that the common shared models have no clue about the applications that were using it services. In some cases we used injections specific to the applications but the main common components for the most part only cared about which application database to write othe miscelleanous settings common but different for each application.
The disadvantage is that is each application had it’s own binaries thus when running on the same web server, the code that was loaded into memory was three times as big as each application loaded same common models. But this is a price we knew upfront as memory now a days is quite cheap.
The advantage is that we have common separations of concerns and if at some point the applications become different enough, they can evolve to become differnt animals.
Another approach is to separate the common models into web services. But this approach is a bit frigile from a deployment perspective.
I hope this helps!