池和集群之间的区别 [英] Difference between pool and cluster

查看:152
本文介绍了池和集群之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从最纯粹的角度来看,他们的感觉就像是相同的概念。两者都管理一组重用/节点,并控制它们从外部组件的访问。



使用池,您可以借用并从池返回这些资源/节点。



对于集群,您有一个负载均衡器位于资源/节点前方,您可以通过请求打入负载均衡器。



在这两种情况下,您绝对不能控制您的请求/借用映射到哪个资源/节点。



所以我提出了一个问题: strong>池模式和负载平衡集群之间的根本区别是什么?

解决方案

用于避免不断创建和破坏创建成本高的资源。池中的资源一次只能由一个客户端使用。可用资源存储在池中。当你需要一个,你从池中得到它,从而使其不可用于其他客户端。完成资源后,将其放回池中。池通常用于数据库连接和线程。另一个优点是它允许将资源数量(连接线程)维持在合理的最大值。



集群是一组节点(计算机,虚拟机),允许服务大量并发客户机(可扩展性)并避免单点故障(故障转移,冗余)。还要注意,负载平衡器不一定是随机的。在许多情况下,负载平衡器使用粘性会话:一旦一个客户端被分配到集群的一个节点,他的所有后续请求都将转到同一个节点。



因此,池和群集之间的目标不一样。存储在池中的资源与集群的资源不同。


From a purest perspective, they kind of feel like identical concepts. Both manage sets of reosurces/nodes and control their access from or by external components.

With a pool, you borrow and return these resources/nodes to and from the pool.

With a cluster, you have a load balancer sitting in front of the resources/nodes and you hit the load balancer with a request.

In both cases you have absolutely no control over which resource/node your request/borrow gets mapped to.

So I pose the question: what's the fundamental difference between the "pool" pattern and a load-balanced cluster?

解决方案

A pool is used to avoid constantly creating and destroying resources that are costly to create. A resource from a pool can be used by only one client at a time. Available resources are stored in the pool. When you need one, you get it from the pool and thus make it unavailable to other clients. When you're done with the resource, you put it back to the pool. Pools are used for database connections and threads, typically. Another advantage is that it allows maintaining the number of resources (connections, threads) to a reasonable maximum.

A cluster is a collection of nodes (computers, virtual machines) which allows serving a larger number of concurrent clients (scalability) and avoiding a single point of failure (failover, redundancy). Also note that load balancers are not necessarily random. In many cases, the load balancer uses sticky sessions: once a client has been assigned to a node of the cluster, all his subsequent requests go to the same node.

The goals are thus not the same between a pool and a cluster. And the resources stored in a pool are not the same kind as the resources of a cluster.

这篇关于池和集群之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