What's the difference between multi-layer and multi-tier applications? One depends on the other?
What's the difference between multi-layer and multi-tier applications? One depends on the other?
People usually interchange the two terms to describe the same architecture as multi-layered and multi-tiered, simultaneously. This is not exactly true.
Adapting the distinction made by App Arch Guide , layers refers to the component-type, the logical of the Application, while tiers (2-tier, 3-tier, N-tier) refer to the physical distribution of the patterns. It is particularly easy to understand when speaking where (in which tier ) your layer will be executed.
Although there are variations in terms used, many people who build Applications identify the Presentation Layer, Business Layer, and Date Layer (Data Access). A picture is worth a thousand words, then:
Asmentioned,tiersarethephysicalrepresentationsofthepatternstobedistributed.It'snouserepeatingifitdoesnotmakepracticalsense,solet'slookatthemostcommonpatternstranslatedintoimages:
2-tiers
I researched a little bit and the most sensible definition I've come to concerns Intranets, where the Application needs to be installed on each Station and all of them individually communicate with a single server.
As an advantage we have the ease of understanding the architecture. But as disadvantages we have, apart from the inconvenience of individuality in this case, we are slow when many Stations are operating the Application simultaneously.
3-tiers
Themostcommon,popularizedbyMVC,definesthepresentationlayeronlytodefinethevisualelementsthroughwhichtheApplicationwillbeoperated.
The"middle" layer more quickly interposes the requests made by the User with the third layer data where the data resides.
Note the distinction between where resides the data and data itself, reinforcing the difference between layer in> tier (physics) dictated above.
N-tier
Themostdifficulttodescribeinoneexample,butIwouldsayServiceAuthenticationfitsright.
YoudecidethatyouwanttoauthenticatetoStackOverflowPTwithyourGoogleaccount,theApplicationcommunicateswiththeGoogleAuthservice,itreturnstotheApplicationBusinessRulesthatusestheauthenticatedemailaddressasconditionalfortheanswersandcommentsmade.
Original article: J. D. Meier
Translation and Adaptation: A stranger named Bruno Augusto: P
Response brought in SOEN ( link )
Layers is a way to organize your code. Typically, layers include, presentation, business, data, which is basically the concept of 3 layers. But layer does not mean it's another process, computer, cluster. Layers are logical divisions of the code of agreement with their functions.
Tiers however this is where the code executes. Tiers are the locations where Layers are placed and where they rotate. Tier is therefore the deploy physical where Layers run.
I did not translate the terms because in Portuguese everything is called layers. But in short, Layers are logical layers and Tier physical layers .