Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET distributed layered application

I have been developing n-tier applications using .NET for many years. But I still have no idea how to distribute the tiers/layers (dll) to other servers.

Let say, I have an MVC web application with 4 projects, i.e. MVC (UI), Business, Service and Data. Everything works fine if all class library dlls are in one server.

If I want to scale out the application by distributing the Service layer (dll) and Data layer (dll) to other 2 servers, should I convert the class library to WCF Service Library project (with TCP or pipe as communication protocol for better performance) ? Or should I use other technology like .NET remoting or Web API?

Will that be a lot of work?

Is that one of the purpose of creating multi-tier application?

Thanks.

Update:

Do you have any links (from Microsoft) that explain in detail how to scale out an n-tier architecture application to multiple server by distributing the DLL?

like image 635
EpoWilliam Avatar asked May 05 '14 08:05

EpoWilliam


People also ask

What is BL and DL in asp net?

the business related logic contains the logic of your looping structure ( for , while , etc.) that perform the All Project Logic in single class file. BL Layer gets the Dataset which was returned by DAL layer, then converts it into equivalent List ( li ) object of that particular file.

What are asp net layers?

Basically a 3-Tier architecture contains the following 3 layers: Application Layer or Presentation Layer (our web form and UI Part) Business Logic Layer (Bussinesslogic) Data Access Layer (DataAccess)

What is a 3 tier architecture project?

Three-tier architecture is a well-established software application architecture that organizes applications into three logical and physical computing tiers: the presentation tier, or user interface; the application tier, where data is processed; and the data tier, where the data associated with the application is ...


1 Answers

If I want to scale out the application by distributing the Service layer (dll) and Data layer (dll) to other 2 servers, should I convert the class library to WCF Service Library project (with TCP or pipe as communication protocol for better performance) ?

Yep, since they are on different machines, you need some kind of communication mechanism that goes beyond simply DLL invocation.

Or should I use other technology like .NET remoting or Web API?

Which approach you choose depends on many factors like complexity, performance...There are many options like

  • WCF webservices
  • Simple REST calls with WebApi
  • a message bus i.e. NServiceBus
  • ...

Obviously remote calls will also be slower having a potential impact on performance etc.

Will that be a lot of work?

It will be more work and in my opinion that "more work" should really be justified. Keep your architecture as simple as possible or better, only as complex as really needed.

An alternative approach could be to have some deployment pipeline that deploys your entire application on different server instances and have some intelligent load balancing strategy. The only thing you need to pay attention to in that case is to properly share the sessions between your instances (stateless would be better ;) ).

like image 100
Juri Avatar answered Oct 12 '22 23:10

Juri