“客户-服务器”到底是什么意思?(第一部分)
What Does“Client-Server” Really Mean? (Part I)
1. Introduction
介绍
As computer professionals, we all must cope with a never-ending streamof new technology. Along with the introduction of each new technology comes a dizzying array of matching terminology. We use (or abuse) themany technical terms to the point that they begin to take on the quality of a “buzzword”, that is, a word orphrase frequently heard but seldom understood.
作为计算机专业人士,我们都必须面对源源不断的新技术。
新技术的引入会带来一系列令人目眩的相应术语。我们使用(或滥用)许多技术术语到如此程度,致使他们开始重视“时髦用词”的质量,也就是那些经常听说却很少理解的词或短语。
“Client-server” is one term that hasfulfilled its potential for becoming an industry buzzword. This isunfortunate; the term “client-server” has a lot of relevance to today’snetworks.
作为一个行业术语来说,“客户-服务器”已经发挥出了它的潜力。这是不幸的;“客户端-服务器”一词与当今的网络有很大的关联。
Part of the difficulty with understandingthe term is that it takes on different meanings or connotations, depending uponwho is doing the defining. In a very general sense, the term client-serverreally denotes a type of relationship between entities. The entities we willdiscuss, of course, are software applications running on networked computersystems. There are many such types of possible relationships
(such as a hierarchy) between multipleentities, but we will only examine two here: “peer-to-peer” and“client-server”. Let’s take a short look at one of those relationships,“peer-to-peer”, that will help us when welook more closely at a client-server relationship.
理解这个术语的部分困难在于它具有不同的含义或内涵,而且还取决于谁在做出这个定义。在一个非常通俗的意义上,客户端服务器这个术语其实表示实体之间的某种关系。当然,我们将要讨论的这些实体就是运行在网络计算机上的应用软件。这种实体间的关联关系有很多可能性(如层次结构)。但是,我们在这里将会只讨论其中的两种:“点对点”和“客户端服务器”。让我们来简单看一下其中之一,“点对点”,这将有助于我们更仔细地研究客户端-服务器的关系。
2. Examining a“Peer-to-Peer” Relationship
审视”点对点”关系
In a peer-to-peer relationship, allentities have equal standing with one another, and all are equally capable ofrunning the same set of ervices. In manyways, this relationship is the easiest type to recognize, configure, and manage.This does not mean that it is necessarily the most efficient or cost-effectiveway of allocating computer resources.
在点对点关系中,所有实体彼此之间拥有平等的地位,
所有的实体对于同一系列服务都拥有同等的运行能力。从许多方面来考量,这种关系都是最容易识别、配置和管理的。
不过,这并不意味着,它在计算机资源的分配上就一定是最有效和最划算的方法。
In peer-to-peer configuration, all of the individualsystems are configured (more or less) alike. They have relatively equal amountsof resources (e.g., disk, memory, and CPU power), and all resources are equallyshared among the various systems in the group. Each machine is completelycapable of performing any task that a particular user may desire, without theinvolvement of, or reliance on, another system’s resources.
在点对点配置中,所有的个体系统都配置(或多或少)相同。它们分别拥有相对等量的大量资源(例如磁盘,内存和CPU电源),并且所有资源在组中各系统间都被平等地共享。每台机器都完全能够胜任任何特定用户可能需求的功能,并且不需要依赖其他的系统资源的参与。
Figure 6B-1: Hardware resources in apeer-to-peer computer relationship
图6B-1:点对点计算机关系中的硬件资源
Figure 6B-1 depicts a network of computersystems configured in a peer-to-peer manner. Every computer has the samehardware resources—disk, RAM, and CPU—as well as the same software configurationin terms of operating system and applications. Because the machines are allsimilarly configured, a user who is running a word-processing application usesfar less of the local resources than a user that might be doing a thermal analysisof a circuit board. In the first case, there are very probably underutilizedresources, such as RAM, CPU cycles, or hardware graphics acceleration. In thesecond case, the local resources are more likely to be fully utilized, possiblyeven overutilized.
图6B-1描述了一个以点对点方式配置的计算机系统网络。每台计算机具有相同的硬件资源磁盘、RAM和CPU,以及在操作系统和应用方面相同的软件配置。因为机器的配置都是相同的,一个运行文字处理应用程序的用户比一个正在进行电路分析的用户使用的本地资源要少得多。在第一种情况下,极有可能资源未被充分利用,例如RAM、CPU周期或硬件图形加速。在第二种情况下,本地资源更有可能被充分利用,甚至超负荷利用。
Underutilization of resources is common in a peer-to-peernetwork where there are multiple applications types being used. Theunderutilization of resources on some systems, along with full oroverutilization on others can mean that some users are not able to get theirtasks completed in the optimum amount oftime, while others may have no difficulties. Here is an example of howmisallocation of resources in a networked environment can actually cost money.
在使用多种应用程序类型的点对点网络中资源的利用不充分是常见的。在一些系统资源未被充分利用的同时有一些系统的资源被充分利用或超负荷利用,这就意味着,在最佳的时间量里,有些用户无法完成他们的工作,而其他一些则毫无压力可言。这是一个例子,来说明网络环境中资源的错误配置其实是要花钱的。
3. The Client-Server Relationship
客户服务器关系
In a client-server relationship, there areat least two types of logical entities involved: the client entity and theserver entity.
It is important tonote at this point that the term client-server may be applied either tohardware (computer system) or to software (applications) running on thehardware. This is one potential point of confusion, as the hardware may be configureddifferently to run the client software or the server software, but does notnecessarily have to be.
在客户端-服务器关系中,至少涉及到两种类型的逻辑实体:客户端实体和服务器实体。这一点值得注意,术语客户端-服务器既可以应用于硬件(计算机系统)也可以应用于运行在硬件系统上的软件(应用程序)。这也许是一个容易混淆的点,运行客户端软件和服务器端的软件的硬件配置不同,但又不是必须不同。
In the case ofsoftware entities, it is possible that both client and server may exist on thesame computer system or be split across multiple systems in the network. Howthe actual tasks that an application performs are split between the client andthe server entities will vary, usually determined by the application’sdesigner.
就软件实体来说,客户端和服务器既可以存在于同一台电脑系统中,也可以分割分布于网络上的众多系统中。应用程序执行的实际任务是如何拆分的,在客户端和服务器之间会有所不同,这通常取决于应用程序的设计者。
Figure 6B-2:Hardware resources in a client-server computer relationship
客户端-服务器计算机关系中的硬件资源
不同于点对点环境,客户端-服务器关系实体之间并不具有相同的能力。服务器实体“拥有”且管理着一系列定义良好的代表用户或用户群利益的资源。客户端-服务器模型也可以被描述为“请求-响应”式交互。为了使用资源,客户端必须向服务器实体发出请求。服务器则对于用户的资源请求做出响应或给出相应服务。由于客户端-服务器关系是逻辑关系,应用软件的客户端和服务器运行在同一个基础硬件上也毫无障碍。
Figure 6B-2 showsan environment that has resources unequally
distributedbetween client and server machines. You can think of the system resources asbeing water in a set of buckets associated with each system; in this examplethere are buckets for RAM, CPU cycles, and disk storage. Resources are movedfrom the client system’s buckets and reapportioned to the resource bucketbelonging to a server or group of servers in the
network.
图6B-2展示一个在客户端和服务器之间资源分布不均衡的环境。你可以把系统资源想象成水,装在和每个系统相关的一些桶里;在这个例子中,有RAM桶、CPU周期桶和磁盘存储桶。资源从客户端系统的桶中移出,并重新分配给网络上的服务器或服务器群的资源桶。
In this type ofenvironment, there are usually N clients to each server, with the serverproviding all of the services associated with its resource to multiple clients.The client-server relationship may be thought of as a many-to-one relationship.The number of clients that a server can handle depends on several factors, includingthe type of resource being managed, the number of total simultaneous requests,and the request frequency from each client.
在这种类型的环境中,N个客户端通常对应着每个服务器,服务器为多个客户端提供所有的与其资源相关联的服务。客户端-服务器关系可以看成是多对一的关系。服务器可以承受的客户端数量取决于一个因素,包括被其管理的资源类型、并发请求数量和每一个客户端的请求频率。
One of thedefining characteristics of today’s client-server applications is the presenceof a network connection between the client and the server, so another importantperformance factor is the type of connection between the client and the serverand its relative “health”. Obviously a poor network connection can influenceclients and servers communicating across the network.
当今客户端-服务器应用的定义特征之一是客户端和服务器之间的网络连接的存在。所以,另一个重要的性能因素是客户端和服务器之间的连接类型和它的相对性“健康”。很显然,糟糕的网络连接,会影响客户端和服务器通过网络进行的通信。
4. Client-Server Application Configurationsand Components
客户端-服务器应用配置和组件
Within the termclient-server, there are many possible application configurations. Theconfiguration of a client-server architecture is determined by where theassociated application is broken into separate components. At the most basiclevel, the application may be split into several different components: thegraphical user interface (presentation logic), application logic, and datamanagement logic.
在客户端-服务器这个术语的范畴里,有很多可能的应用配置。
客户端-服务器结构的配置是由关联应用被分解成单独的组件的地方决定的。在最基本的层次上,应用程序可以分成几个不同的组成部分:图形用户界面(表示逻辑),应用逻辑和数据管理逻辑。
It is possible toinsert distribution services between any, all, or none of the three basiccomponents. In the latter case, you end up with the familiar “monolithic” application configuration,running on a single system. With distribution services inserted, the result isa client-server application. This is diagrammed in Figure 6B-3.
可以在这三个基本组件之间或之外任意插入分布服务。在后一种情况下,最后,你会得到熟悉的“单片”应用程序配置,
在单一系统上运行。通过插入分布服务,会得到一个客户端-服务器应用程序。如图6B-3所示。
Sometimesidentifying a client-server relationship is difficult because the system beingstudied is a hybrid design. Under these circumstances, there may be multiplelevels of client-server relationships, or a single level where one client mayin turn be a server to other clients. There are some commonly encounteredclient-server configurations which involve more complicated physicaldistributions of the application components and some more complicatedinteractions between those components. Some examples are shown in Figure 6B-4.
有时识别出客户端-服务器关系是有些难度的,因为正在研究的系统可能是个混合设计。在这种情况下,可能存在多个层级的客户端-服务器关系,或也许是其中每一个客户端依次当做其他客户端的服务器单一层级。有些常见的客户端-服务器配置涉及应用组件的更复杂的物理分布和这些组件间的一些更复杂的交互。一些例子如图6B-4所示。
Combinationsinvolving other relationship models are possible, based on the whims of theapplication designers. For these reasons, and others, there may not be a cleandistinction in hybrid system designs or systems that are in transition betweenthe client-server model and other configurations. We will try to stick to theclearly identifiable cases, and you should avoid designing such complicatedrelationships if at all possible.
基于应用设计者异想天开的涉及其他关系模型的组合是可能的。由于这样或那样的原因,在客户端-服务器模型和其他配置过渡之间的混合系统设计或混合系统,可能没有清晰地区别。我们将努力坚持清晰可辨的例子,而你也要尽最大可能地避免设计如此复杂的关系。
5. Client-Server Distribution Services
客户端-服务器分布式服务
While describingthe client-server application architecture, we did not venture beyond theconceptual description of the application being split into components and“glued” together with “distribution services”. Examining the availabledistribution services in an environment is an important aspect of both gooddesign and analysis. If the necessary services are not available or reliable,client-server applications may quite literally fall apart1.
在描述客户端-服务器应用程序体系结构时,我们没有冒险超越分割成组件又被“分布式服务”“粘合”在一起的应用程序的概念描述。审视可用的分布式服务,对一个环境的设计和分析都是很重要的一个方面。如果必须的服务不可用或不可靠,客户端-服务器应用程序可能完全崩溃。
Figure 6B-4:Examples of client-server physical distribution models
图6B-4:客户端-服务器物理分布模型的示例
The term“distribution services” is a very general label. The services used to allowdistribution of client-server application components include: remote procedurecall facilities (RPC 1 ), directory services, system management services,performance measurement services, load balancing, and a whole host of otherpotential components. These services may be distributed across multiple systemsor reside on a single server. When designing an environment, it is easier toseparate the services as if they were running on their own computer systems,only collapsing the relationships between services and the physical serversystem when the final hardware configuration is determined.
“分布式服务”一词是一个非常普遍的标签。过去常用的支持客户端-服务器应用程序分布式的服务包括:远程过程调用设施(RPC),目录服务,系统管理服务,性能测量服务,负载均衡,以及其他一大堆潜在组件。这些服务可能是分布在多个系统或驻留在单个服务器上的。设计环境时,分割每个服务好像更容易些,就好像它们都是运行在自己的电脑系统上一样。当最终的硬件结构确定时,只会破坏服务与物理服务器之间的关系。
Our schematic viewof the client-server world, then, is the client logic communicating withservers providing data access, transaction processing, and compute power.Interaction between the client and the rest of the environment takes placethrough some form of communication facility. A set of infrastructure servicesprovides the glue to hold the application architecture together.
我们的客户端-服务器世界的示意图,是客户端与提供数据访问、事务处理和计算能力的服务器之间的逻辑通信。客户端与环境的交互通过某种形式的通信设施来进行。一组基础设施服务将应用架构粘合在一起。
A transactionprocessing function or database server may, in some cases, differentiate a“commercial” client-server application from a “technical” client-server application. The transactionfacility may be viewed as providing the business logic necessary to properlydirect client behavior, according to a predefined set of rules used to modeldata flow in a business. In most technical applications, this particularservice is usually absent or may be viewed as part of the data service.
一个数据处理函数或一个数据库服务器,也许,在某些情况下,区别对待“商业”客户端服务器应用程序和“技术”客户端服务器应用程序。事务处理能力可以看做是为正确引导客户行为而提供的必要业务逻辑,根据一组预定义规则来为业务中的数据流建模。在大多数技术应用中,这种特殊服务通常是不存在的或可以视为数据服务的一部分。
The infrastructureservices are common functionality needed by all client-server applications andtheir users for proper operation. Time synchronization between computerssystems, software licensing, electronic mail, directory services, userauthentication and access (security), software distribution, and especiallyenvironmental management are all examples of services needed by almost everyapplication in the client-server
environment.Determining what these common services are and ensuring their availability isan important part of the design or assessment of a client-server environment.
基础设施服务是使所有客户端-服务器应用程序及其用户能进行正常操作所需的通用功能。在计算机系统,软件许可,电子邮件,目录服务,用户认证和访问(安全),软件分发,特别是环境管理中的时间同步,是所有客户机-服务器环境中绝大多数应用程序所需的服务实例。确定这些通用服务是什么,并确保它们的可用性是客户端服务器环境的设计或评估的重要组成部分。
网友评论