In
software engineering
Software engineering is a systematic engineering approach to software development.
A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term '' ...
, multitier architecture (often referred to as ''n''-tier architecture) is a
client–server architecture in which presentation, application processing and data management functions are physically separated. The most widespread use of multitier architecture is the three-tier architecture.
''N''-tier application architecture provides a model by which developers can create flexible and reusable applications. By segregating an application into tiers, developers acquire the option of modifying or adding a specific tier, instead of reworking the entire application. A three-tier architecture is typically composed of a ''presentation'' tier, a ''
logic
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premises ...
'' tier, and a ''
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted ...
'' tier.
While the concepts of layer and tier are often used interchangeably, one fairly common point of view is that there is indeed a difference. This view holds that a ''layer'' is a logical structuring mechanism for the conceptual elements that make up the software solution, while a ''tier'' is a physical structuring mechanism for the hardware elements that make up the system infrastructure. For example, a three-layer solution could easily be deployed on a single tier, such in the case of an extreme
database-centric architecture
Database-centric Architecture or data-centric architecture has several distinct meanings, generally relating to software architectures in which databases play a crucial role. Often this description is meant to contrast the design to an alternative ...
called RDBMS-only architecture or in a personal workstation.
Layers
The "Layers"
architectural pattern have been described in various publications.
[Buschmann, Frank; Meunier, Regine; Rohnert, Hans; Sommerlad, Peter; Stal, Michael (1996-08). Pattern-Oriented Software Architecture, Volume 1, A System of Patterns. Wiley, August 1996. . Retrieved from http://www.wiley.com/WileyCDA/WileyTitle/productCd-0471958697.html.]
Common layers
In a logical multilayer architecture for an information system with an
object-oriented design
Object-oriented design (OOD) is the process of planning a system of interacting objects for the purpose of solving a software problem. It is one approach to software design.
Overview
An object contains encapsulated data and procedures grouped t ...
, the following four are the most common:
* Presentation layer (a.k.a. UI layer, view layer, presentation tier in multitier architecture)
* Application layer (a.k.a.
service layer
In intelligent networks (IN) and cellular networks, service layer is a conceptual layer within a network service provider architecture. It aims at providing middleware that serves third-party value-added services and applications at a higher a ...
or
GRASP
A grasp is an act of taking, holding or seizing firmly with (or as if with) the hand. An example of a grasp is the handshake, wherein two people grasp one of each other's like hands.
In zoology particularly, prehensility is the quality of an ap ...
Controller Layer )
*
Business layer (a.k.a. business logic layer (BLL), domain logic layer)
*
Data access layer A data access layer (DAL) in computer software is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database. This acronym is prevalently used in Microsoft ...
(a.k.a.
persistence layer, logging, networking, and other services which are required to support a particular business layer)
The book ''Domain Driven Design'' describes some common uses for the above four layers, although its primary focus is the
domain layer In computer software, business logic or domain logic is the part of the program that encodes the real-world business rules that determine how data can be created, stored, and changed. It is contrasted with the remainder of the software that might ...
.
If the application architecture has no explicit distinction between the business layer and the presentation layer (i.e., the presentation layer is considered part of the business layer), then a traditional client-server (two-tier) model has been implemented.
The more usual convention is that the application layer (or service layer) is considered a sublayer of the business layer, typically encapsulating the API definition surfacing the supported business functionality. The application/business layers can, in fact, be further subdivided to emphasize additional sublayers of distinct responsibility. For example, if the
model–view–presenter
Model–view–presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern, and is used mostly for building user interfaces.
In MVP, the ''presenter'' assumes the functionality of the "middle-man". In MVP, all ...
pattern is used, the presenter sublayer might be used as an additional layer between the user interface layer and the business/application layer (as represented by the model sublayer).
Some also identify a separate layer called the business infrastructure layer (BI), located between the business layer(s) and the infrastructure layer(s). It's also sometimes called the "low-level business layer" or the "business services layer". This layer is very general and can be used in several application tiers (e.g. a CurrencyConverter).
[''Applying UML and Patterns'', 3rd edition, page 203](_blank)
The infrastructure layer can be partitioned into different levels (high-level or low-level technical services).
Developers often focus on the persistence (data access) capabilities of the infrastructure layer and therefore only talk about the persistence layer or the data access layer (instead of an infrastructure layer or technical services layer). In other words, the other kind of technical services is not always explicitly thought of as part of any particular layer.
A layer is on top of another, because it depends on it. Every layer can exist without the layers above it, and requires the layers below it to function. Another common view is that layers do not always strictly depend on only the adjacent layer below. For example, in a relaxed layered system (as opposed to a strict layered system) a layer can also depend on all the layers below it.
Three-tier architecture
![Overview of a three-tier application vectorVersion](https://upload.wikimedia.org/wikipedia/commons/5/51/Overview_of_a_three-tier_application_vectorVersion.svg)
Three-tier architecture is a client-server
software architecture pattern in which the
user interface
In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
(presentation),
functional process logic ("business rules"),
computer data storage
Computer data storage is a technology consisting of computer components and Data storage, recording media that are used to retain digital data (computing), data. It is a core function and fundamental component of computers.
The central pro ...
and
data access
Data access is a generic term referring to a process which has both an IT-specific meaning and other connotations involving access rights in a broader legal and/or political sense. In the former it typically refers to software and activities relat ...
are developed and maintained as independent
modules
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
, most often on separate
platforms.
[ Eckerson, Wayne W. "Three Tier Client/Server Architecture: Achieving Scalability, Performance, and Efficiency in Client Server Applications." Open Information Systems 10, 1 (January 1995): 3(20)] It was developed by
John J. Donovan
John J. Donovan (born February 12, 1942) is a former management professor at MIT, and the former president and chief executive of the Cambridge Technology Group, an executive training company. On May 3, 2022, Donovan Sr. was convicted of a doze ...
in Open Environment Corporation (OEC), a tools company he founded in
Cambridge, Massachusetts
Cambridge ( ) is a city in Middlesex County, Massachusetts, United States. As part of the Boston metropolitan area, the cities population of the 2020 U.S. census was 118,403, making it the fourth most populous city in the state, behind Boston, ...
.
Apart from the usual advantages of modular
software
Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.
At the lowest programming level, executable code consists ...
with well-defined interfaces, the three-tier architecture is intended to allow any of the three tiers to be upgraded or replaced independently in response to changes in requirements or
technology
Technology is the application of knowledge to reach practical goals in a specifiable and reproducible way. The word ''technology'' may also mean the product of such an endeavor. The use of technology is widely prevalent in medicine, science, ...
. For example, a change of
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
in the ''presentation tier'' would only affect the user interface code.
Typically, the user interface runs on a desktop
PC or
workstation
A workstation is a special computer designed for technical or scientific applications. Intended primarily to be used by a single user, they are commonly connected to a local area network and run multi-user operating systems. The term ''workstat ...
and uses a standard
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
, functional process logic that may consist of one or more separate modules running on a workstation or
application server
An application server is a server that hosts applications or software that delivers a business application through a communication protocol.
An application server framework is a service layer model. It includes software components available to a ...
, and an
RDBMS
A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relation ...
on a
database server
A database server is a server which uses a database application that provides database services to other computer programs or to computers, as defined by the client–server model. Database management systems (DBMSs) frequently provide database-s ...
or
mainframe that contains the computer data storage logic. The middle tier may be multitiered itself (in which case the overall architecture is called an "''n''-tier architecture").
; Presentation tier
: This is the topmost level of the application. The presentation tier displays information related to such services as browsing merchandise, purchasing and shopping cart contents. It communicates with other tiers by which it puts out the results to the browser/client tier and all other tiers in the network. In simple terms, it is a layer that users can access directly (such as a web page, or an operating system's GUI).
; Application tier (business logic, logic tier, or middle tier)
: The logical tier is pulled out from the presentation tier and, as its layer, it controls an application’s functionality by performing detailed processing.
; Data tier
: The data tier includes the data persistence mechanisms (database servers, file shares, etc.) and the data access layer that encapsulates the persistence mechanisms and exposes the data. The data access layer should provide an
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
to the application tier that exposes methods of managing the stored data without exposing or creating dependencies on the data storage mechanisms. Avoiding dependencies on the storage mechanisms allows for updates or changes without the application tier clients being affected by or even aware of the change. As with the separation of any tier, there are costs for implementation and often costs to performance in exchange for improved scalability and maintainability.
Web development usage
In the
web development
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). Web development can range from developing a simple single static page of plain text to complex web applications ...
field, three-tier is often used to refer to
website
A website (also written as a web site) is a collection of web pages and related content that is identified by a common domain name and published on at least one web server. Examples of notable websites are Google Search, Google, Facebook, Amaz ...
s, commonly
electronic commerce
E-commerce (electronic commerce) is the activity of electronically buying or selling of products on online services or over the Internet. E-commerce draws on technologies such as mobile commerce, electronic funds transfer, supply chain manageme ...
websites, which are built using three tiers:
# A front-end
web server
A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
serving static content, and potentially some
cached dynamic content. In web-based application, front end is the content rendered by the browser. The content may be static or generated dynamically.
# A middle dynamic content processing and generation level
application server
An application server is a server that hosts applications or software that delivers a business application through a communication protocol.
An application server framework is a service layer model. It includes software components available to a ...
(e.g.,
Symfony,
Spring
Spring(s) may refer to:
Common uses
* Spring (season)
Spring, also known as springtime, is one of the four temperate seasons, succeeding winter and preceding summer. There are various technical definitions of spring, but local usage of ...
,
ASP.NET
ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name s ...
,
Django,
Rails
Rail or rails may refer to:
Rail transport
*Rail transport and related matters
*Rail (rail transport) or railway lines, the running surface of a railway
Arts and media Film
* ''Rails'' (film), a 1929 Italian film by Mario Camerini
* ''Rail'' ( ...
,
Node.js
Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code o ...
).
# A back-end
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
or
data store
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted. ...
, comprising both data sets and the
database management system
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases span ...
software that manages and provides access to the data.
Other considerations
Data transfer between tiers is part of the architecture. Protocols involved may include one or more of
SNMP
Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behaviour. Devices that typically ...
,
CORBA
The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between sys ...
,
Java RMI
In computing, the Java Remote Method Invocation (Java RMI) is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java classes and dist ...
,
.NET Remoting
.NET Remoting is a Microsoft application programming interface (API) for interprocess communication released in 2002 with the 1.0 version of .NET Framework. It is one in a series of Microsoft technologies that began in 1990 with the first version ...
,
Windows Communication Foundation
The Windows Communication Foundation (WCF), previously known as Indigo, is a free and open-source runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications.
.NET Core 1.0, released 2016, did not sup ...
,
sockets,
UDP,
web services or other standard or proprietary protocols. Often
middleware
Middleware is a type of computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".
Middleware makes it easier for software developers to implement co ...
is used to connect the separate tiers. Separate tiers often (but not necessarily) run on separate physical servers, and each tier may itself run on a
cluster
may refer to:
Science and technology Astronomy
* Cluster (spacecraft), constellation of four European Space Agency spacecraft
* Asteroid cluster, a small asteroid family
* Cluster II (spacecraft), a European Space Agency mission to study t ...
.
Traceability
The end-to-end traceability of data flows through ''n''-tier systems is a challenging task which becomes more important when systems increase in complexity. The
Application Response Measurement
Application Response Measurement (ARM) is an open standard published by the Open Group for monitoring and diagnosing performance bottlenecks within complex enterprise applications that use loosely-coupled designs or service-oriented architectures ...
defines concepts and
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
s for measuring performance and correlating transactions between tiers.
Generally, the term "tiers" is used to describe physical distribution of components of a system on separate servers, computers, or networks (processing nodes). A three-tier architecture then will have three processing nodes. The term "layers" refers to a logical grouping of components which may or may not be physically located on one processing node.
See also
*
Abstraction layer
In computing, an abstraction layer or abstraction level is a way of hiding the working details of a subsystem. Examples of software models that use layers of abstraction include the OSI model for network protocols, OpenGL, and other graphics libra ...
*
Client–server model
The client–server model is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. Often clients and servers communicate over ...
*
Database-centric architecture
Database-centric Architecture or data-centric architecture has several distinct meanings, generally relating to software architectures in which databases play a crucial role. Often this description is meant to contrast the design to an alternative ...
*
Front-end and back-end
Front end may refer to:
Computing
* Front-end (computing), an interface between the user and the back end
* Front-end processor (computer), a small-sized computer
* Front-end processor (program)
* Front-end web development, the practice of prod ...
*
Hierarchical internetworking model
The Hierarchical internetworking model is a three-layer model for network design first proposed by Cisco. It divides enterprise networks into three layers: core, distribution, and access layer.
Access layer
End-stations and servers connect to t ...
*
Load balancing (computing)
In computing, load balancing is the process of distributing a set of tasks over a set of resources (computing units), with the aim of making their overall processing more efficient. Load balancing can optimize the response time and avoid unevenl ...
*
Monolithic application
In software engineering, a monolithic application describes a single-tiered software application in which the user interface and data access code are combined into a single program from a single platform.
A monolithic application is self-contained ...
*
Open Services Architecture The Open Service Access or OSA is part of the third generation mobile telecommunications network or UMTS. OSA describes how services are designed in a UMTS network.
The standards for OSA are being developed as part of the 3rd Generation Partnership ...
*
Rich web application
*
Service layer
In intelligent networks (IN) and cellular networks, service layer is a conceptual layer within a network service provider architecture. It aims at providing middleware that serves third-party value-added services and applications at a higher a ...
*
Shearing layers
*
Web application
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
References
External links
Linux journal, ''Three Tier Architecture''Microsoft Application Architecture GuideDescription of a concrete layered architecture for .NET/WPF Rich Client Applications
{{DEFAULTSORT:Multitier Architecture
Distributed computing architecture
Software architecture
Architectural pattern (computer science)
Software design
Software engineering terminology
Software design patterns