Designing a ClientServer System

Client/Server Systems

When implementing a client/server database system, there are various options for assigning processing responsibilities of the client and server. The types of systems include:
  • Intelligent clients
  • Intelligent servers
  • Mixed systems
  • Multitier systems

The appropriate implementation scheme should be based on:

  • Network traffic.
  • Client and server resources
  • Database performance

Intelligent Clients

A common method for deploying a client/server application is to use intelligent clients. Intelligent clients allow both the business logic and presentation services to run on the client.

click to view at full size.

Figure 6.7 Business logic located on the client

In this implementation, the server acts only as a database. Processing is performed locally to free server resources. Many applications written using Visual Basic are intelligent clients.

Advantages of Intelligent Clients

Advantages of the intelligent client implementation include:
  • The architecture is relatively simple, which makes development and maintenance easier.
  • The tools that exist to support it, such as Visual Basic 5.0, are powerful and well established.
  • The client is a good place to store "state" information associated with the user, such as the primary key of the record that the user is currently viewing.
Disadvantages of Intelligent Clients Intelligent clients have several disadvantages:
  • Placing business services on the client may create more network traffic because data has to be moved to the client before decisions coded into the business logic can be made.
  • The business logic can only be modified redeploying all the clients.

Intelligent Servers

Moving all business rules to a SQL Server as stored procedures creates what is called an intelligent server . That is, the server in a client/server system is more than a file repository in which multiple users share file sectors over a network. Client/server servers are intelligent, because they carry out commands in the form of SQL queries and return answers in the form of result sets.

click to view at full size.

Figure 6.8 Business logic located on a central server

In a two- tier implementation with an intelligent server, business logic and presentation services are deployed from the server database. In this implementation, business logic is generally written as stored procedures and triggers within the database. The bulk of the processing is done at the server level rather than on the client machine.

Advantages of Intelligent Servers

Advantages of the intelligent server implementation include:
  • Improved performance. The business logic runs in the same process space as the database access code and is tightly integrated into the data-searching engine of a SQL Server. This means that data does not have to be moved or copied before it is operated on, so network traffic is minimized.
  • Data integrity can be enforced more effectively on the server.
  • When necessary, the business logic can be updated in a single location. Individual clients do not need to be updated.
Disadvantages of Intelligent Servers Disadvantages of the intelligent server implementation include:
  • Demand for server resources can get heavy because all the requests and data manipulations are run on the server.
  • You have a limited choice of development tools. Stored procedures, for example, are written in Transact-SQL. SQL Server supports server calls to code written in languages other than Transact-SQL, but doing this adds complexity and is generally not as efficient as writing the same functions in Transact-SQL.

Mixed Systems

Under a two-tier implementation you can implement a mixed solution that takes advantage of both an intelligent server and intelligent clients. For example, in a mixed solution a Visual Basic application can call a stored procedure on a SQL Server that also has local business logic.

click to view at full size.

Figure 6.9 Mixed systems utilize intelligent clients and intelligent servers

Advantages of Mixed Systems

Advantages of the mixed system implementation include:
  • Client applications can leverage business logic where appropriate.
  • Server-side code (such as SQL Server stored procedures) can be reused across multiple client applications, lowering the costs associated with recoding queries.
  • Client applications can implement functionality without crossing a crowded network for their data.
Disadvantages of Mixed Systems Disadvantages of the mixed system implementation include:
  • Business logic is spread across both the client and the server.
  • You may have to distribute new versions of the client application to a wide audience.

Multi-tier Solutions

A multitier system, which is sometimes called a three-tier system, allows the user interface, business rules, and database to reside separately.

click to view at full size.

Figure 6.10 User interface, business rules, and database reside separately

When developing a multitier system, you can build intelligent clients with business rules that have been compiled into stand-alone DLLs. These DLLs can be written in Visual Basic and reside on a server. The client, DLL, and database constitute a "service" in a multitier system.

Services

A service is a collection of related features that respond to requests for specific activities and/or yield information based on a specified interface and behavior. A service is accessed through a consistent interface that encapsulates its implementation.

The service model is a way of viewing an application as a set of features or services that are used to fill consumer requests. By encouraging the developer to model an application as a collection of discrete services, features and functionality can be packaged for reuse, shared among multiple applications, and distributed across network boundaries.

Service Types

Three categories of services exist in typical business applications. Each has its own attributes, as the following table shows.
Service Type Service Location Service Attribute
User Services Client Presentation of information and functionality, navigation, and protection of user interface consistency and integrity.
Business Services Server Shared business policies, generation of business information from data, and protection of business integrity.
Data Services Server Definition of data, storage and retrieval of persistent data, and protection of data integrity.

Advantages of Multitiered Systems

Advantages of multitiered systems include:
  • Separation of interface, business rules, and data storage components .
  • The ability to implement intelligent clients.
  • The ability to implement services.
Disadvantages of Multitiered Systems Disadvantages of multitiered systems include:
  • A server and network are required.
  • Network traffic is increased.

Lesson Summary

The client/server architecture defines specific responsibilities for both the client and the server, making this model a popular choice for enterprise systems. Four design stages are used to create an optimized database system: conceptual, logical, physical, and future. Options for assigning processing responsibilities of the client/server include:
  • Intelligent client
  • Intelligent server
  • Mixed systems
  • Multitiered systems


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net