how to deploy reference dll on a different server

Viewed 203

I have layered architecture with BAL, DAL and models and asp.net mvc projects in one solution. I want to deploy them in different tiers (different physical servers) i.e. one server for BAL, one for DAL and one for Web while models are shared between all of them. How do I achieve that? Please note that my BAL and DAL is of type class library, not web api.

Thanks.

3 Answers

This is only possible through the webservice and placing them on the web server on each server separately

The simple answer is that distributing the layers over machines is reducing the performance which is something you do not want I think (While what you target is scalability, which is about increasing/maintaining performance)

More Explanation:

You have a Layered Architecture and your goal is Scalability.

Layers (Logical separation) is all about code separation and reusability.

and the definition of Scalability

is a system that describes its capability to cope and perform well under an increased/expanding the workload or scope.

In a conclusion,

the performance is the main goal of scalability.

Now, to simplify it with a representational/dummy example, Let's say you have some scenarios:

Scenario 1: Api, BAL, DAL, and the MSSQL Server all on the same machine, your request processing to reach (to fetch data from) the SQL Server is

Api -> BAL -> DAL -> MSSQL

Scenario 2: Api, BAL, and DAL are on the same machine BUT the MSSQL Server is on another machine.

Your request processing to reach the SQL is

Api -> BAL -> DAL ----> MSSQL (note that the arrow of BAL and DAL stayed the same but to access the MSSQL server arrow became longer and this is because of the network (physical) communication time cost.

Scenario 3:(what you are considering it) Api and BAL are on the same machine, DAL is on another machine and the MSSQL Server is on another machine.

Your request processing to reach the SQL is

Api -> BAL ----> DAL ----> MSSQL (Note that for the same reason of Scenario 2 which physical machine separation, the arrows became even longer).

In a conclusion, distributing the layers among machines is increasing the cost of processing and decreasing the performance, while the goal of scalability to enhance the performance. So moving BAL and DAL to different machines is not serving your goal.

One of the proven alternatives to scaling is Microservices (Dividing your monolith service (BAL+DAL) into Microservices and each one of them could have or not have its own (BAL+DAL).

One of the main benefits of Microservices Architecture is Scalability.

It doesn't make sense to deploy class libraries as they would be only referenced by the application as DLLs.If you wanted to maintain the code separately,you could maintain different repositories for the mentioned class libraries.

Related