For faster navigation, this Iframe is preloading the Wikiwand page for 客户端-伺服器架构.

客户端-伺服器架构

客户端通过互联网与伺服器交互的图例

客户端-伺服器架构(英语:Client-server model),也称C/S架构zòng式架构[1],是一种将客户端伺服器分割开来的分布式架构。[2]每一个客户端软件的实例都可以向一个伺服器或应用程式伺服器发出请求。有很多不同类型的伺服器,例如文件伺服器、游戏伺服器等。

主从式架构通过不同的途径应用于很多不同类型的应用程式,最常见的用途为万维网上的网页。例如,当在维基百科阅读文章时,电脑和网页浏览器即为客户端;同时,组成维基百科的电脑、数据库和应用程式即为伺服器。当网页浏览器向维基百科请求指定的页面时,维基百科伺服器从维基百科的数据库中找出所有该页面需要的资讯,结合成一个网页,再发送回浏览器。

特征

主从式架构意图提供一个可伸缩(英语:scalable)的架构,借此网上的电脑或者处理过程是一个客户端或者伺服器。伺服器软件一般,但不总是,运行在强大的专用商业电脑上。另一方面,客户端一般运行在普通个人电脑或者工作站上。

服务端的特征:

  • 被动的角色(从)。
  • 等待来自客户端的请求。
  • 处理请求并传回结果。

客户端的特征:

  • 主动的角色(主)。
  • 发送请求。
  • 等待直到收到响应。

伺服器可以是有状态或者无状态的。无状态的伺服器不会保留任何两个请求之间的资讯,有状态伺服器会记住请求之间的资讯。这些资讯的作用域可以是全局的或者某个事务 (session)的。静态HTML页面伺服器是一个无状态伺服器的例子,Apache Tomcat是一个有状态伺服器。

服务端与客户端的交互经常使用循序图描述,循序图是UML中的一个标准。

与点对点技术的比较

另一种目前广范使用的网络架构类型是点对点架构(P2P),不同于主从式架构,网络上的每个使用端或程序的实体都拥有相同的等级,同时扮演客户端与伺服器的角色。

参见

其他网络架构

参考文献

  1. ^ 辭典檢視 [主從式架構 : ㄓㄨˇ ㄗㄨㄥˋ ㄕˋ ㄐㄧㄚˋ ㄍㄡˋ] - 教育部《重編國語辭典修訂本》. 中华民国教育部. (原始内容存档于2022-12-04). 
  2. ^ Distributed Application Architecture (PDF). Sun Microsystem. [2009-06-16]. (原始内容 (PDF)存档于2011-04-06). 
{{bottomLinkPreText}} {{bottomLinkText}}
客户端-伺服器架构
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?