Using a Multi-Tiered Architecture

From RAD Studio
Jump to: navigation, search

Go Up to Connecting to Another Dataset

When the database information includes complicated relationships between several tables, or when the number of clients grows, you may want to use a multi-tiered application. Multi-tiered applications have middle tiers between the client application and database server. The architecture for this is illustrated in the following figure.


The preceding figure represents a three-tiered application. The logic that manipulates database information is on a separate system, or tier. This middle tier centralizes the logic that governs your database interactions, so there is centralized control over data relationships. This allows different client applications to use the same data, while ensuring consistent data logic. It also allows for smaller client applications, because much of the processing is off-loaded onto the middle tier. These smaller client applications are easier to install, configure, and maintain. Multi-tiered applications can also improve performance by spreading data-processing over several systems.

The multi-tiered architecture is very similar to the model described in Connecting a client dataset to another dataset in the same application. It differs mainly in that source dataset that connects to the database server and the provider that acts as an intermediary between that source dataset and the client dataset have both moved to a separate application. That separate application is called the application server (or sometimes the "remote data broker").

Because the provider has moved to a separate application, the client dataset can no longer connect to the source dataset by simply setting its ProviderName property. In addition, it must use some type of connection component to locate and connect to the application server.

There are several types of connection components that can connect a client dataset to an application server. They are all descendants of Datasnap.DBClient.TCustomRemoteServer, and differ primarily in the communication protocol they use (TCP/IP, HTTP, DCOM, or SOAP ). Link the client dataset to its connection component by setting the RemoteServer property.

The connection component establishes a connection to the application server and returns an interface that the client dataset uses to call the provider specified by its ProviderName property. Each time the client dataset calls the application server, it passes the value of ProviderName, and the application server forwards the call to the provider.

For more information about connecting a client dataset to an application server, see Creating multi-tiered applications

See Also