Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does three-tier architecture ever work?

We are building three-tier architectures for over a decade now. Dividing presentation-, logic- and data-tier is supposed to allow us to exchange each layer individually, should the need ever arise, be it through changed requirements or new technologies.

I have never seen it working in practice...

Mostly because (at least) one of the following reasons:

  • The three tiers concept was only visible in the source code (e.g. package naming in Java) which was then deployed as one, tied together package.
  • The code representing each layer was nicely bundled in its own deployable format but then thrown into the same process (e.g. an "enterprise container").
  • Each layer was run in its own process, sometimes even on different machines but through the static nature they were connected to each other, replacing one of them meant breaking all of them.

Thus what you usually end up with, in is a monolithic, tightly coupled system that does not deliver what it's architecture promised.

I therefore think "three-tier architecture" is a total misnomer. The true benefit it brings is that the code is logically sound. But that's at "write time", not at "run time". A better name would be something like "layered by responsibility". In any case, the "architecture" word is misleading.

What are your thoughts on this? How could working three-tier architecture be achieved? By that I mean one which holds its promises: Allowing to plug out a layer without affecting the other ones. The system should survive that and be in a well defined state afterwards.

Thanks!

like image 616
raoulsson Avatar asked Aug 03 '26 03:08

raoulsson


2 Answers

The true purpose of layered architectures (both logical and physical tiers) isn't to make it easy to replace a layer (which is quite rare), but to make it easy to make changes within a layer without affecting the others (and as Ben notes, to facilitate scalability, consistency, and security) - which works all the time all around us.

like image 117
Jeff Sternal Avatar answered Aug 05 '26 18:08

Jeff Sternal


One example of a 3-tier architecture is a typical database-driven web application:

  1. End-user's web browser
  2. Server-side web application logic
  3. Database engine
like image 40
ChrisW Avatar answered Aug 05 '26 18:08

ChrisW