Monday, March 17, 2008

CST Architecture

First generation systems are 2-tiered architectures where a client presents a graphical user interface (GUI) to the user, and acts according to the user's actions to perform requests of a database server running on a different machine.
2-Tier Architectures
Client/server applications started with a simple, 2-tiered model consisting of a client and an application server. The most common implementation is a 'fat' client - 'thin' server architecture, placing application logic in the client. (Figure 1) The database simply reports the results of queries implemented via dynamic SQL using a call level interface (CLI) such as Microsoft's Open Database Connectivity (ODBC).

Figure 1. Traditional Fat Client/Server Deployment
An alternate approach is to use thin client - fat server waylays that invokes procedures stored at the database server. (Figure 2) The term thin client generally refers to user devices whose functionality is minimized, either to reduce the cost of ownership per desktop or to provide more user flexibility and mobility. In either case, presentation is handled exclusively by the client, processing is split between client and server, and data is stored on and accessed through the server. Remote database transport protocols such as SQL-Net are used to carry the transaction. The network 'footprint' is very large per query so that the effective bandwidth of the network, and thus the corresponding number of users who can effectively use the network, is reduced. Furthermore, network transaction size and query transaction speed is slowed by this heavy interaction. These architectures are not intended for mission critical applications.
Figure 2. Thin Client/Server Deployment
Development tools that generate 2-tiered fat client implementations include PowerBuilder, Delphi, Visual Basic, and Uniface. The fat server approach, using stored procedures is more effective in gaining performance, because the network footprint, although still heavy, is lighter than that of a fat client.
Advantages of 2-Tier System
Good application development speed
Most tools for 2-tier are very robust
Two-tier architectures work well in relatively homogeneous environments with fairly static business rules
A new generation of client/server implementation takes this a step further and adds a middle tier to achieve a '3-tier' architecture. Generally, client-server can be implemented in an 'N-tier' architecture where application logic is partitioned. This leads to faster network communications, greater reliability, and greater overall performance.
3-Tier Architectures
Enhancement of network performance is possible in the alternative 'N-tier' client-server architecture. Inserting a middle tier in between a client and server achieves a 3-tier configuration. The components of three-tiered architecture are divided into three layers: a presentation layer, functionality layer, and data layer, which must be logically separate. (Figure 3) The 3-tier architecture attempts to overcome some of the limitations of 2-tier schemes by separating presentation, processing, and data into separate distinct entities. The middle-tier servers are typically coded in a highly portable, non-proprietary language such as C. Middle-tier functionality servers may be multithreaded and can be accessed by multiple clients, even those from separate applications.
Figure 3. 3-Tiered Application Architecture
The client interacts with the middle tier via a standard protocol such as DLL, API, or RPC. The middle-tier interacts with the server via standard database protocols. The middle-tier contains most of the application logic, translating client calls into database queries and other actions, and translating data from the database into client data in return. If the middle tier is located on the same host as the database, it can be tightly bound to the database via an embedded 3gl interface. This yields a very highly controlled and high performance interaction, thus avoiding the costly processing and network overhead of SQL-Net, ODBC, or other CLIs. Furthermore, the middle tier can be distributed to a third host to gain processing power capability.
Advantages of 3-Tier Architecture
RPC calls provide greater overall system flexibility than SQL calls in 2-tier architectures
3-tier presentation client is not required to understand SQL. This allows firms to access legacy data, and simplifies the introduction of new data base technologies
Provides for more flexible resource allocation
Modularly designed middle-tier code modules can be reused by several applications
3-tier systems such as Open Software Foundation's Distributed Computing Environment (OSF/DCE) offers additional features to support distributed applications development
As more users access applications remotely for business-critical functions, the ability of servers to scale becomes the key determinant of end-to-end performance. There are several ways to address this ever-increasing load on servers. Three techniques are widely used:
Upsizing the servers
Deploying clustered servers
Partitioning server functions into a "tiered" arrangement
N-Tier Architectures
The 3-tier architecture can be extended to N-tiers when the middle tier provides connections to various types of services, integrating and coupling them to the client, and to each other. Partitioning the application logic among various hosts can also create an N-tiered system. Encapsulation of distributed functionality in such a manner provides significant advantages such as reusability, and thus reliability.
As applications become Web-oriented, Web server front ends can be used to offload the networking required to service user requests, providing more scalability and introducing points of functional optimization. In this architecture (Figure 4), the client sends HTTP requests for content and presents the responses provided by the application system. On receiving requests, the Web server either returns the content directly or passes it on to a specific application server. The application server might then run CGI scripts for dynamic content, parse database requests, or assemble formatted responses to client queries, accessing dates or files as needed from a back-end database server or a file server.
Figure 4. Web-Oriented N-Tiered Architecture
By segregating each function, system bottlenecks can be more easily identified and cleared by scaling the particular layer that is causing the bottleneck. For example, if the Web server layer is the bottleneck, multiple Web servers can be deployed, with an appropriate server load-balancing solution to ensure effective load balancing across the servers (Figure 5).
Figure 5. Four-Tiered Architecture with Server Load Balancing
The N-tiered approach has several benefits:
Different aspects of the application can be developed and rolled out independently
Servers can be optimized separately for database and application server functions
Servers can be sized appropriately for the requirements of each tier of the architecture
More overall server horsepower can be deployed
The client's responsibility is usually to:
Handle the user interface.
Translate the user's request into the desired protocol.
Send the request to the server.
Wait for the server's response.
Translate the response into "human-readable" results.
Present the results to the user.
The server's functions include:
Listen for a client's query.
Process that query.
Return the results back to the client.
A typical client/server interaction goes like this:
The user runs client software to create a query.
The client connects to the server.
The client sends the query to the server.
The server analyzes the query.
The server computes the results of the query.
The server sends the results to the client.
The client presents the results to the user.
Repeat as necessary.
A typical client/server interaction
This client/server interaction is a lot like going to a French restaurant. At the restaurant, you (the user) are presented with a menu of choices by the waiter (the client). After making your selections, the waiter takes note of your choices, translates them into French, and presents them to the French chef (the server) in the kitchen. After the chef prepares your meal, the waiter returns with your diner (the results). Hopefully, the waiter returns with the items you selected, but not always; sometimes things get "lost in the translation."
Flexible user interface development is the most obvious advantage of client/server computing. It is possible to create an interface that is independent of the server hosting the data. Therefore, the user interface of a client/server application can be written on a Macintosh and the server can be written on a mainframe. Clients could be also written for DOS- or UNIX-based computers. This allows information to be stored in a central server and disseminated to different types of remote computers. Since the user interface is the responsibility of the client, the server has more computing resources to spend on analyzing queries and disseminating information. This is another major advantage of client/server computing; it tends to use the strengths of divergent computing platforms to create more powerful applications. Although its computing and storage capabilities are dwarfed by those of the mainframe, there is no reason why a Macintosh could not be used as a server for less demanding applications.
In short, client/server computing provides a mechanism for disparate computers to cooperate on a single computing task.

