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?