Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would be the criteria to have separate web applications?

I'm trying to setup a Rails project that has 2 logically separated components, the admin panel and the user portal. From what I've read so far there are a number of ways to set this up;

  1. Combine both in a single web app with a single database
  2. Separate web apps for Admin and Main apps, but use a common database
  3. Separate web apps with separate databases
  4. Combine both but deploy separate instances, one running as Admin and other as Main app

The Main app will need to handle heavy traffic, the admin moderately low.
What is the best approach to set up the project among the four options?
Also what could be the downsides of each?
Is there any other way this can be done better?

like image 996
Vignesh Avatar asked Dec 14 '11 10:12

Vignesh


1 Answers

Some ideas about the possible architectural solutions:

1. Combine both in a single web app with a single database

pros:

  • You have everything under a single project configuration, and by so you avoid to configure your project settings twice.

  • You can re-use code without needing to copy files or reference files in a different directory which sometimes can be troublesome.

cons:

  • Security, functionality that can bring things upside down in your system is found under the same roof with the user-related code, so it there is a bigger probability that admin-related functions can be exploited by a malicious user.

2. Separate web apps for Admin and Main apps, but use a common database

pros:

  • You separate code with different context in different applications, keeping things simpler and the user experience in both of them more concise.

cons:

  • Since the second application's reason of existence is to manipulate the data and the the main application, it will have to read and affect the data used in the main application; hence giving you less overhead.

This would be the best case in most scenarios.

3. Separate web apps with separate databases

Can't think why you want to do this when the second application is meant to handle the first one and the contents of the database. If you were going to use a big volume of data in the second application that were irrelevant to your main application, it would be a reasonable option.

4. Combine both but deploy separate instances, one running as Admin and other as Main app

cons:

  • You will develop solution one with the added complexity of handling two instances.

  • A malicious user might find a way to login in your admin instance and getting access to admin-level functions.

like image 60
Vosobe Kapsimanis Avatar answered Sep 20 '22 12:09

Vosobe Kapsimanis