Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to NTier architecture for web apps

I was recently discussing with colleagues a push toward disciplined n-tier structure for our web application. It struck me that I couldn't think of any alternative.

Is it always the case that one should seperate out web applications into layers?

like image 817
Khanzor Avatar asked Sep 07 '11 05:09

Khanzor


People also ask

Which architecture is best for Web applications?

The microservices approach is widely used for web projects with a flexible tech stack. For instance, you can build a part of your web application architecture in Java, several microservices in Python, Go, or other technologies that better serve given business goals.

Is 3-tier architecture still relevant?

For decades three-tier architecture was the prevailing architecture for client-server applications. Today, most three-tier applications are targets for modernization, using cloud-native technologies such as containers and microservices, and for migration to the cloud.

What are the two architectures of a web app?

Structural Components – The two major structural components of a web app are client and server sides. Client Component - The client component is developed in CSS, HTML, and JS. As it exists within the user's web browser, there is no need for operating system or device-related adjustments.


2 Answers

An alternative to the traditional N-tiered architecture is the Command-Query Responsibility Segregation (CQRS) architecture as discussed by Udi Dahan.

Like all architectural decisions you should really think about when to use it as discussed here

Personally, I tend to see a lot of "over architecture" in my software travels which can really over complicate matters and make things much more difficult to maintain and obviously cost a lot more too. You really need to think a lot about the business problem first rather than just picking an architecture.

Keep things as simple as possible for best results and easy refactoring.

like image 159
brodie Avatar answered Sep 30 '22 09:09

brodie


Is it always the case that one should seperate out web applications into layers?

You should separate different logical parts of your system to avoid them being tightly coupled which turns makes them and more reusable. Into what you separate them is not really that important. You can call it layers or whatever.

Actually there could be 2 meanings of those layers:

  1. Physical boundaries: client browser, web server, web services server, backend database, ...
  2. Logical boundaries: GUI, service layer, DAL, ...

You might also take a look at the Onion Architecture. But onions still have layers :-)

like image 24
Darin Dimitrov Avatar answered Sep 30 '22 10:09

Darin Dimitrov