[服务器开发]可伸缩系统的设计模式(译)

简介:

Scalable System Design Patterns

可伸缩系统的设计模式

Ricky Ho在他的博客中分享了该文章,该文章是一个简单的概括分享,详细的可以参见他博客的其它详细文章。下面主要是意译。

1Load Balancer:负载均衡由分发者来决定哪个工作者处理下一个请求,这种决定可以基于不同的策略。

“In this model, there is a dispatcher that determines which worker instance will handle the request based on different policies. The application should best be "stateless" so any worker instance can handle the request.

This pattern is deployed in almost every medium to large web site setup.”

该模式中,由分发器来决定哪个工作者来处理请求。应用最好是无状态的,以使任何一个工作者都能同等处理请求。几乎所有的中大型网站都应用了负载均衡器这个模式。

clip_image002[4]

2Scatter and Gather:分散和聚合分发者将请求广播到处理池当中的所有工作者。每一个工作者单独计算其中一部分并将结果返回给分发者,由分发者来汇总所有的计算结果并返回。

”In this model, the dispatcher multicast the request to all workers of the pool. Each worker will compute a local result and send it back to the dispatcher, who will consolidate them into a single response and then send back to the client.

This pattern is used in Search engines like Yahoo, Google to handle user's keyword search request ... etc.“

该模式中,分发者将请求转发给池中的所有工作者,每个工作者处理请求的一部分并返回给分发器,分发器工作者返回的结果加工组合为一个响应返回给客户端。该模式在搜索引擎中使用处理用户的关键字,如YahooGoogle

clip_image004[4]

3Result Cache:结果缓存分发者会首先检查这个请求之前是否有处理过,并试图找出之前的处理结果并返回,以便节省处理时间。

“In this model, the dispatcher will first lookup if the request has been made before and try to find the previous result to return, in order to save the actual execution.

This pattern is commonly used in large enterprise application. Memcached is a very commonly deployed cache server.”

该模式,只是在分发器处理时加了一步查询结果缓存(译注:类似浏览器缓存),如果之前已经处理过并且可以使用之前的缓存,就返回之前的处理结果节省处理时间!该模式通常使用在大型企业应用。Memcached就是一个常用的cache服务器。

clip_image006[4]

4Shared Space:共享空间所有的工作者都关注一块共享区域内的信息,并且都向这块区域提交自己的部分知识、信息。信息不断被完善,直到问题可以被解决为止。

“This model also known as "Blackboard"; all workers monitors information from the shared space and contributes partial knowledge back to the blackboard. The information is continuously enriched until a solution is reached.

This pattern is used in JavaSpace and also commercial product GigaSpace.”

这个模式也叫黑板模式。就是在处理流程中,存在一个全局传递的对象,它可能包含了请求参数、中间状态、响应结果等各种信息,供流程中的各个组件对其进行操作。该模式在JavaSpace(译注:JavaSpaces技术是进行分布式计算的一种简单机制)和GigaSpace(译注:是一个虚拟化的中间件层)中都有使用。

clip_image008[4]

5Pipe and Filter:管道和过滤器所有的工作者按照数据处理的流程被串行连接起来。

“This model is also known as "Data Flow Programming"; all workers connected by pipes where data is flow across.

This pattern is a very common EAI pattern.”

这个模式也叫面向数据流编程,是很通用的企业集成模式。

clip_image010[4]

6Map Reduce:专门用于磁盘IO为瓶颈的批处理作业。使用分布式的文件系统使得文件能够被并行处理。

“The model is targeting batch jobs where disk I/O is the major bottleneck. It use a distributed file system so that disk I/O can be done in parallel.

This pattern is used in many of Google's internal application, as well as implemented in open source Hadoop parallel processing framework. I also find this pattern can be used in many many application design scenarios.”

这个模式使用分布式文件系统,这样磁盘可以并行I/OGoogle内部许多应用程序使用了这个模式。Hadoop就是基于MapReduce的一个实现。

clip_image012[4]

