Architecture – Should the web client (web browser) be counted as a tier in n-tier architecture

Architecturen-tierweb-applicationsweb-browser

In a course, a test's solution says the following has a 4-tier architecture

enter image description here

But it seems to have a 3-tier architecture to me.
I don't count the client (web browser) as a tier itself, but the test's solution seems to count it.

Which one is correct, according to the wikipedia article or consensus?

Best Answer

The challenge in answering this question is that we are dealing with terms, in this case "tier", that have imprecise meanings and different people use the term differently.

For example, a common view is that there is a distinction between layers and tiers. A layer is an abstract separation, as in the controllers, business logic and data objects in your diagram. Tiers are physical separations. In your diagram's case, the browser, the database and the logic within the Java application are the tiers.

So taking that definition, the diagram shows a three tier, four layer architecture. The browser definitely is a tier, and, for example, "presentation" isn't a tier; it's a layer.

But this isn't a definition that is set in stone or universally recognised. As the Wikipedia article that you link to mentions, many people will use the two terms, layer and tier, interchangeably. At that point, your diagram could be three tier or four tier, depending on how the person chooses to apply the term.

Related Topic