Three layer architecture is a kind of system which imposes separation between these parts:
- Client Tier or user interface
- Middle Tier or business logic
- Data Storage Tier
Any piece of software can be subdivided into the following region:
- Browser or GUI Application = Business logic = Business Rules, it deals with data validation and task-specific performance.
- Web Server or Application Server = Presentation logic = User Interface, showing data to the user, allowing input from the user.
- Database Server = Database Communication, making SQL queries and completing them via the related API.
What is a Layer?
A layer is a fraction of code that can be used again and which performs particular function. In the network environment, a layer is typically a set of connections as a project that symbolizes this particular purpose. This particular layer works with other layers to carry out some particular aim.
Single tier structure
If you have the code dealing with presentation logic (production of HTML documents), business logic (the making of rules) and data access logic (the production and completing of DML statements) into a single module then you are having a single tier structure. All processing was done in single computer and all the resources was also attached to single computer this means that on that computer the load was high.
Double tier structure
If you divide the code that deals with the communication with physical database to separate component it is called 2 tier architecture.
Three tier structure
If you divide further the presentation logic and business logic into separate components then you can have 3 tier architecture. In this structure there is not any direct communication between the presentation and data access layers everything must pass through business layer which is in the middle.
As soon as the architecture is implemented the benefits the benefits can be noticed as more code can be shared rather than being duplicated. Many components in the presentation layer share the same parts in the business layer and all parts in the
business layer share the same parts in the data access layer.
Advantages of 3 tier architecture
- The advantage of a 3-tier system is that the contents of any of the tiers/layers can be replaced without making any resultant changes in any of the others. For example:
- A change from one DBMS to other will only involve a change to the part in the data access layer.
- A change in the Use Interface (from desktop to the web, will need only some changes in the components of the presentation layer.
- The benefit of writing the presentation and business layered architecture in different languages is that it is an advantage of the presentation and business layers is that it is feasible to use different developer teams to work on each. It means that only PHP skills are required for data access layer and business layer, and HTML, CSS and XLS skills for presentation layers. It is easier to find a developer with skills in one of these rather having a kind of developer having all of the skills.
- Another main advantage of using XML/XLS in the presentation layer is that it the output can be changed from HTML to WML or PDF or any other format using a different XLS style sheet. XLS files can be used to change XML documents into a number of formats and not only HTML.
- It has better wait balancing system because the entire work load is divided.
- Security polices can be imposed without effecting the clients.