-2

From Distributed Systems by Coulouris:

Tiered architectures are complementary to layering. Whereas layering deals with the vertical organization of services into layers of abstraction, tiering is a technique to organize functionality of a given layer and place this functionality into appropriate servers and, as a secondary consideration, on to physical nodes.

Let us first examine the concepts of two- and three-tiered architecture. To illustrate this, consider the functional decomposition of a given application, as follows:

  • the presentation logic, which is concerned with handling user interaction and updating the view of the application as presented to the user;

  • the application logic, which is concerned with the detailed application-specific processing associated with the application (also referred to as the business logic, although the concept is not limited only to business applications);

  • the data logic, which is concerned with the persistent storage of the application, typically in a database management system.

Now, let us consider the implementation of such an application using client-server technology. The associated two-tier and three-tier solutions are presented together for comparison in Figure 2.8 (a) and (b), respectively.

In the two-tier solution, the three aspects mentioned above must be partitioned into two processes, the client and the server. This is most commonly done by splitting the application logic, with some residing in the client and the remainder in the server (although other solutions are also possible). The advantage of this scheme is low latency in terms of interaction, with only one exchange of messages to invoke an operation. The disadvantage is the splitting of application logic across a process boundary, with the consequent restriction on which parts of the logic can be directly invoked from which other part.

In the three-tier solution, there is a one-to-one mapping from logical elements to physical servers and hence, for example, the application logic is held in one place, which in turn can enhance maintainability of the software. Each tier also has a well-defined role; for example, the third tier is simply a database offering a (potentially standardized) relational service interface. The first tier can also be a simple user interface allowing intrinsic support for thin clients (as discussed below). The drawbacks are the added complexity of managing three servers and also the added network traffic and latency associated with each operation.

enter image description here

In figure a), supposedly for two tier solution

  • On client side, what is there "data manipulation" with each "view and control"? Does it belong to presentation logic, application logic, or data logic?

  • On server side, why is there "data management" with each "application"? Does each "data management" mean a database management system, so there are four database management systems? Do all the database management systems have to keep their databases consistent with each other?

  • Why does the server have two "application and data management"s, instead of one? Are there two independent applications?

  • Do two "application and data management"s share a database system as in b)

  • The quote says "in the two-tier solution, the three aspects mentioned above must be partitioned into two processes, the client and the server. This is most commonly done by splitting the application logic, with some residing in the client and the remainder in the server (although other solutions are also possible)." What is partitioned into client and server in the figure? Is the application logic split between client and server in the figure? If not, is "data management" split between client and server in the figure?

In figure b)

  • Why does the server have two "application logic"s, instead of one?
2
  • I suspect that the circles represent code modules, meaning that e.g. the server has a separate application logic module for each set of "user view and controls". Dec 6, 2019 at 17:01
  • 1
    In the first diagram, it says 'data manipulation', not 'data management' on the left side. In general, the diagrams are meant to be conceptual. I think you are interpreting this too concretely.
    – JimmyJames
    Dec 6, 2019 at 17:08

1 Answer 1

0

Let me take a couple things out of the way:

  • Different tiers can share a machine or be in different machines. However, tier is usually coupled into in such way that it cannot be split into multiple machines.
  • "Data manipulation" means doing operations on the data. "Data management" means indexing, storing and recovering from permanent storage.

Now...

  • On client side, what is there "data manipulation" with each "view and control"? Does it belong to presentation logic, application logic, or data logic?

No data logic here. This is presentation logic, and some application logic. As you quote, the application logic is often split between the two tiers. Data manipulation may contain application logic.

  • On server side, why is there "data management" with each "application"? Does each "data management" mean a database management system, so there are four database management systems? Do all the database management systems have to keep their databases consistent with each other?

  • Why does the server have two "application and data management"s, instead of one? Are there two independent applications?

From what I remember from working with 2 tier systems, they could mean that there is a schema/database per user. They are not being synchronized, they are not replicas. Instead, each user will have full※ control over their own and some permissions over the others, often only to query/read.

※: Well, not necessarily full control. Changing the structure could be a privilege reserved by a DBA. In fact, I would expect each schema to be a copy of the same structure, although with different data.

  • Do two "application and data management"s share a database system as in b)

They are on the same database engine. There is a logical separation between them.

  • The quote says "in the two-tier solution, the three aspects mentioned above must be partitioned into two processes, the client and the server. This is most commonly done by splitting the application logic, with some residing in the client and the remainder in the server (although other solutions are also possible)." What is partitioned into client and server in the figure? Is the application logic split between client and server in the figure? If not, is "data management" split between client and server in the figure?

I do not think the figure specifies how application logic is distributed. It could be all in the server, all in the client, or split.

Why does the server have two "application logic"s, instead of one?

Please think in terms of sessions. It will be easier to understand...

Below is my explanation of the figures.


On both figures, on the Tier 1, you have the client machines. There is only one session, which belongs to the user of that machine.

Now, on both figures, on the tier 2, we have a single server. Yet each user has a session. The session have states that are isolated from each other.

On the 2 tier system, the server is both an application and database server. And, no, I do not mean that there is an application server that connects to a database engine, and they are both on the same machine (those would be two separate tiers on the same machine), I mean that the application and database server are the same software.

What kind of software can be both application and database server? A database engine. That is, you can encode application logic in database constraints, stored procedures, triggers, etc... and use that from a client.

Think about this: you can have a desktop client that connects directly to a database server... either you put all the application logic on the desktop client, put it all in the database server, or split between both. Sounds familiar? In this scenario, the client would often query information, transform it in some way, and then update on the server. That is, "data manipulation".

Of course, you do not want to store the database credentials on the desktop application, otherwise anybody could take them and use them to connect to the database and do whatever... instead, you make the application user the database user. That is, when the user logs in, the credentials the user provides are the database credentials. Application authentication consist of trying to authenticate on the database.

Finally, on the 3 tier system, your application server can keep the database credentials. This is safe, since it does not have the problem of being on the client machine. It does not have the problem of manipulating data on the client machine either.

Now the application server only needs one database user. Thus, there is only one single database session. This time the application users can be kept in a table in the database instead of being database users. And the application developers need to care about how to properly store passwords (hint: don't, you store a hash instead), and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.