Download presentation
Presentation is loading. Please wait.
Published byΠλειόνη Παπαστεφάνου Modified over 6 years ago
1
Lecture 1: Multi-tier Architecture Overview
IS333: MULTI-TIER APPLICATION DEVELOPMENT
2
Objectives To explain the concept of multi-tier design. 12/1/2018
3
What is a “Tier”? A "tier" can be referred to as a "layer".
A wedding cake is said to have tiers while a chocolate cake is said to have layers, but they mean the same thing. 12/1/2018
4
Tiers/ Layers Characteristics - in Software World
Each tier/layer should be able to be constructed separately, possibly by different teams of people with different skills. Several tiers/layers should be able to be joined together to make a whole "something". Each tier/layer should contribute something different to the whole. A chocolate layer cake, for example, has layers of chocolate cake and cream. 12/1/2018
5
Tiers/ Layers Characteristics - in Software World (cont.)
There must also be some sort of boundary between one tier and another. Each tier/layer should not be able to operate independently without interaction with other tiers/layers. 12/1/2018
6
Basic Idea of Multi-tier Design
The basic idea of a multi-tier design is that all of the logical functions of the application are (or at least have the potential to be) separated on provides output to other layers. 12/1/2018
7
The Standard Logical Layers
Presentation logic: The user interface (UI) which displays data to the user and accepts input from the user. In a web application, this is the part which receives the HTTP request and returns the HTML response. Business logic: Handles data validation, business rules and task-specific behavior. Data Access logic: Communicates with the database by constructing SQL queries and executing them via the relevant API. 12/1/2018
8
Example of Business Logic
12/1/2018
9
Tiers vs. Layers in Software
Tier is a physical unit, where the code / process runs. E.g.: client, application server, database server Layer is a logical unit, how to organize the code. E.g.: presentation (view), controller, models, repository, data access A three-layer solution could easily be deployed on a single tier, such as a personal workstation 12/1/2018
10
1-Tier Architecture All 3 layers are on the same machine
All code and processing kept on a single machine Presentation, Logic, Data layers are tightly connected Scalability: Single processor means hard to increase volume of processing Portability: Moving to a new machine may mean rewriting everything Maintenance: Changing the layer requires changing other layers 12/1/2018
11
1-Tier Architecture 12/1/2018
12
1-Tier Architecture (blurry boundary)
12/1/2018
13
2-Tier Architecture Database runs on Server
Separated from client Easy to switch to a different database Presentation and logic layers still tightly connected Heavy load on server Potential congestion on network Presentation still tied to business logic 12/1/2018
14
2-Tier Architecture 12/1/2018
15
3-Tier Architecture Each layer can potentially run on a different machine Presentation, logic, data layers disconnected Presentation Layer contains Presentation logic Business Layer Business logic Data Layer Data Access logic Database Client Server DB Server 12/1/2018
16
3-Tier Architecture 12/1/2018
17
The Rules of the Multi-tier Architecture
The code for each layer must be contained with separate files which can be maintained separately. Each layer may only contain code which belongs in that layer. Thus business logic can only reside in the Business layer, presentation logic in the Presentation layer, and data access logic in the Data Access layer. 12/1/2018
18
Requests and Responses in the 3 Tier Architecture
12/1/2018
19
The Rules of the Multi-tier Architecture (Cont.)
The Presentation layer can only receive requests from, and return responses to, an outside agent. This is usually a person, but may be another piece of software. The Presentation layer can only send requests to, and receive responses from, the Business layer. It cannot have direct access to either the database or the Data Access layer. 12/1/2018
20
The Rules of the Multi-tier Architecture (Cont.)
The Business layer can only receive requests from, and return response to, the Presentation layer. The Business layer can only send requests to, and receive responses from, the Data Access layer. It cannot access the database directly. 12/1/2018
21
The Rules of the Multi-tier Architecture (Cont.)
The Data Access layer can only receive requests from, and return responses to, the Business layer. It cannot issue requests to anything other than the DBMS which it supports. Each layer should be totally unaware of the inner workings of the other layers. 12/1/2018
22
The 3-Tier Architecture for Web Application
Presentation Layer Static or dynamically generated content rendered by the browser, e.g., HTML, CSS, Javascript (front-end) Logic Layer A dynamic content processing and generation level application server, e.g., Java EE, ASP.NET, PHP, ColdFusion platform (middleware) Data Layer A database, comprising both data sets and the database management system or RDBMS software that manages and provides access to the data (back-end) 12/1/2018
23
Web services or external HTML pages
N-Tier Architecture Elsewhere Layer Web services or external HTML pages Requester/ Consumer Layer Presentation Layer Business-Logic Layer Accessor Layer Persistance Layer Web browser/ XML parser or other client Validation/ Processing/ Content Providing modules Database Get Update/ Delete modules Display modules 12/1/2018
24
N-Tier Architecture (cont.)
This architecture differs from standard (3-Tier) in three respects: It explicitly states that the persistence layer (the database and its database management system) and the accessor layer, which feeds SQL queries to the persistence layer, are separated. It explicitly lists the requester/consumer layer as part of the application, even though the software running there is usually not under the control of the developer building the rest of the application (in the case of a browser, it’s from the Mozilla team or Microsoft or whomever). It acknowledges that remote resources (the elsewhere layer) can be an integral part of a multi-tier application. 12/1/2018
25
N-Tier Architecture (cont.)
Persistence Layer: The database or other storage mechanism that keeps data in an organized way. Accessor Layer: The programs that pass queries to the persistence layer (in other words, the programs in which structured query language (SQL) statements are hard- coded). These programs expose “get” and “set” functions. Business-Logic Layer: The programs that process user input and stored data and come up with a useful result. Presentation Layer: The programs that format the results of the logic layer as hypertext markup language (HTML), extensible markup language (XML), or whatever else the user requires. 12/1/2018
26
N-Tier Architecture (cont.)
Requester/consumer Layer: The Web browser, XML parser, or other client that makes requests of the application and receives its output. Elsewhere Layer: The external Web services, HTML pages, and other resources to which applications make reference. 12/1/2018
27
Advantages of Multi-Tier Architecture
Flexibility - By separating the business logic of an application from its presentation logic, a Multi-Tier architecture makes the application much more flexible to changes. Maintainability - Changes to the components in one layer should have no effect on any others layers. Also, if different layers require different skills (such as HTML/CSS in the presentation layer, PHP/Java in the business layer, SQL in the data access layer) then these can be managed by independent teams with skills in those specific areas. 12/1/2018
28
Advantages of Multi-Tier Architecture
Reusability - Separating the application into multiple layers makes it easier to implement re-usable components. A single component in the business layer, for example, may be accessed by multiple components in the presentation layer, or even by several different presentation layers (such as desktop and the web) at the same time. Scalability - A Multi-Tier architecture allows distribution of application components across multiple servers thus making the system much more scalable. Reliability - A Multi-Tier architecture, if deployed on multiple servers, makes it easier to increase reliability of a system by implementing multiple levels of redundancy. 12/1/2018
29
References Multi-tier Application Programming with PHP, Practical Guide for Architect and Programmer, David Wall, 1st Edition architecture.html 12/1/2018
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.