client-server model peer-to-peer architecture 主从式架构
w
https://zh.wikipedia.org/wiki/主从式架构
主从式架构 (Client–server model) 或客户端-服务器(Client/Server)结构简称C/S结构,是一种网络架构,它把客户端 (Client) (通常是一个采用图形用户界面的程序)与服务器 (Server) 区分开来。每一个客户端软件的实例都可以向一个服务器或应用程序服务器发出请求。有很多不同类型的服务器,例如文件服务器、游戏服务器等。
主从式架构通过不同的途径应用于很多不同类型的应用程序,最常见就是目前在因特网上用的网页。例如,当你在维基百科阅读文章时,你的电脑和网页浏览器就被当做一个客户端,同时,组成维基百科的电脑、数据库和应用程序就被当做服务器。当你的网页浏览器向维基百科请求一个指定的文章时,维基百科服务器从维基百科的数据库中找出所有该文章需要的信息,结合成一个网页,再发送回你的浏览器。
主从式架构意图提供一个可伸缩 (scalable)的架构,借此网上的计算机或者处理过程是一个客户端或者服务器。服务器软件一般,但不总是,运行在强大的专用商业计算机上。另一方面,客户端一般运行在普通个人电脑或者工作站上。
服务端的特征:
- 被动的角色(从)。
- 等待来自用户端的请求。
- 处理请求并传回结果。
用户端的特征:
- 主动的角色(主)。
- 发送请求。
- 等待直到收到响应。
服务器可以是有状态或者无状态的。无状态的服务器不会保留任何两个请求之间的信息,有状态服务器会记住请求之间的信息。这些信息的作用域可以是全局的或者某个事务 (session)的。静态 HTML 页面服务器是一个无状态服务器的例子,Apache Tomcat 是一个有状态服务器。
伺服端与用户端的互动经常使用循序图描述,循序图是 UML 中的一个标准。
https://en.wikipedia.org/wiki/Client-server_model
Comparison with peer-to-peer architecture
In addition to the client–server model, distributed computing applications often use the peer-to-peer (P2P) application architecture.
In the client–server model, the server is often designed to be a centralized system that serves many clients. The computing power, memory and storage requirements of a server must be scaled appropriately to the expected work load (i.e., the number of clients connecting simultaneously). Load balancing and failover systems are often employed to scale the server implementation.
In a peer-to-peer network, two or more computers (peers) pool their resources and communicate in a decentralized system. Peers are coequal, or equipotent nodes in a non-hierarchical network. Unlike clients in a client–server or client–queue–client network, peers communicate with each other directly.[15] In peer-to-peer networking, an algorithm in the peer-to-peer communications protocol balances load, and even peers with modest resources can help to share the load.[15] If a node becomes unavailable, its shared resources remain available as long as other peers offer it. Ideally, a peer does not need to achieve high availability because other, redundant peers make up for any resource downtime; as the availability and load capacity of peers change, the protocol reroutes requests.
client-server model peer-to-peer architecture 主从式架构的更多相关文章
- Client–server model
Client–server model From Wikipedia, the free encyclopedia The client–server model of computing ] Oft ...
- Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization【转】
https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Proto ...
- Peer To Peer——对等网络
今年的考试.大问题没怎么出现. 就是考英语第二天的下午,发生网络阻塞的现象,不影响大局.可是事出有因,我们还是须要看看是什么影响到了考生抽题.最后查了一圈,发现其它几场的英语考试听力都是19M大小,而 ...
- SharePoint Client Object Model API 介绍以及工作原理解析
CSOM和ServerAPI 的对比 SharePoint从2010开始引入了Client Object Model的API(后文中用CSOM来代替),从名字来看,我们可以简单的看出,该API是面向客 ...
- [并发并行]_[线程模型]_[Pthread线程使用模型之三 客户端/服务端模型(Client/Server]
Pthread线程使用模型之三 客户端/服务端模型(Client/Server) 场景 1.在客户端/服务端模型时,客户端向服务端请求一些数据集的操作. 服务端执行执行操作独立的(多进程或跨网络)– ...
- Netty:一种非易失堵塞client/server相框
Netty:一种非易失堵塞client/server相框 作者:chszs.转载需注明.博客主页:http://blog.csdn.net/chszs Netty是一个异步事件驱动的网络应用框架,为J ...
- 深入浅出 Redis client/server交互流程
综述 最近笔者阅读并研究redis源码,在redis客户端与服务器端交互这个内容点上,需要参考网上一些文章,但是遗憾的是发现大部分文章都断断续续的非系统性的,不能给读者此交互流程的整体把握.所以这里我 ...
- 解决在使用client object model的时候报“object does not belong to a list”错误
在查看别人代码的时候,发现了个有意思的问题,使用client object model将一个文件check in 我使用的是如下语句获取file Microsoft.SharePoint.Client ...
- 关于SharePoint 的Client object model该何时load和execut query的一点自己的看法
很多人在用client object model的时候,不知道何时或者该不该load,今天看到一个观点描述这个问题,觉得很有道理,和大家分享.那就是写client object model就像写sql ...
随机推荐
- POJ 3071 Football 【概率DP】
Football Football Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3734 Accepted: 1908 ...
- mysql添加修改字段
ALTER TABLE `uc_organization` ADD COLUMN `agent_id` VARCHAR(50) NOT NULL DEFAULT 0 COMMENT 'sqlserve ...
- Session值的存储与删除
private static void SetSession<T>(string key, T val) { HttpContext.Current.Session[key] = (T)v ...
- 实现html锚点的两种方式
1,a标签+name属性. 2,使用标签的id属性:
- dos指令 批处理文件
windows下开发的时候难免写一些脚本,脚本的调用又难以避免的写批处理文件,也就是(.bat)文件!这个文件是什么呢?其实就是以下的这些dos命令.以下是从网上摘抄的,留以记录,待以后需要时查阅.也 ...
- Python内置函数之callable()
callable()用来检测对象是否可调用的. callable()返回值为True或者False. 下面看看例子 : >>> callable() False >>&g ...
- formail 发送HTML 邮件通过 SENDMAIL
cat a.html | formail -I "Content-type:text/html;charset=utf-8" -I "Subject:layer4 con ...
- 用lua nginx module搭建一个二维码
用lua nginx module搭建一个二维码(qr code)生成器 作者 vinoca 發布於 2014年10月31日 如果有VPS,或者开源的路由器,安装一个nginx,添加lua-nginx ...
- int 与 string::length()
今天在代码中遇到这样的问题 ; while (nStart < strTemp.length()) { ... } 感觉自己写的逻辑没有错误,但是,代码执行结果就是不对,结果单步调试到该处发现, ...
- strust2 和 hibernate的整合------登录的实现
初步认识了struts2,并与hibernate进行整合,完成了一个登录的案例,下面贴源码 1.实体类User public class User { private Integer id; priv ...