vincentsty
vincentsty

Reputation: 3231

Is the following separation considered 2-tier or 3-tier architecture?

I have a web application that is deployed as follows on web hosting:

  1. Code(without separation of BLL, DAL etc) being uploaded to web hosting
  2. Database (MSSQL backup file) being uploaded to web hosting database

Is this considered a 2-tier architecture or 3-tier architecture?

I have seen different explanation from different sources

  1. If code and database reside on same server, then it is 2-tier. If code and database reside on different server, then it is 3-tier.
  2. A web application with database has a minimum of 3-tier architecture
  3. It is a 2-tier architecture.

Definition of 2-tier by this source
In a 2-tier architecture, web server responds to requests for web pages and a database server provides backend data storage
Definition of multi-tier by this source
In a 3-tier architecture, a web server is linked to a middle-tier layer that typically includes a series of application servers that perform specific tasks, as well as to a backend layer of existing corporate systems

Hope that someone can clarify this.

Upvotes: 4

Views: 259

Answers (1)

Plamen G
Plamen G

Reputation: 4759

It really depends on what you understand under the term "tiers" in your question.

From infrastructural/physical point of view in most web applications you will have 3 layers:

  • Client (browser) <--> Application Server <--> Database

As opposed to most desktop applications that consist of 2-tiers:

  • Client <--> Database

Note that by this this definition a website is not always 3 tier - you might not have any persistence in a simple site that just calculates compound interest for example.

In the web application architecture itself from logical point of view, you often have layers that are abstract representation the aforementioned tiers - for example in MVC, you will have Models corresponding to the database, Controllers corresponding to the logic performed on server and Views corresponding to what gets presented to the client.

So, infrastructurally, you have a 3-tier architecture (because you are clearly in the first case), but from what you have described, your website itself maybe doesn't follow a strict multi-layered approach and it unites multiple logical layers into one.

See this wikipedia article, it will further clear things up.

Update: Also this thread seems to clarify the issue.

Upvotes: 1

Related Questions