0

I have been asked to define the architecture of my application, but I am a little torn on how to word it. What do you guys think?

  • We have developed a .Net MVC application.
  • It is used inside a local network.
  • We have workstations that view the MVC website (presentation tier)
  • We have an application server hosting the site (Logic tier)
  • We have a database server storing the data (SQL 2008 R2) (Data tier)

So I thought that due to the tiers, it is a three tier architecture.
However, because we have used MVC, does this mean that our layers are more directly (albeit loosely-coupled) connected, thus making our architecture a less linear (three tier) and more triangular (MVC)?

How do you think I should describe this architecture?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
John
  • 189
  • 1
  • 10
  • @user666262: should you describe it to the technical people or to marketing ? – Tigran Jan 13 '12 at 10:18
  • the MVC Presentation Tier runs on the web server and I guess your logic as well and your application server hosting the site simply is the web server. This is a two tier architecture, web and db backend in my opinion. MVC is a UI Framework does not add or remove a tier. – Davide Piras Jan 13 '12 at 10:18
  • Why does it matter? Does the app work? Does it score well in real-world usability testing? Is the source code easy to read, understand, and maintainable? **Success!** Call it whatever you want. – Cody Gray - on strike Jan 13 '12 at 10:24
  • @CodyGray: it denepnds **to whom** you need to explain it. Marketing, for example, don't care about code readability, code source control and things like that. They may be interested in some Kanban board, demo, or application usage statistics. – Tigran Jan 13 '12 at 10:30
  • Marketing generally doesn't care about design patterns, either. They care about what the software *does*. And design patterns don't *do* anything. – Cody Gray - on strike Jan 13 '12 at 10:32

2 Answers2

3

I think the term "3-tier architecture" is ill-defined and outdated because it highlights not the way your code is structured nor does it offer any benefit or drawback from a user perspective. The problem is that it refers to the physical deployment, something that in times of virtualization and distributed computing is hardly meaningful.

"Tier" refers to machines, and since you can typically run and debug your website only using your local dev machine, it can usually be deployed 1-tier. The more relevant question, perhaps, is "what is the maximum number of (logical) machines I can split my application up in?" That number is independent of the actual deployment, and is dictated by the code's structure instead - by the layering. Of course, machines that duplicate another machine (multiple web servers for load balancing) don't count.

The information is still hardly relevant. It suggests that your code separates concerns and might be more scalable than code which does not allow splitting to separate tiers. Another idea is strong decoupling: you can replace one layer w/o touching another one. In practice, that is hardly ever working (e.g. switch from Oracle to MySQL), and solves some outdated problems: "a change of operating system in the presentation tier would only affect the user interface code." (Wikipedia)

All this becomes more ill-defined when you add external SaaS/PaaS products, or third party tools like SolR (a search engine). Is SolR part of the data tier or part of the logic tier? Does your architecture become 4-tier by adding a caching layer? What if your database tier is not one machine, but a cluster of 10 machines?

MVC, on the other hand, refers to the way your code is structured. It's not only a presentation-layer pattern, however: The model does not know the controller, nor the view. MVC separates data, presentation and logic into different layers. Most MVC implementations use Two-Step-View as a presentation-layer pattern, and PageController as a controller pattern. A FrontController usually exists as well and handles all requests before delegating to the respective PageController - but the key is that the model does not know all this.

I'd suggest to drop the notion of "n-tier architecture" altogether.

Community
  • 1
  • 1
mnemosyn
  • 45,391
  • 6
  • 76
  • 82
2

I would describe it as a 3 tier application and would put the MVC aspect into the presentation-tier.

Since your basic structure is a three tier based one and uses MVC for Displaying data to the user. (Maybe you can put the box with MVC overlaying presentation-tier and application-tier - to illustrate the actual interaction between these two).

Gambrinus
  • 2,140
  • 16
  • 26