Difference between pool and cluster

北城以北 提交于 2019-12-04 10:48:55

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11333901/difference-between-pool-and-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!