1, 2 or 3 tier design

By | July 20, 2006

Ever had the challenge of designing software or business applications. If so you probably faced the same problem most of us have. Which tier design do I pick?

The three tiers
Lets start of with a brief explanation of what the different tier setups are. Most applications work as follows. You have a user interface that allows input and displays information. The program then processes the entered information before saving it internally. This data then gets stored into a file when the program closes or in between for safety reasons. This process of displaying, processing and storing information is called 1-tier. Where everything is done by one application.

A two-tier setup means that you have the same application as above, but all the information is stored using a second program. For example a database system. This storage system can have some primitive checks, like data integrity and type (text, numeric, etc).

A three tier system is even more complicated. Here one application is responsible for displaying and input handling. A second application handles all business intelligence checks. That is verifying if information complies with rules, eg. a phone number consists of ten digits. A third and final application takes care of the storage of information.

One setup not mention is the N-Tier setup. This means that there can be multiple applications that handle displaying and input. This is mostly for web based applications, but to complicated to explain here.

The more tiers you pick the more overhead your system will have. I mean every different application (tier) needs to communicate with one or two others. This needs verification that it was successful. So why on earth would you pick the three tier implementation! Well easy enough. If your solution is complicated, not just a simple webshop or personal tool, then it may be complicated to maintain and update. This is one of the reasons to choose for two tier systems.

So when to pick the 1-tier system, well if your application fits the following needs:

  • Small amount of users that need access to the same information
  • Business intelligence is limited and somewhat easy
  • There is little or no expansion planned for the future

Some pointers for choosing the two-tier system:

  • System has multiple users that need access to the same information
  • Business intelligence is limited and somewhat easy
  • Some expansion may be needed, and the storage capabilities must be easily updated (change of database software)

Reasons for choosing a three-tier system:

  • High degree of flexibility required, for example easy to change business inteligence
  • Many different visitors that use the software simultaneously

As you can see in the list above it is not easy to make the choice between the various models. By far the choice depends on what you expect of the solution in the future. If you expect many changes then two or three tier is probably the way to go. Separate the logic and user interface as much as possible.

Leave a Reply