The Evolution of Client/Server Computing

The Evolution of Client/Server Computing
Several years ago, many computing environments consisted of mainframes hooked to dumb terminals that only did processing at the mainframe. Over the years, personal computers started to replace these dumb terminals but the processing continued to be done on the mainframe. The improved capacity of personal computers were largely ignored or used on an individual level. With so much computing power idle, many organizations started thinking about sharing, or splitting, some of the processing demands between the mainframe and the PC. Client/server technology evolved out of this movement for greater computing control and more computing value.
Client/server refers to the way in which software components interact to form a system that can be designed for multiple users. This technology is a computing architecture that forms a composite system allowing distributed computation, analysis, and presentation between PCs and one or more larger computers on a network. Each function of an application resides on the computer most capable of managing that particular function. There is no requirement that the client and server must reside on the same machine. In practice, it is quite common to place a server at one site in a local area network (LAN) and the clients at the other sites. The client, a PC or workstation, is the requesting machine and the server, a LAN file server, mini or mainframe, is the supplying machine. Clients may be running on heterogeneous operating systems and networks to make queries to the server(s).
Networks provide connectivity between client/server and the protocols that they use to communicate. The Internet provides connectivity between systems that function as clients, servers, or both. Many services used on the Internet are based on client/server computing model. File Transfer Protocol (FTP) for example uses client/server interactions to exchange files between systems. An FTP client requests a file that resides on another system. An FTP server on the system where the file resides handles the client’s request. The server gets access to the file and sends the file back to the client’s system. Market researchers have projected enormous growth in the client/server area. This growth seems to have come at the expense of the mainframe market, which has stagnated. While the movement towards migrating from the mainframe to client/server architecture is gaining momentum, there are several distinct drawbacks since most of the client/server tools and methodologies are not in place and the associated administration support is still undefined.

Characteristics of Client and Server

