I have noticed over the years that different developers have different criteria for what constitutes a tier in the development of an n-tier system so I was curious about what the consensus is here at stackoverflow.
Is separate logical layers sufficient to call it a separate tier or does it have to be deployable on a separate server (physical or virtual) in order to call it a separate tier?
Let me phrase the question a little bit differently. If the calling mechanism can only be in process, thread local, or apartment local, then is it possible to claim that it is two different tiers depending on how the classes are organized into libraries or packages?
An N-tier architecture divides an application into logical layers and physical tiers. Layers are a way to separate responsibilities and manage dependencies. Each layer has a specific responsibility. A higher layer can use services in a lower layer, but not the other way around.
What are the Benefits of N-Tier Architecture? There are several benefits to using n-tier architecture for your software. These are scalability, ease of management, flexibility, and security. Secure: You can secure each of the three tiers separately using different methods.
N-tier data applications are data applications that are separated into multiple tiers. Also called "distributed applications" and "multitier applications", n-tier applications separate processing into discrete tiers that are distributed between the client and the server.
A separate logical layer is enough for me to call it a tier. It doesn't necessarily have to be on a separate server but the defined separation from other layers certainly makes it possible.
As an example we used to have what I would call a 3 tier system (db, dll, asp pages) running on a single server. By some definitions this is a single tier system. We now have the database running on a separate server, the only change required was a connection string but now this would be a two tier solution?
That is why I feel the concept of a tier is more about the ability to run them on separate machines rather than actually having to. It just seems more consistent to me.
For me, physical tier means part of the system, designed to be run on different physical machine. Yes, you can point your db connection string to another server at any time, but if your DAL is too chatty, has n+1 and unbounded record set problems, than network latency will kill you really fast.
Logical layer, on the other hand, supports virtues of separation of concerns, cohesion and coupling. Strictly it doesn't even have to be in separate assembly - namespace will do the trick. Just do not call classes you know you shouldn't, NDepend help you.
The concepts of layer and tier are often used interchangeably. However, one fairly common point of view is that there is indeed a difference, and that a layer is a logical structuring mechanism for the elements that make up the software solution, while a tier is a physical structuring mechanism for the system infrastructure
Ref.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With