Click here to Skip to main content
12,749,770 members (32,338 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL-Server
I am developing a web application but first i wants to know which architecture is best 3 tier or two tier
Posted 16-Sep-12 21:33pm
Updated 16-Sep-12 21:55pm
The answer is: one has three tiers, another -- two tiers. Can't you see that such questions are incorrect?
What exactly do you need to know or have concerns about?
@amitgajjar 17-Sep-12 3:08am
Vithal, Please respect all seniors here. if SA says something there must be some reason. it's like pain when someone downvote us. But in long run it will help us to improve our skills(softskills). See my solution for more information on your question.
vithal wadje 17-Sep-12 3:13am
Sorry @amitgajjar Sir I will remove my comments but i am asking proper question
@amitgajjar 17-Sep-12 3:15am
Dont be sorry. we all are working here as friend. people here are contributing when they have extra time. So we should respect their time and we should be down to earth.
Sergey Alexandrovich Kryukov 17-Sep-12 19:43pm
Those are golden words, Amit; I totally agree and support this view.

I'm not sure you had to protect me against the negative comment by Vithal, especially if you use such shaky arguments as who is "senior", etc. Thank you very much for your support, anyway. We all should respect each other and our rightfulness or failure should only be measured by truth, nothing else. I saw his comment; he complains that I evaluated his posts negatively and maintains that his question is correct.

Every concern deserves some explanation. I don't remember all my comments, but the chances are, that I pointed out incorrectness of questions, so OP might think about: who is really responsible for incorrectness of the questions. So, I can give my explanation about the present question. It's two-fold.

The title has the form "what's the difference between {0} and {1}"? It cannot be a correct question. I answered: "one has three tiers, another -- two tiers". It means that nearly anything can be called a "difference". This is just a figure of human speech, not a strict concept. As I usually ask: can you tell the difference between apple and Apple?

Now, similar thing goes about what is "best". Logically, to answer this question, one would need a definition of "better than". For architectures, it is really absolutely not defined. Let's look at this in the following way: if, say, some N-tier architecture for some fixed N existed as was "the best", all n-tier architectures for n!=N would never be used. Nevertheless, different number of tires are used in different systems. This is because there is nothing special about any particular number of tiers and their roles: they are devised to solve some practically important situations. So, n-tier architectures does not have any absolute value; their value is totally related to some sets of application problems they may or may not be well applicable to, no more. So, asking "what's the best" makes no sense at all and cannot be answered.

For an enquirer, it's way to easy to play offended card and pretend the criticizing person is responsible for some trouble. But in this case, who is the looser? :-)
For everyone, it's much more fruitful to listen to criticism and try to improve one's work by actually using this criticism. Of course, anyone has a right to ask for proper arguments. I personally would gladly answer to such concerns.

Thank you.
CodeHawkz 18-Sep-12 0:04am
Nicely put. But if I may add to that, by answering lot of questions that are poorly elaborated, our frustration builds up and some may not see the sarcasm/hint that we try to provide for him to think and understand by himself.
Therefore, I personally take care (I lose it too :D) to put it simple as possible and retain from long arguments/discussions off the topic/problem. :) Just my 2 cents
@amitgajjar 18-Sep-12 1:06am
Nice explanation. SA, I always try to improve my self. Not in terms of knowledge but we should also improve ourself by being gentle and calm. In software industries there are many situations comes when we have to handle people with different mindset. So here i am just trying to make everything settle and we all can work without hating each other. I am not saying senior person in terms of Age/CP wealth/Knowledge, but i consider each person is senior if they gives you something. Something may be criticism or appreciation. Very few people can digest criticism. and i am just trying to educate OP to accept criticism. Anyway thanks again for such an explanation