7Bulk Synchronous Parellel:批量同步并行所有工作者一个接一个的执行,由主控来进行协调。

“This model is based on lock-step execution across all workers, coordinated by a master. Each worker repeat the following steps until the exit condition is reached, when there is no more active workers.

1) Each worker read data from input queue

2) Each worker perform local processing based on the read data

3) Each worker push local result along its direct connection

This pattern has been used in Google's Pregel graph processing model as well as the Apache Hama project.”

该模型基于一个master协调,所有的worker同步(lock-step)执行。

该模式被用于Google Pregel Graph Processing google-pregel-graph-processingHama

clip_image014[4]

8Execution Orchestrator:执行集中管理一个智能的调度者在一群简单的工作者上调配已经准备好运行的任务(基于依赖图)

“This model is based on an intelligent scheduler / orchestrator to schedule ready-to-run tasks (based on a dependency graph) across a clusters of dumb workers.

This pattern is used in Microsoft's Dryad project

该模式基于一个智能调度者/管理者在一群工作者之间调配可运行任务。该模式在微软的:Microsoft’s Dryad project中使用。

clip_image016[4]




本文转自吴秦博客园博客,原文链接:http://www.cnblogs.com/skynet/archive/2012/12/04/2801656.html,如需转载请自行联系原作者


相关文章
|
4月前
|
设计模式 消息中间件 传感器
Java 设计模式之观察者模式:构建松耦合的事件响应系统
观察者模式是Java中常用的行为型设计模式,用于构建松耦合的事件响应系统。当一个对象状态改变时,所有依赖它的观察者将自动收到通知并更新。该模式通过抽象耦合实现发布-订阅机制,广泛应用于GUI事件处理、消息通知、数据监控等场景,具有良好的可扩展性和维护性。
428 8
|
5月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
380 18
|
存储 Ubuntu Linux
HPE SPP 2025.09.00.00 - HPE 服务器固件、驱动程序和系统软件包 (Released Oct 2025)
HPE SPP 2025.09.00.00 - HPE 服务器固件、驱动程序和系统软件包
194 0
|
5月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
406 15
|
6月前
|
域名解析 运维 监控
阿里云轻量服务器的系统镜像和应用镜像的区别
轻量应用服务器是阿里云推出的易用型云服务器,支持一键部署、域名解析、安全管理和运维监控。本文介绍其系统镜像与应用镜像的区别及选择建议,助您根据业务需求和技术能力快速决策,实现高效部署。
|
6月前
|
存储 Linux 测试技术
HPE SPP 2025.07.00.00 - HPE 服务器固件、驱动程序和系统软件包
HPE SPP 2025.07.00.00 - HPE 服务器固件、驱动程序和系统软件包
250 4
|
7月前
|
监控 关系型数据库 数据库连接
FastAdmin系统框架通用操作平滑迁移到新服务器的详细步骤-优雅草卓伊凡
FastAdmin系统框架通用操作平滑迁移到新服务器的详细步骤-优雅草卓伊凡
253 3
FastAdmin系统框架通用操作平滑迁移到新服务器的详细步骤-优雅草卓伊凡
|
8月前
|
Linux 网络安全 数据安全/隐私保护
使用Linux系统的mount命令挂载远程服务器的文件夹。
如此一来,你就完成了一次从你的Linux发车站到远程服务器文件夹的有趣旅行。在这个技术之旅中,你既探索了新地方,也学到了如何桥接不同系统之间的距离。
1477 21
|
8月前
|
Ubuntu Linux 数据中心
阿里云服务器纯净版系统解析:公共镜像版本特性与选择指南参考
当我们选购阿里云服务器时,系统镜像的选择至关重要。阿里云为用户提供了多种系统镜像,包括公共镜像、自定义镜像、共享镜像、云市场镜像和社区镜像。其中,公共镜像为纯净版系统,这些系统皆已正版授权,旨在为ECS实例上的应用程序提供安全、稳定的运行环境。本文将为大家详细汇总阿里云服务器纯净版系统及最新的系统版本,以供大家了解和选择。

热门文章

最新文章