What's the difference between "Layers" and "Tiers"?
标签:
architecture
相关问题
- Shared common definitions across C/C++ (unmanaged)
- Long-lived RESTful interactions
- Flutter BLoC: Is using nested StreamBuilders a bad
- How to prevent or intercept a call to Directory.De
- structure a large project software with MVC [close
相关文章
- Why doesn't there exists a subi opcode for MIP
- DDD Architecture - Where To Put Common Methods/Hel
- Proper scenekit architecture for multi level/scree
- MySQLi Error Handling?
- GET requests in TOR network without installing TOR
- TIme-based Notification Architecture
- Architecture of Azure Mobile Services Application
- designing application classes
1.In 3 layer architecture DAL(Databse layer), BLL(Bissiness layer) and UIL(UI layer) can work on same machine where as in a 3 Tier architecture a client in on one machine, the application Server is hosted in another machine and the database server resides in another machine.
2.Layer Architecture will improve readability and reusability, Minimizes the application changes due to impact of the changes in other layers. While 3 Tier Architecture has all advantages of 3 layer + scalability as application will be deployed in different machines so load will be shared among the tiers and scalability will increase.
Tier
refers to "each in a series of rows or levels of a structure placed one above the other" whereas theLayer
refers to "a sheet, quantity, or thickness of material, typically one of several, covering a surface or body".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.
Tiers represent the physical separation of the presentation, business, services, and data functionality of your design across separate computers and systems.
Layers are the logical groupings of the software components that make up the application or service. They help to differentiate between the different kinds of tasks performed by the components, making it easier to create a design that supports reusability of components. Each logical layer contains a number of discrete component types grouped into sublayers, with each sublayer performing a specific type of task.
The two-tier pattern represents a client and a server.
In this scenario, the client and server may exist on the same machine, or may be located on two different machines. Figure below, illustrates a common Web application scenario where the client interacts with a Web server located in the client tier. This tier contains the presentation layer logic and any required business layer logic. The Web application communicates with a separate machine that hosts the database tier, which contains the data layer logic.
Advantages of Layers and Tiers:
Layering helps you to maximize maintainability of the code, optimize the way that the application works when deployed in different ways, and provide a clear delineation between locations where certain technology or design decisions must be made.
Placing your layers on separate physical tiers can help performance by distributing the load across multiple servers. It can also help with security by segregating more sensitive components and layers onto different networks or on the Internet versus an intranet.
A 1-Tier application could be a 3-Layer application.
I like the below description from Microsoft Application Architecture Guide 2
A layer is a logical module of software with its own core logic and boundaries.
A tier is a physical container of one or more layers, such as a server across a network or multiple instances of the same Virtual Machine, working in a load-balanced way.
Source: Rockford Lhotka, Should all apps be n-tier?
Why always trying to use complex words?
A layer = a part of your code, if your application is a cake, this is a slice.
A tier = a physical machine, a server.
A tier hosts one or more layers.
Example of layers:
Tier:
Your code is hosted on a server = Your code is hosted on a tier.
Your code is hosted on 2 servers = Your code is hosted on 2 tiers.
For example, one machine hosting the Web Site itself (the Presentation layer), another machine more secured hosting all the more security sensitive code (real business code - business layer, database access layer, etc.).
There are so many benefits to implement a layered architecture. This is tricky and properly implementing a layered application takes time. If you have some, have a look at this post from Microsoft: http://msdn.microsoft.com/en-gb/library/ee658109.aspx