What will be the criteria for individual web applications?

I am trying to set up a Rails project that has 2 logically separated components, admin panel and user portal. From what I've read so far, there are several ways to fix this:

  • Combine both in one web application with one database
  • Separate web applications for Admin and Main applications, but use a common database
  • Separate web applications with separate databases
  • Combine both, but deploy separate instances, one of which works as Admin, and the other as the main application.

The main application will have to handle heavy traffic, the administrator is moderately low.
What is the best approach for setting up a project among the four options?
And what could be the disadvantage of everyone?
Is there any other way to make this better?

+6
source share
1 answer

Some ideas on possible architectural solutions:

1. Combine both in one web application with one database

pros:

  • You have everything under one project configuration, and therefore avoid tweaking the project settings twice.

  • You can reuse the code without copying files or link files to another directory, which can sometimes be troublesome.

minuses:

  • Security, functionality that can lead to inverted things in your system, is found under the same roof with user code, so there is a high probability that functions related to the administrator can be used by an attacker.

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

pros:

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

minuses:

  • Since the second reason for existence is to manipulate data and the main application, it will have to read and influence the data used in the main application; therefore, gives you less overhead.

This would be the best option in most scenarios.

3. Separate web applications with separate databases

I canโ€™t understand why you want to do this when the second application is meant to process the first and the contents of the database. If you intend to use a large amount of data in a second application that is not relevant to your main application, this would be a reasonable option.

4. Combine both, but deploy separate instances, one of which works as Admin, and the other as the main application

minuses:

  • You will develop a solution with increased complexity of processing two copies.

  • An attacker might find a way to log into your administrator instance and gain access to the administrator level feature.

+9
source

Source: https://habr.com/ru/post/903749/


All Articles