Characteristics
Characteristics of a client
Request sender is known as client
Initiates requests
Waits for and receives replies.
Usually connects to a small number of servers at one time
Typically interacts directly with end-users using a graphical user interface
Characteristics of a server
Receiver of request which is sent by client is known as server
Passive (slave)
Waits for requests from clients
Upon receipt of requests, processes them and then serves replies
Usually accepts connections from a large number of clients
Typically does not interact directly with end-users
Advantages
In most cases, a client-server architecture enables the roles and responsibilities of a computing system to be distributed among several independent computers that are known to each other only through a network. This creates an additional advantage to this architecture: greater ease of maintenance. For example, it is possible to replace, repair, upgrade, or even relocate a server while its clients remain both unaware and unaffected by that change. This independence from change is also referred to as encapsulation.
All the data is stored on the servers, which generally have far greater security controls than most clients. Servers can better control access and resources, to guarantee that only those clients with the appropriate permissions may access and change data.
Since data storage is centralized, updates to those data are far easier to administer than would be possible under a P2P paradigm. Under a P2P architecture, data updates may need to be distributed and applied to each "peer" in the network, which is both time-consuming and error-prone, as there can be thousands or even millions of peers.
Many mature client-server technologies are already available which were designed to ensure security, 'friendliness' of the user interface, and ease of use.
It functions with multiple different clients of different capabilities.
Disadvantages
Traffic congestion on the network has been an issue since the inception of the client-server paradigm. As the number of simultaneous client requests to a given server increases, the server can become severely overloaded. Contrast that to a P2P network, where its bandwidth actually increases as more nodes are added, since the P2P network's overall bandwidth can be roughly computed as the sum of the bandwidths of every node in that network.
The client-server paradigm lacks the robustness of a good P2P network. Under client-server, should a critical server fail, clients’ requests cannot be fulfilled. In P2P networks, resources are usually distributed among many nodes. Even if one or more nodes depart and abandon a downloading file, for example, the remaining nodes should still have the data needed to complete the download.
Examples
Imagine you are visiting an e-commerce web site. In this case, your computer and web browser would be considered the client, while the computers, databases, and applications that make up the online store would be considered the server. When your web browser requests specific information from the online store, the server finds all of the data in the database needed to satisfy the browser's request, assembles that data into a web page, and transmits that page back to your web browser for you to view.
Specific types of clients include web browsers, email clients, and online chat clients.
Specific types of servers include web servers, ftp servers, application servers, database servers, mail servers, file servers, print servers, and terminal servers. Most web services are also types of servers

Client/Server

Client-server is a computing architecture which separates a client from a server, and is almost always implemented over a computer network. Each client or server connected to a network can also be referred to as a node. The most basic type of client-server architecture employs only two types of nodes: clients and servers. This type of architecture is sometimes referred to as two-tier. It allows devices to share files and resources.
Each instance of the client software can send data requests to one or more connected servers. In turn, the servers can accept these requests, process them, and return the requested information to the client. Although this concept can be applied for a variety of reasons to many different kinds of applications, the architecture remains fundamentally the same.
These days, clients are most often web browsers, although that has not always been the case. Servers typically include web servers, database servers and mail servers. Online gaming is usually client-server too. In the specific case of MMORPG, the servers are typically operated by the company selling the game; for other games one of the players will act as the host by setting his game in server mode.
The interaction between client and server is often described using sequence diagrams. Sequence diagrams are standardized in the Unified Modeling Language.
When both the client- and server-software are running on the same computer, this is called a single seat setup.

What is Client server

Client/Server
Client/server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request. Although the client/server idea can be used by programs within a single computer, it is a more important idea in a network. In a network, the client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations. Computer transactions using the client/server model are very common. For example, to check your bank account from your computer, a client program in your computer forwards your request to a server program at the bank. That program may in turn forward the request to its own client program that sends a request to a database server at another bank computer to retrieve your account balance. The balance is returned back to the bank data client, which in turn serves it back to the client in your personal computer, which displays the information for you.
The client/server model has become one of the central ideas of network computing. Most business applications being written today use the client/server model. So does the Internet's main program, TCP/IP. In marketing, the term has been used to distinguish distributed computing by smaller dispersed computers from the "monolithic" centralized computing of mainframe computers. But this distinction has largely disappeared as mainframes and their applications have also turned to the client/server model and become part of network computing.
In the usual client/server model, one server, sometimes called a daemon, is activated and awaits client requests. Typically, multiple client programs share the services of a common server program. Both client programs and server programs are often part of a larger program or application. Relative to the Internet, your Web browser is a client program that requests services (the sending of Web pages or files) from a Web server (which technically is called a Hypertext Transport Protocol or HTTP server) in another computer somewhere on the Internet. Similarly, your computer with TCP/IP installed allows you to make client requests for files from File Transfer Protocol (FTP) servers in other computers on the Internet.
Other program relationship models included master/slave, with one program being in charge of all other programs, and peer-to-peer, with either of two programs able to initiate a transaction.