-Amit Gajjar
vithal wadje 18-Sep-12 1:40am
I am really sorry Sergey Alexandrovich Kryukov sir..I will do not make this types of mistakes in my life in future ..i will learn from you and others ..because i got my first job and i have settle my life only n only help of code project means members like you and others..i read this articles since i am in second year college and got the motivation to work only on .net...
so sir i just try to repay the credit of code project by giving the simple answer question answer and asking the some question so they can help others and me..
again sorry for hurt you
Sergey Alexandrovich Kryukov 18-Sep-12 14:43pm
This advice certainly makes a lot of sense.
Thank you,
Sergey Alexandrovich Kryukov 18-Sep-12 14:48pm
Thank you very much for this comment. These attitudes and your understanding really deserves my deep respect.
My very best wishes,
Sergey Alexandrovich Kryukov 18-Sep-12 14:59pm
Dear Vithal,

You did not really hurt me at all, but you correctly gave me a chance to explain you the problem you have in more detail, as well as my position, which I gladly did. Your ability to learn from your mistakes and the mistakes of others and ability to change your approach to more productive ways of posing problems and other things deserves respect.

I think that when you face the situations when people criticize you, you are able to actually use if for your own good where possible, which is wise and just gives you the considerable advantage over many people, those who take it aggressively and only loose the face, nothing else.

So, I will gladly try to help you if you have some other problems and ready to do a hard job of working at them.

Best wishes,
@amitgajjar 19-Sep-12 0:32am
Thank you SA :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


As of now you will not see much difference. Creating multiple layers is like seprating your code for load balancing or making your code maintainable.

If you are running small project with single entry form, you may find 3Tier architecture more complicated but when you go for the complicated solution with validation/Security you found it very helpful.

Sometimes people used to call NTier architecture, it means they divide thier code in multiple tire to perform multiple task.

So Using Business layer in between UserInterface and DataAccess is optional depending upon how you are maintaining your code.

Hope you got some idea.
vithal wadje 17-Sep-12 3:14am
Thanks a lot sir

n Sorry @amitgajjar Sir I will remove my comments but i am asking proper question
@amitgajjar 17-Sep-12 3:16am
Polite people always win the world in long run.
vithal wadje 17-Sep-12 3:25am
thank u sir next time i will take care about my comments an i am new on code project so i will learn a lot in future
@amitgajjar 17-Sep-12 3:50am
Thats for sure.
__TR__ 17-Sep-12 5:50am
My 5! Nicely explained.
@amitgajjar 17-Sep-12 6:17am
Thank you.
Sergey Alexandrovich Kryukov 17-Sep-12 19:47pm
Agree, my 5. Here, the value of n-tier architectures in general is really what should be understood and appreciated first.
Please also see my last comment in the comments to the question.
@amitgajjar 18-Sep-12 1:08am
Thank you SA :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Hi there,

I am sorry to disappoint you but I believe what S.A.Kryukov is trying to say is correct.

The main difference between the 2-tier and 3-tier architectures is that, the the latter has a clear extraction of it's business logic into an intermediate layer. This way, the dependency to UI is minimized.

But you cannot say one is better than the other (as per your question, 'what is the best') due to the reason that, it all depends on the complexity of the application you want to develop.

I'll try to explain it with an example. Let's imagine, you are developing a complete web based solution for a certain company. We can consider this system to be somewhat large, complex and is subject to changes/updates frequently. Now this is where the 3-tier architecture comes handy. You can change things easily. But you should remember that, in this scenario based on the complexity, you might go for 4-tier, 5-tier (n-tier architecture). These tiers might be physical or logical as well.
But imagine you are developing a website for an assignment. It's awesome to do that in a 3-tier or n-tier architecture but all you are doing is introducing a unnecessary level of complexity.

These design guidelines/patterns exist for a reason. I.e. to help you create robust applications/websites/components. Not to create the best applications. You have to decide what design guidelines/patterns to use based on your requirement, not the other way around. You have to apply these guidelines to get rid of an existing bottleneck or an applicable bottleneck foreseen. So there is no best architecture; I hope I made sense to you.

Hope this helps, regards
vithal wadje 17-Sep-12 3:23am
Thank u CodeHawkz sir next time i will take care about my comments an i am new on code project so i will learn a lot in future
CodeHawkz 17-Sep-12 5:41am
:) Glad I could help
__TR__ 17-Sep-12 5:51am
Sergey Alexandrovich Kryukov 17-Sep-12 19:47pm
My 5. Please also see my comment in the comments to the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 17 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100