This post hasn't been updated for 3 years
Distributed architecture has been used for a long time ago. Let 's imagine that we have to solve many tasks and our machine is not enough resources. At that time, we should use distributed architecture. In a distributed architecture, components are hosted on different platforms and communicate through a network. The popular architecture is server-client. It is easy to deploy at first, but is difficult to upgrade or enhance, and is usually based on proprietary protocols -- typically proprietary database protocols. It also makes reuse of business and presentation logic difficult, if not impossible. To Address that issue, we have concept multier architecture (often referred to as n-tier architecture). In basically, It is a client–server architecture in which presentation, application processing, and data management functions are physically separated. We have heard about N-Tier architecture and N-Layer architecture before. But N-Tier and N-Layer are entirely different concepts. N-Tier refers to the actual n system components of your application. On the other hand, N-Layers refer to the internal architecture of your component. We can recognize the diffrence between the architectures via image below: In this post, we focus on N-tier architecture. N-tier application achitecture provides a model by which developers can create flexible and reusable applications. The most popular architecture is used is Three-tier architecture. It is typically composed of a presentation tier, a domain logic tier, and a data storage tier. Depend on your platform, the three-tier can be implemented in another ways. however you implement it, the meaning of three-tire 's components are not changed.
- 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 which users can access directly (such as a web page, or an operating system's GUI). We have known about MVC pattern. It can be used in this tire. In the same way, android application or ios application is located in presentation tier.
- Application tier (business logic, logic tier, or middle tier) The logical tier is pulled out from the presentation tier and, as its own 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 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.
In .Net, N-tier data applications are data applications that are separated into multiple tiers. In place of Application of tire, It has Middle-Tire. Middle-Tire includes Bussiness Logic layer, Data Access layer, Common Application Services. We can see that image below:
In J2EE, n-tier is implemented in another way. In this image, title client represents for presentation tier. Presentation Logic and Bussiness Login present for Application tier. They control client via RMI API. In Presentation Logic, web pages is created by JSP file. Client does not access to database directly. We accomplish that Bussiness Login will communicate with backend-system (Data tire) to retrieve data. And after that, the data is response to Presentation tier via Bussiness Logic tier.
All Rights Reserved